-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[API Nodes] add Kling O1 model support #11025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Kosinkadink
merged 3 commits into
Comfy-Org:master
from
bigcat88:feat/api-nodes/kling-video-o1
Dec 2, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| from pydantic import BaseModel, Field | ||
|
|
||
|
|
||
| class OmniProText2VideoRequest(BaseModel): | ||
| model_name: str = Field(..., description="kling-video-o1") | ||
| aspect_ratio: str = Field(..., description="'16:9', '9:16' or '1:1'") | ||
| duration: str = Field(..., description="'5' or '10'") | ||
| prompt: str = Field(...) | ||
| mode: str = Field("pro") | ||
|
|
||
|
|
||
| class OmniParamImage(BaseModel): | ||
| image_url: str = Field(...) | ||
| type: str | None = Field(None, description="Can be 'first_frame' or 'end_frame'") | ||
|
|
||
|
|
||
| class OmniParamVideo(BaseModel): | ||
| video_url: str = Field(...) | ||
| refer_type: str | None = Field(..., description="Can be 'base' or 'feature'") | ||
| keep_original_sound: str = Field(..., description="'yes' or 'no'") | ||
|
|
||
|
|
||
| class OmniProFirstLastFrameRequest(BaseModel): | ||
| model_name: str = Field(..., description="kling-video-o1") | ||
| image_list: list[OmniParamImage] = Field(..., min_length=1, max_length=7) | ||
| duration: str = Field(..., description="'5' or '10'") | ||
| prompt: str = Field(...) | ||
| mode: str = Field("pro") | ||
|
|
||
|
|
||
| class OmniProReferences2VideoRequest(BaseModel): | ||
| model_name: str = Field(..., description="kling-video-o1") | ||
| aspect_ratio: str | None = Field(..., description="'16:9', '9:16' or '1:1'") | ||
| image_list: list[OmniParamImage] | None = Field( | ||
| None, max_length=7, description="Max length 4 when video is present." | ||
| ) | ||
| video_list: list[OmniParamVideo] | None = Field(None, max_length=1) | ||
| duration: str | None = Field(..., description="From 3 to 10.") | ||
| prompt: str = Field(...) | ||
| mode: str = Field("pro") | ||
|
|
||
|
|
||
| class TaskStatusVideoResult(BaseModel): | ||
| duration: str | None = Field(None, description="Total video duration") | ||
| id: str | None = Field(None, description="Generated video ID") | ||
| url: str | None = Field(None, description="URL for generated video") | ||
|
|
||
|
|
||
| class TaskStatusVideoResults(BaseModel): | ||
| videos: list[TaskStatusVideoResult] | None = Field(None) | ||
|
|
||
|
|
||
| class TaskStatusVideoResponseData(BaseModel): | ||
| created_at: int | None = Field(None, description="Task creation time") | ||
| updated_at: int | None = Field(None, description="Task update time") | ||
| task_status: str | None = None | ||
| task_status_msg: str | None = Field(None, description="Additional failure reason. Only for polling endpoint.") | ||
| task_id: str | None = Field(None, description="Task ID") | ||
| task_result: TaskStatusVideoResults | None = Field(None) | ||
|
|
||
|
|
||
| class TaskStatusVideoResponse(BaseModel): | ||
| code: int | None = Field(None, description="Error code") | ||
| message: str | None = Field(None, description="Error message") | ||
| request_id: str | None = Field(None, description="Request ID") | ||
| data: TaskStatusVideoResponseData | None = Field(None) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change, this doesn't work. The input is traditionally a string, not an enum value, eg from the SaveVideo node it emits
"mp4"notVideoContainer.MP4.This means the SaveVideo node does not work since this update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @Kosinkadink @comfyanonymous fatal breaking bug for a lot of video workflows^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should fix custom nodes
#11046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be clear for the record, the error replication does not require custom nodes at all, though I see you did notice and patch the native SaveVideo node in the PR, so that looks good to me