mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-16 00:16:39 +08:00
use own full io.Schema for Veo3VideoGenerationNode
This commit is contained in:
parent
b08757c2d7
commit
b74e0aa1c2
@ -318,55 +318,32 @@ class Veo3VideoGenerationNode(VeoVideoGenerationNode):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def define_schema(cls):
|
def define_schema(cls):
|
||||||
parent_input = super().define_schema()
|
return comfy_io.Schema(
|
||||||
parent_input.node_id = "Veo3VideoGenerationNode"
|
node_id="Veo3VideoGenerationNode",
|
||||||
parent_input.display_name = "Google Veo 3 Video Generation"
|
display_name="Google Veo 3 Video Generation",
|
||||||
|
category="api node/video/Veo",
|
||||||
# Update model options for Veo 3:
|
description="Generates videos from text prompts using Google's Veo 2 API",
|
||||||
# if Schema.inputs will be changed to `dict` then use the commented code:
|
inputs=[
|
||||||
# parent_input.inputs["model"] = comfy_io.Combo.Input(
|
comfy_io.String.Input(
|
||||||
# "model",
|
"prompt",
|
||||||
# options=["veo-3.0-generate-001", "veo-3.0-fast-generate-001"],
|
multiline=True,
|
||||||
# default="veo-3.0-generate-001",
|
default="",
|
||||||
# tooltip="Veo 3 model to use for video generation",
|
tooltip="Text description of the video",
|
||||||
# optional=True,
|
),
|
||||||
# )
|
comfy_io.Combo.Input(
|
||||||
for i, inp in enumerate(parent_input.inputs):
|
"aspect_ratio",
|
||||||
if inp.id == "model":
|
options=["16:9", "9:16"],
|
||||||
parent_input.inputs[i] = comfy_io.Combo.Input(
|
default="16:9",
|
||||||
"model",
|
tooltip="Aspect ratio of the output video",
|
||||||
options=["veo-3.0-generate-001", "veo-3.0-fast-generate-001"],
|
),
|
||||||
default="veo-3.0-generate-001",
|
comfy_io.String.Input(
|
||||||
tooltip="Veo 3 model to use for video generation",
|
"negative_prompt",
|
||||||
|
multiline=True,
|
||||||
|
default="",
|
||||||
|
tooltip="Negative text prompt to guide what to avoid in the video",
|
||||||
optional=True,
|
optional=True,
|
||||||
)
|
),
|
||||||
|
comfy_io.Int.Input(
|
||||||
|
|
||||||
# Add generateAudio parameter
|
|
||||||
parent_input.inputs.append(
|
|
||||||
comfy_io.Boolean.Input(
|
|
||||||
"generate_audio",
|
|
||||||
default=False,
|
|
||||||
tooltip="Generate audio for the video. Supported by all Veo 3 models.",
|
|
||||||
optional=True,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
# Update duration constraints for Veo 3 (only 8 seconds supported)
|
|
||||||
# if Schema.inputs will be changed to `dict` then use the commented code:
|
|
||||||
# parent_input.inputs["duration_seconds"] = comfy_io.Int.Input(
|
|
||||||
# "duration_seconds",
|
|
||||||
# default=8,
|
|
||||||
# min=8,
|
|
||||||
# max=8,
|
|
||||||
# step=1,
|
|
||||||
# display_mode=comfy_io.NumberDisplay.number,
|
|
||||||
# tooltip="Duration of the output video in seconds (Veo 3 only supports 8 seconds)",
|
|
||||||
# optional=True,
|
|
||||||
# )
|
|
||||||
for i, inp in enumerate(parent_input.inputs):
|
|
||||||
if inp.id == "duration_seconds":
|
|
||||||
parent_input.inputs[i] = comfy_io.Int.Input(
|
|
||||||
"duration_seconds",
|
"duration_seconds",
|
||||||
default=8,
|
default=8,
|
||||||
min=8,
|
min=8,
|
||||||
@ -375,9 +352,60 @@ class Veo3VideoGenerationNode(VeoVideoGenerationNode):
|
|||||||
display_mode=comfy_io.NumberDisplay.number,
|
display_mode=comfy_io.NumberDisplay.number,
|
||||||
tooltip="Duration of the output video in seconds (Veo 3 only supports 8 seconds)",
|
tooltip="Duration of the output video in seconds (Veo 3 only supports 8 seconds)",
|
||||||
optional=True,
|
optional=True,
|
||||||
)
|
),
|
||||||
|
comfy_io.Boolean.Input(
|
||||||
return parent_input
|
"enhance_prompt",
|
||||||
|
default=True,
|
||||||
|
tooltip="Whether to enhance the prompt with AI assistance",
|
||||||
|
optional=True,
|
||||||
|
),
|
||||||
|
comfy_io.Combo.Input(
|
||||||
|
"person_generation",
|
||||||
|
options=["ALLOW", "BLOCK"],
|
||||||
|
default="ALLOW",
|
||||||
|
tooltip="Whether to allow generating people in the video",
|
||||||
|
optional=True,
|
||||||
|
),
|
||||||
|
comfy_io.Int.Input(
|
||||||
|
"seed",
|
||||||
|
default=0,
|
||||||
|
min=0,
|
||||||
|
max=0xFFFFFFFF,
|
||||||
|
step=1,
|
||||||
|
display_mode=comfy_io.NumberDisplay.number,
|
||||||
|
control_after_generate=True,
|
||||||
|
tooltip="Seed for video generation (0 for random)",
|
||||||
|
optional=True,
|
||||||
|
),
|
||||||
|
comfy_io.Image.Input(
|
||||||
|
"image",
|
||||||
|
tooltip="Optional reference image to guide video generation",
|
||||||
|
optional=True,
|
||||||
|
),
|
||||||
|
comfy_io.Combo.Input(
|
||||||
|
"model",
|
||||||
|
options=["veo-3.0-generate-001", "veo-3.0-fast-generate-001"],
|
||||||
|
default="veo-3.0-generate-001",
|
||||||
|
tooltip="Veo 3 model to use for video generation",
|
||||||
|
optional=True,
|
||||||
|
),
|
||||||
|
comfy_io.Boolean.Input(
|
||||||
|
"generate_audio",
|
||||||
|
default=False,
|
||||||
|
tooltip="Generate audio for the video. Supported by all Veo 3 models.",
|
||||||
|
optional=True,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
outputs=[
|
||||||
|
comfy_io.Video.Output(),
|
||||||
|
],
|
||||||
|
hidden=[
|
||||||
|
comfy_io.Hidden.auth_token_comfy_org,
|
||||||
|
comfy_io.Hidden.api_key_comfy_org,
|
||||||
|
comfy_io.Hidden.unique_id,
|
||||||
|
],
|
||||||
|
is_api_node=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class VeoExtension(ComfyExtension):
|
class VeoExtension(ComfyExtension):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user