Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions comfy_api/latest/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,25 @@ class Combo(ComfyTypeIO):
class Input(WidgetInput):
"""Combo input (dropdown)."""
Type = str
def __init__(self, id: str, options: list[str]=None, display_name: str=None, optional=False, tooltip: str=None, lazy: bool=None,
default: str=None, control_after_generate: bool=None,
upload: UploadType=None, image_folder: FolderType=None,
remote: RemoteOptions=None,
socketless: bool=None):
def __init__(
self,
id: str,
options: list[str] | list[int] | type[Enum] = None,
display_name: str=None,
optional=False,
tooltip: str=None,
lazy: bool=None,
default: str | int | Enum = None,
control_after_generate: bool=None,
upload: UploadType=None,
image_folder: FolderType=None,
remote: RemoteOptions=None,
socketless: bool=None,
):
if isinstance(options, type) and issubclass(options, Enum):
options = [v.value for v in options]
if isinstance(default, Enum):
default = default.value
super().__init__(id, display_name, optional, tooltip, lazy, default, socketless)
self.multiselect = False
self.options = options
Expand Down
16 changes: 8 additions & 8 deletions comfy_api_nodes/nodes_bytedance.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ def define_schema(cls):
inputs=[
comfy_io.Combo.Input(
"model",
options=[model.value for model in Text2ImageModelName],
default=Text2ImageModelName.seedream_3.value,
options=Text2ImageModelName,
default=Text2ImageModelName.seedream_3,
tooltip="Model name",
),
comfy_io.String.Input(
Expand Down Expand Up @@ -382,8 +382,8 @@ def define_schema(cls):
inputs=[
comfy_io.Combo.Input(
"model",
options=[model.value for model in Image2ImageModelName],
default=Image2ImageModelName.seededit_3.value,
options=Image2ImageModelName,
default=Image2ImageModelName.seededit_3,
tooltip="Model name",
),
comfy_io.Image.Input(
Expand Down Expand Up @@ -676,8 +676,8 @@ def define_schema(cls):
inputs=[
comfy_io.Combo.Input(
"model",
options=[model.value for model in Text2VideoModelName],
default=Text2VideoModelName.seedance_1_pro.value,
options=Text2VideoModelName,
default=Text2VideoModelName.seedance_1_pro,
tooltip="Model name",
),
comfy_io.String.Input(
Expand Down Expand Up @@ -793,8 +793,8 @@ def define_schema(cls):
inputs=[
comfy_io.Combo.Input(
"model",
options=[model.value for model in Image2VideoModelName],
default=Image2VideoModelName.seedance_1_pro.value,
options=Image2VideoModelName,
default=Image2VideoModelName.seedance_1_pro,
tooltip="Model name",
),
comfy_io.String.Input(
Expand Down
20 changes: 10 additions & 10 deletions comfy_api_nodes/nodes_kling.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def define_schema(cls) -> comfy_io.Schema:
category="api node/video/Kling",
description="Allows specifying configuration options for Kling Camera Controls and motion control effects.",
inputs=[
comfy_io.Combo.Input("camera_control_type", options=[i.value for i in KlingCameraControlType]),
comfy_io.Combo.Input("camera_control_type", options=KlingCameraControlType),
comfy_io.Float.Input(
"horizontal_movement",
default=0.0,
Expand Down Expand Up @@ -772,7 +772,7 @@ def define_schema(cls) -> comfy_io.Schema:
comfy_io.Float.Input("cfg_scale", default=1.0, min=0.0, max=1.0),
comfy_io.Combo.Input(
"aspect_ratio",
options=[i.value for i in KlingVideoGenAspectRatio],
options=KlingVideoGenAspectRatio,
default="16:9",
),
comfy_io.Combo.Input(
Expand Down Expand Up @@ -840,7 +840,7 @@ def define_schema(cls) -> comfy_io.Schema:
comfy_io.Float.Input("cfg_scale", default=0.75, min=0.0, max=1.0),
comfy_io.Combo.Input(
"aspect_ratio",
options=[i.value for i in KlingVideoGenAspectRatio],
options=KlingVideoGenAspectRatio,
default="16:9",
),
comfy_io.Custom("CAMERA_CONTROL").Input(
Expand Down Expand Up @@ -903,17 +903,17 @@ def define_schema(cls) -> comfy_io.Schema:
comfy_io.String.Input("negative_prompt", multiline=True, tooltip="Negative text prompt"),
comfy_io.Combo.Input(
"model_name",
options=[i.value for i in KlingVideoGenModelName],
options=KlingVideoGenModelName,
default="kling-v2-master",
),
comfy_io.Float.Input("cfg_scale", default=0.8, min=0.0, max=1.0),
comfy_io.Combo.Input("mode", options=[i.value for i in KlingVideoGenMode], default="std"),
comfy_io.Combo.Input("mode", options=KlingVideoGenMode, default=KlingVideoGenMode.std),
comfy_io.Combo.Input(
"aspect_ratio",
options=[i.value for i in KlingVideoGenAspectRatio],
default="16:9",
options=KlingVideoGenAspectRatio,
default=KlingVideoGenAspectRatio.field_16_9,
),
comfy_io.Combo.Input("duration", options=[i.value for i in KlingVideoGenDuration], default="5"),
comfy_io.Combo.Input("duration", options=KlingVideoGenDuration, default=KlingVideoGenDuration.field_5),
],
outputs=[
comfy_io.Video.Output(),
Expand Down Expand Up @@ -984,8 +984,8 @@ def define_schema(cls) -> comfy_io.Schema:
comfy_io.Float.Input("cfg_scale", default=0.75, min=0.0, max=1.0),
comfy_io.Combo.Input(
"aspect_ratio",
options=[i.value for i in KlingVideoGenAspectRatio],
default="16:9",
options=KlingVideoGenAspectRatio,
default=KlingVideoGenAspectRatio.field_16_9,
),
comfy_io.Custom("CAMERA_CONTROL").Input(
"camera_control",
Expand Down
18 changes: 9 additions & 9 deletions comfy_api_nodes/nodes_luma.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ def define_schema(cls) -> comfy_io.Schema:
),
comfy_io.Combo.Input(
"model",
options=[model.value for model in LumaImageModel],
options=LumaImageModel,
),
comfy_io.Combo.Input(
"aspect_ratio",
options=[ratio.value for ratio in LumaAspectRatio],
options=LumaAspectRatio,
default=LumaAspectRatio.ratio_16_9,
),
comfy_io.Int.Input(
Expand Down Expand Up @@ -366,7 +366,7 @@ def define_schema(cls) -> comfy_io.Schema:
),
comfy_io.Combo.Input(
"model",
options=[model.value for model in LumaImageModel],
options=LumaImageModel,
),
comfy_io.Int.Input(
"seed",
Expand Down Expand Up @@ -466,21 +466,21 @@ def define_schema(cls) -> comfy_io.Schema:
),
comfy_io.Combo.Input(
"model",
options=[model.value for model in LumaVideoModel],
options=LumaVideoModel,
),
comfy_io.Combo.Input(
"aspect_ratio",
options=[ratio.value for ratio in LumaAspectRatio],
options=LumaAspectRatio,
default=LumaAspectRatio.ratio_16_9,
),
comfy_io.Combo.Input(
"resolution",
options=[resolution.value for resolution in LumaVideoOutputResolution],
options=LumaVideoOutputResolution,
default=LumaVideoOutputResolution.res_540p,
),
comfy_io.Combo.Input(
"duration",
options=[dur.value for dur in LumaVideoModelOutputDuration],
options=LumaVideoModelOutputDuration,
),
comfy_io.Boolean.Input(
"loop",
Expand Down Expand Up @@ -595,7 +595,7 @@ def define_schema(cls) -> comfy_io.Schema:
),
comfy_io.Combo.Input(
"model",
options=[model.value for model in LumaVideoModel],
options=LumaVideoModel,
),
# comfy_io.Combo.Input(
# "aspect_ratio",
Expand All @@ -604,7 +604,7 @@ def define_schema(cls) -> comfy_io.Schema:
# ),
comfy_io.Combo.Input(
"resolution",
options=[resolution.value for resolution in LumaVideoOutputResolution],
options=LumaVideoOutputResolution,
default=LumaVideoOutputResolution.res_540p,
),
comfy_io.Combo.Input(
Expand Down
6 changes: 3 additions & 3 deletions comfy_api_nodes/nodes_pika.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def get_base_inputs_types() -> list[comfy_io.Input]:
comfy_io.String.Input("negative_prompt", multiline=True),
comfy_io.Int.Input("seed", min=0, max=0xFFFFFFFF, control_after_generate=True),
comfy_io.Combo.Input(
"resolution", options=[resolution.value for resolution in PikaResolutionEnum], default="1080p"
"resolution", options=PikaResolutionEnum, default=PikaResolutionEnum.field_1080p
),
comfy_io.Combo.Input(
"duration", options=[duration.value for duration in PikaDurationEnum], default=5
"duration", options=PikaDurationEnum, default=PikaDurationEnum.integer_5
),
]

Expand Down Expand Up @@ -616,7 +616,7 @@ def define_schema(cls) -> comfy_io.Schema:
inputs=[
comfy_io.Image.Input("image", tooltip="The reference image to apply the Pikaffect to."),
comfy_io.Combo.Input(
"pikaffect", options=[pikaffect.value for pikaffect in Pikaffect], default="Cake-ify"
"pikaffect", options=Pikaffect, default="Cake-ify"
),
comfy_io.String.Input("prompt_text", multiline=True),
comfy_io.String.Input("negative_prompt", multiline=True),
Expand Down
22 changes: 11 additions & 11 deletions comfy_api_nodes/nodes_pixverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def define_schema(cls) -> comfy_io.Schema:
display_name="PixVerse Template",
category="api node/video/PixVerse",
inputs=[
comfy_io.Combo.Input("template", options=[list(pixverse_templates.keys())]),
comfy_io.Combo.Input("template", options=list(pixverse_templates.keys())),
],
outputs=[comfy_io.Custom(PixverseIO.TEMPLATE).Output(display_name="pixverse_template")],
)
Expand Down Expand Up @@ -120,20 +120,20 @@ def define_schema(cls) -> comfy_io.Schema:
),
comfy_io.Combo.Input(
"aspect_ratio",
options=[ratio.value for ratio in PixverseAspectRatio],
options=PixverseAspectRatio,
),
comfy_io.Combo.Input(
"quality",
options=[resolution.value for resolution in PixverseQuality],
options=PixverseQuality,
default=PixverseQuality.res_540p,
),
comfy_io.Combo.Input(
"duration_seconds",
options=[dur.value for dur in PixverseDuration],
options=PixverseDuration,
),
comfy_io.Combo.Input(
"motion_mode",
options=[mode.value for mode in PixverseMotionMode],
options=PixverseMotionMode,
),
comfy_io.Int.Input(
"seed",
Expand Down Expand Up @@ -262,16 +262,16 @@ def define_schema(cls) -> comfy_io.Schema:
),
comfy_io.Combo.Input(
"quality",
options=[resolution.value for resolution in PixverseQuality],
options=PixverseQuality,
default=PixverseQuality.res_540p,
),
comfy_io.Combo.Input(
"duration_seconds",
options=[dur.value for dur in PixverseDuration],
options=PixverseDuration,
),
comfy_io.Combo.Input(
"motion_mode",
options=[mode.value for mode in PixverseMotionMode],
options=PixverseMotionMode,
),
comfy_io.Int.Input(
"seed",
Expand Down Expand Up @@ -403,16 +403,16 @@ def define_schema(cls) -> comfy_io.Schema:
),
comfy_io.Combo.Input(
"quality",
options=[resolution.value for resolution in PixverseQuality],
options=PixverseQuality,
default=PixverseQuality.res_540p,
),
comfy_io.Combo.Input(
"duration_seconds",
options=[dur.value for dur in PixverseDuration],
options=PixverseDuration,
),
comfy_io.Combo.Input(
"motion_mode",
options=[mode.value for mode in PixverseMotionMode],
options=PixverseMotionMode,
),
comfy_io.Int.Input(
"seed",
Expand Down
12 changes: 6 additions & 6 deletions comfy_api_nodes/nodes_runway.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ def define_schema(cls):
),
comfy_io.Combo.Input(
"duration",
options=[model.value for model in Duration],
options=Duration,
),
comfy_io.Combo.Input(
"ratio",
options=[model.value for model in RunwayGen3aAspectRatio],
options=RunwayGen3aAspectRatio,
),
comfy_io.Int.Input(
"seed",
Expand Down Expand Up @@ -300,11 +300,11 @@ def define_schema(cls):
),
comfy_io.Combo.Input(
"duration",
options=[model.value for model in Duration],
options=Duration,
),
comfy_io.Combo.Input(
"ratio",
options=[model.value for model in RunwayGen4TurboAspectRatio],
options=RunwayGen4TurboAspectRatio,
),
comfy_io.Int.Input(
"seed",
Expand Down Expand Up @@ -408,11 +408,11 @@ def define_schema(cls):
),
comfy_io.Combo.Input(
"duration",
options=[model.value for model in Duration],
options=Duration,
),
comfy_io.Combo.Input(
"ratio",
options=[model.value for model in RunwayGen3aAspectRatio],
options=RunwayGen3aAspectRatio,
),
comfy_io.Int.Input(
"seed",
Expand Down
10 changes: 5 additions & 5 deletions comfy_api_nodes/nodes_stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def define_schema(cls):
),
comfy_io.Combo.Input(
"aspect_ratio",
options=[x.value for x in StabilityAspectRatio],
default=StabilityAspectRatio.ratio_1_1.value,
options=StabilityAspectRatio,
default=StabilityAspectRatio.ratio_1_1,
tooltip="Aspect ratio of generated image.",
),
comfy_io.Combo.Input(
Expand Down Expand Up @@ -217,12 +217,12 @@ def define_schema(cls):
),
comfy_io.Combo.Input(
"model",
options=[x.value for x in Stability_SD3_5_Model],
options=Stability_SD3_5_Model,
),
comfy_io.Combo.Input(
"aspect_ratio",
options=[x.value for x in StabilityAspectRatio],
default=StabilityAspectRatio.ratio_1_1.value,
options=StabilityAspectRatio,
default=StabilityAspectRatio.ratio_1_1,
tooltip="Aspect ratio of generated image.",
),
comfy_io.Combo.Input(
Expand Down
Loading