feat(api-nodes-Kling): add new models (V3, O3) (#12389)

* feat(api-nodes-Kling): add new models (V3, O3)

* remove storyboard from VideoToVideo node

* added check for total duration of storyboards

* fixed other small things

* updated display name for nodes

* added "fake" seed
This commit is contained in:
Alexander Piskun 2026-02-10 19:34:54 +02:00 committed by GitHub
parent c1b63a7e78
commit 8ca842a8ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 750 additions and 68 deletions

View File

@ -1197,12 +1197,6 @@ class KlingImageGenImageReferenceType(str, Enum):
face = 'face' face = 'face'
class KlingImageGenModelName(str, Enum):
kling_v1 = 'kling-v1'
kling_v1_5 = 'kling-v1-5'
kling_v2 = 'kling-v2'
class KlingImageGenerationsRequest(BaseModel): class KlingImageGenerationsRequest(BaseModel):
aspect_ratio: Optional[KlingImageGenAspectRatio] = '16:9' aspect_ratio: Optional[KlingImageGenAspectRatio] = '16:9'
callback_url: Optional[AnyUrl] = Field( callback_url: Optional[AnyUrl] = Field(
@ -1218,7 +1212,7 @@ class KlingImageGenerationsRequest(BaseModel):
0.5, description='Reference intensity for user-uploaded images', ge=0.0, le=1.0 0.5, description='Reference intensity for user-uploaded images', ge=0.0, le=1.0
) )
image_reference: Optional[KlingImageGenImageReferenceType] = None image_reference: Optional[KlingImageGenImageReferenceType] = None
model_name: Optional[KlingImageGenModelName] = 'kling-v1' model_name: str = Field(...)
n: Optional[int] = Field(1, description='Number of generated images', ge=1, le=9) n: Optional[int] = Field(1, description='Number of generated images', ge=1, le=9)
negative_prompt: Optional[str] = Field( negative_prompt: Optional[str] = Field(
None, description='Negative text prompt', max_length=200 None, description='Negative text prompt', max_length=200

View File

@ -1,12 +1,22 @@
from pydantic import BaseModel, Field from pydantic import BaseModel, Field
class MultiPromptEntry(BaseModel):
index: int = Field(...)
prompt: str = Field(...)
duration: str = Field(...)
class OmniProText2VideoRequest(BaseModel): class OmniProText2VideoRequest(BaseModel):
model_name: str = Field(..., description="kling-video-o1") model_name: str = Field(..., description="kling-video-o1")
aspect_ratio: str = Field(..., description="'16:9', '9:16' or '1:1'") aspect_ratio: str = Field(..., description="'16:9', '9:16' or '1:1'")
duration: str = Field(..., description="'5' or '10'") duration: str = Field(..., description="'5' or '10'")
prompt: str = Field(...) prompt: str = Field(...)
mode: str = Field("pro") mode: str = Field("pro")
multi_shot: bool | None = Field(None)
multi_prompt: list[MultiPromptEntry] | None = Field(None)
shot_type: str | None = Field(None)
sound: str = Field(..., description="'on' or 'off'")
class OmniParamImage(BaseModel): class OmniParamImage(BaseModel):
@ -26,6 +36,10 @@ class OmniProFirstLastFrameRequest(BaseModel):
duration: str = Field(..., description="'5' or '10'") duration: str = Field(..., description="'5' or '10'")
prompt: str = Field(...) prompt: str = Field(...)
mode: str = Field("pro") mode: str = Field("pro")
sound: str | None = Field(None, description="'on' or 'off'")
multi_shot: bool | None = Field(None)
multi_prompt: list[MultiPromptEntry] | None = Field(None)
shot_type: str | None = Field(None)
class OmniProReferences2VideoRequest(BaseModel): class OmniProReferences2VideoRequest(BaseModel):
@ -38,6 +52,10 @@ class OmniProReferences2VideoRequest(BaseModel):
duration: str | None = Field(..., description="From 3 to 10.") duration: str | None = Field(..., description="From 3 to 10.")
prompt: str = Field(...) prompt: str = Field(...)
mode: str = Field("pro") mode: str = Field("pro")
sound: str | None = Field(None, description="'on' or 'off'")
multi_shot: bool | None = Field(None)
multi_prompt: list[MultiPromptEntry] | None = Field(None)
shot_type: str | None = Field(None)
class TaskStatusVideoResult(BaseModel): class TaskStatusVideoResult(BaseModel):
@ -54,6 +72,7 @@ class TaskStatusImageResult(BaseModel):
class TaskStatusResults(BaseModel): class TaskStatusResults(BaseModel):
videos: list[TaskStatusVideoResult] | None = Field(None) videos: list[TaskStatusVideoResult] | None = Field(None)
images: list[TaskStatusImageResult] | None = Field(None) images: list[TaskStatusImageResult] | None = Field(None)
series_images: list[TaskStatusImageResult] | None = Field(None)
class TaskStatusResponseData(BaseModel): class TaskStatusResponseData(BaseModel):
@ -77,31 +96,42 @@ class OmniImageParamImage(BaseModel):
class OmniProImageRequest(BaseModel): class OmniProImageRequest(BaseModel):
model_name: str = Field(..., description="kling-image-o1") model_name: str = Field(...)
resolution: str = Field(..., description="'1k' or '2k'") resolution: str = Field(...)
aspect_ratio: str | None = Field(...) aspect_ratio: str | None = Field(...)
prompt: str = Field(...) prompt: str = Field(...)
mode: str = Field("pro") mode: str = Field("pro")
n: int | None = Field(1, le=9) n: int | None = Field(1, le=9)
image_list: list[OmniImageParamImage] | None = Field(..., max_length=10) image_list: list[OmniImageParamImage] | None = Field(..., max_length=10)
result_type: str | None = Field(None, description="Set to 'series' for series generation")
series_amount: int | None = Field(None, ge=2, le=9, description="Number of images in a series")
class TextToVideoWithAudioRequest(BaseModel): class TextToVideoWithAudioRequest(BaseModel):
model_name: str = Field(..., description="kling-v2-6") model_name: str = Field(...)
aspect_ratio: str = Field(..., description="'16:9', '9:16' or '1:1'") aspect_ratio: str = Field(..., description="'16:9', '9:16' or '1:1'")
duration: str = Field(..., description="'5' or '10'") duration: str = Field(...)
prompt: str = Field(...) prompt: str | None = Field(...)
negative_prompt: str | None = Field(None)
mode: str = Field("pro") mode: str = Field("pro")
sound: str = Field(..., description="'on' or 'off'") sound: str = Field(..., description="'on' or 'off'")
multi_shot: bool | None = Field(None)
multi_prompt: list[MultiPromptEntry] | None = Field(None)
shot_type: str | None = Field(None)
class ImageToVideoWithAudioRequest(BaseModel): class ImageToVideoWithAudioRequest(BaseModel):
model_name: str = Field(..., description="kling-v2-6") model_name: str = Field(...)
image: str = Field(...) image: str = Field(...)
duration: str = Field(..., description="'5' or '10'") image_tail: str | None = Field(None)
prompt: str = Field(...) duration: str = Field(...)
prompt: str | None = Field(...)
negative_prompt: str | None = Field(None)
mode: str = Field("pro") mode: str = Field("pro")
sound: str = Field(..., description="'on' or 'off'") sound: str = Field(..., description="'on' or 'off'")
multi_shot: bool | None = Field(None)
multi_prompt: list[MultiPromptEntry] | None = Field(None)
shot_type: str | None = Field(None)
class MotionControlRequest(BaseModel): class MotionControlRequest(BaseModel):

File diff suppressed because it is too large Load Diff