diff --git a/comfy_api_nodes/apis/__init__.py b/comfy_api_nodes/apis/__init__.py index a96eb3c1f..517923915 100644 --- a/comfy_api_nodes/apis/__init__.py +++ b/comfy_api_nodes/apis/__init__.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: filtered-openapi.yaml -# timestamp: 2025-05-17T21:08:37+00:00 +# timestamp: 2025-05-20T01:04:45+00:00 from __future__ import annotations @@ -4071,10 +4071,29 @@ class RunwayTaskStatusEnum(str, Enum): class RunwayTaskStatusResponse(BaseModel): - createdAt: Optional[datetime] = Field(None, description='Task creation timestamp') - id: Optional[str] = Field(None, description='Task ID') + createdAt: datetime = Field(..., description='Task creation timestamp') + id: str = Field(..., description='Task ID') 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): @@ -4092,11 +4111,7 @@ class RunwayTextToImageRequest(BaseModel): promptText: str = Field( ..., description='Text prompt for the image generation', max_length=1000 ) - ratio: str = Field( - ..., - description='The resolution (aspect ratio) of the output image', - examples=['1920:1088'], - ) + ratio: RunwayTextToImageAspectRatioEnum referenceImages: Optional[List[ReferenceImage]] = Field( None, description='Array of reference images to guide the generation' ) diff --git a/comfy_api_nodes/nodes_runway.py b/comfy_api_nodes/nodes_runway.py index b13cdc996..af4b321f9 100644 --- a/comfy_api_nodes/nodes_runway.py +++ b/comfy_api_nodes/nodes_runway.py @@ -30,6 +30,7 @@ from comfy_api_nodes.apis import ( RunwayTextToImageResponse, Model4, ReferenceImage, + RunwayTextToImageAspectRatioEnum, ) from comfy_api_nodes.apis.client import ( ApiEndpoint, @@ -82,24 +83,6 @@ class RunwayGen3aAspectRatio(str, Enum): 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]: """Returns the video URL from the task status response if it exists.""" if response.output and len(response.output) > 0: @@ -524,7 +507,7 @@ class RunwayTextToImageNode(ComfyNodeABC): IO.COMBO, RunwayTextToImageRequest, "ratio", - enum_type=RunwayTextToImageRatio, + enum_type=RunwayTextToImageAspectRatioEnum, ), }, "optional": {