mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-04 12:57:09 +08:00
Update runway i2v ratio enum (#201)
This commit is contained in:
parent
270cfc1ef2
commit
47acfca866
@ -1,6 +1,6 @@
|
|||||||
# generated by datamodel-codegen:
|
# generated by datamodel-codegen:
|
||||||
# filename: filtered-openapi.yaml
|
# filename: filtered-openapi.yaml
|
||||||
# timestamp: 2025-05-17T21:08:37+00:00
|
# timestamp: 2025-05-20T01:04:45+00:00
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
@ -4071,10 +4071,29 @@ class RunwayTaskStatusEnum(str, Enum):
|
|||||||
|
|
||||||
|
|
||||||
class RunwayTaskStatusResponse(BaseModel):
|
class RunwayTaskStatusResponse(BaseModel):
|
||||||
createdAt: Optional[datetime] = Field(None, description='Task creation timestamp')
|
createdAt: datetime = Field(..., description='Task creation timestamp')
|
||||||
id: Optional[str] = Field(None, description='Task ID')
|
id: str = Field(..., description='Task ID')
|
||||||
output: Optional[List[str]] = Field(None, description='Array of output video URLs')
|
output: Optional[List[str]] = Field(None, description='Array of output video URLs')
|
||||||
status: Optional[RunwayTaskStatusEnum] = None
|
progress: Optional[float] = Field(
|
||||||
|
None,
|
||||||
|
description='Float value between 0 and 1 representing the progress of the task. Only available if status is RUNNING.',
|
||||||
|
ge=0.0,
|
||||||
|
le=1.0,
|
||||||
|
)
|
||||||
|
status: RunwayTaskStatusEnum
|
||||||
|
|
||||||
|
|
||||||
|
class RunwayTextToImageAspectRatioEnum(str, Enum):
|
||||||
|
field_1920_1080 = '1920:1080'
|
||||||
|
field_1080_1920 = '1080:1920'
|
||||||
|
field_1024_1024 = '1024:1024'
|
||||||
|
field_1360_768 = '1360:768'
|
||||||
|
field_1080_1080 = '1080:1080'
|
||||||
|
field_1168_880 = '1168:880'
|
||||||
|
field_1440_1080 = '1440:1080'
|
||||||
|
field_1080_1440 = '1080:1440'
|
||||||
|
field_1808_768 = '1808:768'
|
||||||
|
field_2112_912 = '2112:912'
|
||||||
|
|
||||||
|
|
||||||
class Model4(str, Enum):
|
class Model4(str, Enum):
|
||||||
@ -4092,11 +4111,7 @@ class RunwayTextToImageRequest(BaseModel):
|
|||||||
promptText: str = Field(
|
promptText: str = Field(
|
||||||
..., description='Text prompt for the image generation', max_length=1000
|
..., description='Text prompt for the image generation', max_length=1000
|
||||||
)
|
)
|
||||||
ratio: str = Field(
|
ratio: RunwayTextToImageAspectRatioEnum
|
||||||
...,
|
|
||||||
description='The resolution (aspect ratio) of the output image',
|
|
||||||
examples=['1920:1088'],
|
|
||||||
)
|
|
||||||
referenceImages: Optional[List[ReferenceImage]] = Field(
|
referenceImages: Optional[List[ReferenceImage]] = Field(
|
||||||
None, description='Array of reference images to guide the generation'
|
None, description='Array of reference images to guide the generation'
|
||||||
)
|
)
|
||||||
|
|||||||
@ -30,6 +30,7 @@ from comfy_api_nodes.apis import (
|
|||||||
RunwayTextToImageResponse,
|
RunwayTextToImageResponse,
|
||||||
Model4,
|
Model4,
|
||||||
ReferenceImage,
|
ReferenceImage,
|
||||||
|
RunwayTextToImageAspectRatioEnum,
|
||||||
)
|
)
|
||||||
from comfy_api_nodes.apis.client import (
|
from comfy_api_nodes.apis.client import (
|
||||||
ApiEndpoint,
|
ApiEndpoint,
|
||||||
@ -82,24 +83,6 @@ class RunwayGen3aAspectRatio(str, Enum):
|
|||||||
field_1280_768 = "1280:768"
|
field_1280_768 = "1280:768"
|
||||||
|
|
||||||
|
|
||||||
# TODO: replace with enum after it's added in comfy-api and generated by code gen
|
|
||||||
class RunwayTextToImageRatio(str, Enum):
|
|
||||||
"""Aspect ratios supported for Text to Image API."""
|
|
||||||
|
|
||||||
# 16:9 landscape
|
|
||||||
field_16_9 = "1920:1088"
|
|
||||||
# 9:16 portrait
|
|
||||||
field_9_16 = "1088:1920"
|
|
||||||
# 1:1 square
|
|
||||||
field_1_1 = "1088:1088"
|
|
||||||
# 4:3 landscape
|
|
||||||
field_4_3 = "1456:1088"
|
|
||||||
# 3:4 portrait
|
|
||||||
field_3_4 = "1088:1456"
|
|
||||||
# 21:9 ultrawide
|
|
||||||
field_21_9 = "2112:912"
|
|
||||||
|
|
||||||
|
|
||||||
def get_video_url_from_task_status(response: TaskStatusResponse) -> Union[str, None]:
|
def get_video_url_from_task_status(response: TaskStatusResponse) -> Union[str, None]:
|
||||||
"""Returns the video URL from the task status response if it exists."""
|
"""Returns the video URL from the task status response if it exists."""
|
||||||
if response.output and len(response.output) > 0:
|
if response.output and len(response.output) > 0:
|
||||||
@ -524,7 +507,7 @@ class RunwayTextToImageNode(ComfyNodeABC):
|
|||||||
IO.COMBO,
|
IO.COMBO,
|
||||||
RunwayTextToImageRequest,
|
RunwayTextToImageRequest,
|
||||||
"ratio",
|
"ratio",
|
||||||
enum_type=RunwayTextToImageRatio,
|
enum_type=RunwayTextToImageAspectRatioEnum,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
"optional": {
|
"optional": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user