From 076639fed99742f43ffbf0b0df34bb8fd105b8e9 Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:11:02 -0700 Subject: [PATCH 01/11] Update README with note on model support (#13235) Added note about additional supported models in ComfyUI. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 021f88a31..a47506fc8 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ See what ComfyUI can do with the [newer template workflows](https://comfy.org/wo ## Features - Nodes/graph/flowchart interface to experiment and create complex Stable Diffusion workflows without needing to code anything. +- NOTE: There are many more models supported than the list below, if you want to see what is supported see our templates list inside ComfyUI. - Image Models - SD1.x, SD2.x ([unCLIP](https://comfyanonymous.github.io/ComfyUI_examples/unclip/)) - [SDXL](https://comfyanonymous.github.io/ComfyUI_examples/sdxl/), [SDXL Turbo](https://comfyanonymous.github.io/ComfyUI_examples/sdturbo/) From e2ddf28d78f190b27d136668a7dc15c7f0ec75dc Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Tue, 31 Mar 2026 14:27:17 -0700 Subject: [PATCH 02/11] Fix some fp8 scaled checkpoints no longer working. (#13239) --- comfy/sd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/comfy/sd.py b/comfy/sd.py index 7425765a4..5b6b59ea4 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -1745,6 +1745,8 @@ def load_diffusion_model_state_dict(sd, model_options={}, metadata=None, disable temp_sd = comfy.utils.state_dict_prefix_replace(sd, {diffusion_model_prefix: ""}, filter_keys=True) if len(temp_sd) > 0: sd = temp_sd + if custom_operations is None: + sd, metadata = comfy.utils.convert_old_quants(sd, "", metadata=metadata) parameters = comfy.utils.calculate_parameters(sd) weight_dtype = comfy.utils.weight_dtype(sd) From 7d437687c260df7772c603658111148e0e863e59 Mon Sep 17 00:00:00 2001 From: "Daxiong (Lin)" Date: Wed, 1 Apr 2026 11:23:25 +0800 Subject: [PATCH 03/11] chore: update workflow templates to v0.9.41 (#13242) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6f0659a00..0d88fdcfb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ comfyui-frontend-package==1.42.8 -comfyui-workflow-templates==0.9.39 +comfyui-workflow-templates==0.9.41 comfyui-embedded-docs==0.4.3 torch torchsde From 0c63b4f6e3ce807a0f85c1826710bcf18ade3e2c Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Wed, 1 Apr 2026 17:22:06 -0700 Subject: [PATCH 04/11] Remove dead code. (#13251) --- comfy/ldm/modules/encoders/noise_aug_modules.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/comfy/ldm/modules/encoders/noise_aug_modules.py b/comfy/ldm/modules/encoders/noise_aug_modules.py index a5d866030..c853e4298 100644 --- a/comfy/ldm/modules/encoders/noise_aug_modules.py +++ b/comfy/ldm/modules/encoders/noise_aug_modules.py @@ -3,12 +3,9 @@ from ..diffusionmodules.openaimodel import Timestep import torch class CLIPEmbeddingNoiseAugmentation(ImageConcatWithNoiseAugmentation): - def __init__(self, *args, clip_stats_path=None, timestep_dim=256, **kwargs): + def __init__(self, *args, timestep_dim=256, **kwargs): super().__init__(*args, **kwargs) - if clip_stats_path is None: - clip_mean, clip_std = torch.zeros(timestep_dim), torch.ones(timestep_dim) - else: - clip_mean, clip_std = torch.load(clip_stats_path, map_location="cpu") + clip_mean, clip_std = torch.zeros(timestep_dim), torch.ones(timestep_dim) self.register_buffer("data_mean", clip_mean[None, :], persistent=False) self.register_buffer("data_std", clip_std[None, :], persistent=False) self.time_embed = Timestep(timestep_dim) From 76b75f3ad755ef5ff78b3670abbab549fb080243 Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Thu, 2 Apr 2026 13:39:34 -0700 Subject: [PATCH 05/11] Fix some issue with insecure browsers. (#13261) If you are on a recent chromium or chrome based browser this doesn't affect you. This is to give time for the lazy firefox devs to implement PNA. --- server.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server.py b/server.py index 27b14825e..881da8e66 100644 --- a/server.py +++ b/server.py @@ -146,6 +146,10 @@ def is_loopback(host): def create_origin_only_middleware(): @web.middleware async def origin_only_middleware(request: web.Request, handler): + if 'Sec-Fetch-Site' in request.headers: + sec_fetch_site = request.headers['Sec-Fetch-Site'] + if sec_fetch_site == 'cross-site': + return web.Response(status=403) #this code is used to prevent the case where a random website can queue comfy workflows by making a POST to 127.0.0.1 which browsers don't prevent for some dumb reason. #in that case the Host and Origin hostnames won't match #I know the proper fix would be to add a cookie but this should take care of the problem in the meantime From 5de94e70ec116a93cbd110fbfaec266ae1f423c5 Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:51:47 +0300 Subject: [PATCH 06/11] feat(api-nodes): new Partner nodes for Wan2.7 (#13264) Signed-off-by: bigcat88 --- comfy_api_nodes/apis/wan.py | 226 ++++++++ comfy_api_nodes/nodes_wan.py | 1011 +++++++++++++++++++++++++++++----- 2 files changed, 1089 insertions(+), 148 deletions(-) create mode 100644 comfy_api_nodes/apis/wan.py diff --git a/comfy_api_nodes/apis/wan.py b/comfy_api_nodes/apis/wan.py new file mode 100644 index 000000000..44b65e4f6 --- /dev/null +++ b/comfy_api_nodes/apis/wan.py @@ -0,0 +1,226 @@ +from pydantic import BaseModel, Field + + +class Text2ImageInputField(BaseModel): + prompt: str = Field(...) + negative_prompt: str | None = Field(None) + + +class Image2ImageInputField(BaseModel): + prompt: str = Field(...) + negative_prompt: str | None = Field(None) + images: list[str] = Field(..., min_length=1, max_length=2) + + +class Text2VideoInputField(BaseModel): + prompt: str = Field(...) + negative_prompt: str | None = Field(None) + audio_url: str | None = Field(None) + + +class Image2VideoInputField(BaseModel): + prompt: str = Field(...) + negative_prompt: str | None = Field(None) + img_url: str = Field(...) + audio_url: str | None = Field(None) + + +class Reference2VideoInputField(BaseModel): + prompt: str = Field(...) + negative_prompt: str | None = Field(None) + reference_video_urls: list[str] = Field(...) + + +class Txt2ImageParametersField(BaseModel): + size: str = Field(...) + n: int = Field(1, description="Number of images to generate.") # we support only value=1 + seed: int = Field(..., ge=0, le=2147483647) + prompt_extend: bool = Field(True) + watermark: bool = Field(False) + + +class Image2ImageParametersField(BaseModel): + size: str | None = Field(None) + n: int = Field(1, description="Number of images to generate.") # we support only value=1 + seed: int = Field(..., ge=0, le=2147483647) + watermark: bool = Field(False) + + +class Text2VideoParametersField(BaseModel): + size: str = Field(...) + seed: int = Field(..., ge=0, le=2147483647) + duration: int = Field(5, ge=5, le=15) + prompt_extend: bool = Field(True) + watermark: bool = Field(False) + audio: bool = Field(False, description="Whether to generate audio automatically.") + shot_type: str = Field("single") + + +class Image2VideoParametersField(BaseModel): + resolution: str = Field(...) + seed: int = Field(..., ge=0, le=2147483647) + duration: int = Field(5, ge=5, le=15) + prompt_extend: bool = Field(True) + watermark: bool = Field(False) + audio: bool = Field(False, description="Whether to generate audio automatically.") + shot_type: str = Field("single") + + +class Reference2VideoParametersField(BaseModel): + size: str = Field(...) + duration: int = Field(5, ge=5, le=15) + shot_type: str = Field("single") + seed: int = Field(..., ge=0, le=2147483647) + watermark: bool = Field(False) + + +class Text2ImageTaskCreationRequest(BaseModel): + model: str = Field(...) + input: Text2ImageInputField = Field(...) + parameters: Txt2ImageParametersField = Field(...) + + +class Image2ImageTaskCreationRequest(BaseModel): + model: str = Field(...) + input: Image2ImageInputField = Field(...) + parameters: Image2ImageParametersField = Field(...) + + +class Text2VideoTaskCreationRequest(BaseModel): + model: str = Field(...) + input: Text2VideoInputField = Field(...) + parameters: Text2VideoParametersField = Field(...) + + +class Image2VideoTaskCreationRequest(BaseModel): + model: str = Field(...) + input: Image2VideoInputField = Field(...) + parameters: Image2VideoParametersField = Field(...) + + +class Reference2VideoTaskCreationRequest(BaseModel): + model: str = Field(...) + input: Reference2VideoInputField = Field(...) + parameters: Reference2VideoParametersField = Field(...) + + +class Wan27MediaItem(BaseModel): + type: str = Field(...) + url: str = Field(...) + + +class Wan27ReferenceVideoInputField(BaseModel): + prompt: str = Field(...) + negative_prompt: str | None = Field(None) + media: list[Wan27MediaItem] = Field(...) + + +class Wan27ReferenceVideoParametersField(BaseModel): + resolution: str = Field(...) + ratio: str | None = Field(None) + duration: int = Field(5, ge=2, le=10) + watermark: bool = Field(False) + seed: int = Field(..., ge=0, le=2147483647) + + +class Wan27ReferenceVideoTaskCreationRequest(BaseModel): + model: str = Field(...) + input: Wan27ReferenceVideoInputField = Field(...) + parameters: Wan27ReferenceVideoParametersField = Field(...) + + +class Wan27ImageToVideoInputField(BaseModel): + prompt: str | None = Field(None) + negative_prompt: str | None = Field(None) + media: list[Wan27MediaItem] = Field(...) + + +class Wan27ImageToVideoParametersField(BaseModel): + resolution: str = Field(...) + duration: int = Field(5, ge=2, le=15) + prompt_extend: bool = Field(True) + watermark: bool = Field(False) + seed: int = Field(..., ge=0, le=2147483647) + + +class Wan27ImageToVideoTaskCreationRequest(BaseModel): + model: str = Field(...) + input: Wan27ImageToVideoInputField = Field(...) + parameters: Wan27ImageToVideoParametersField = Field(...) + + +class Wan27VideoEditInputField(BaseModel): + prompt: str = Field(...) + media: list[Wan27MediaItem] = Field(...) + + +class Wan27VideoEditParametersField(BaseModel): + resolution: str = Field(...) + ratio: str | None = Field(None) + duration: int = Field(0) + audio_setting: str = Field("auto") + watermark: bool = Field(False) + seed: int = Field(..., ge=0, le=2147483647) + + +class Wan27VideoEditTaskCreationRequest(BaseModel): + model: str = Field(...) + input: Wan27VideoEditInputField = Field(...) + parameters: Wan27VideoEditParametersField = Field(...) + + +class Wan27Text2VideoParametersField(BaseModel): + resolution: str = Field(...) + ratio: str | None = Field(None) + duration: int = Field(5, ge=2, le=15) + prompt_extend: bool = Field(True) + watermark: bool = Field(False) + seed: int = Field(..., ge=0, le=2147483647) + + +class Wan27Text2VideoTaskCreationRequest(BaseModel): + model: str = Field(...) + input: Text2VideoInputField = Field(...) + parameters: Wan27Text2VideoParametersField = Field(...) + + +class TaskCreationOutputField(BaseModel): + task_id: str = Field(...) + task_status: str = Field(...) + + +class TaskCreationResponse(BaseModel): + output: TaskCreationOutputField | None = Field(None) + request_id: str = Field(...) + code: str | None = Field(None, description="Error code for the failed request.") + message: str | None = Field(None, description="Details about the failed request.") + + +class TaskResult(BaseModel): + url: str | None = Field(None) + code: str | None = Field(None) + message: str | None = Field(None) + + +class ImageTaskStatusOutputField(TaskCreationOutputField): + task_id: str = Field(...) + task_status: str = Field(...) + results: list[TaskResult] | None = Field(None) + + +class VideoTaskStatusOutputField(TaskCreationOutputField): + task_id: str = Field(...) + task_status: str = Field(...) + video_url: str | None = Field(None) + code: str | None = Field(None) + message: str | None = Field(None) + + +class ImageTaskStatusResponse(BaseModel): + output: ImageTaskStatusOutputField | None = Field(None) + request_id: str = Field(...) + + +class VideoTaskStatusResponse(BaseModel): + output: VideoTaskStatusOutputField | None = Field(None) + request_id: str = Field(...) diff --git a/comfy_api_nodes/nodes_wan.py b/comfy_api_nodes/nodes_wan.py index e2afe7f9c..d1470894a 100644 --- a/comfy_api_nodes/nodes_wan.py +++ b/comfy_api_nodes/nodes_wan.py @@ -1,9 +1,40 @@ import re -from pydantic import BaseModel, Field from typing_extensions import override from comfy_api.latest import IO, ComfyExtension, Input +from comfy_api_nodes.apis.wan import ( + Image2ImageInputField, + Image2ImageParametersField, + Image2ImageTaskCreationRequest, + Image2VideoInputField, + Image2VideoParametersField, + Image2VideoTaskCreationRequest, + ImageTaskStatusResponse, + Reference2VideoInputField, + Reference2VideoParametersField, + Reference2VideoTaskCreationRequest, + TaskCreationResponse, + Text2ImageInputField, + Text2ImageTaskCreationRequest, + Text2VideoInputField, + Text2VideoParametersField, + Text2VideoTaskCreationRequest, + Txt2ImageParametersField, + VideoTaskStatusResponse, + Wan27ImageToVideoInputField, + Wan27ImageToVideoParametersField, + Wan27ImageToVideoTaskCreationRequest, + Wan27MediaItem, + Wan27ReferenceVideoInputField, + Wan27ReferenceVideoParametersField, + Wan27ReferenceVideoTaskCreationRequest, + Wan27Text2VideoParametersField, + Wan27Text2VideoTaskCreationRequest, + Wan27VideoEditInputField, + Wan27VideoEditParametersField, + Wan27VideoEditTaskCreationRequest, +) from comfy_api_nodes.util import ( ApiEndpoint, audio_to_base64_string, @@ -13,157 +44,14 @@ from comfy_api_nodes.util import ( poll_op, sync_op, tensor_to_base64_string, + upload_audio_to_comfyapi, + upload_image_to_comfyapi, upload_video_to_comfyapi, validate_audio_duration, + validate_string, validate_video_duration, ) - -class Text2ImageInputField(BaseModel): - prompt: str = Field(...) - negative_prompt: str | None = Field(None) - - -class Image2ImageInputField(BaseModel): - prompt: str = Field(...) - negative_prompt: str | None = Field(None) - images: list[str] = Field(..., min_length=1, max_length=2) - - -class Text2VideoInputField(BaseModel): - prompt: str = Field(...) - negative_prompt: str | None = Field(None) - audio_url: str | None = Field(None) - - -class Image2VideoInputField(BaseModel): - prompt: str = Field(...) - negative_prompt: str | None = Field(None) - img_url: str = Field(...) - audio_url: str | None = Field(None) - - -class Reference2VideoInputField(BaseModel): - prompt: str = Field(...) - negative_prompt: str | None = Field(None) - reference_video_urls: list[str] = Field(...) - - -class Txt2ImageParametersField(BaseModel): - size: str = Field(...) - n: int = Field(1, description="Number of images to generate.") # we support only value=1 - seed: int = Field(..., ge=0, le=2147483647) - prompt_extend: bool = Field(True) - watermark: bool = Field(False) - - -class Image2ImageParametersField(BaseModel): - size: str | None = Field(None) - n: int = Field(1, description="Number of images to generate.") # we support only value=1 - seed: int = Field(..., ge=0, le=2147483647) - watermark: bool = Field(False) - - -class Text2VideoParametersField(BaseModel): - size: str = Field(...) - seed: int = Field(..., ge=0, le=2147483647) - duration: int = Field(5, ge=5, le=15) - prompt_extend: bool = Field(True) - watermark: bool = Field(False) - audio: bool = Field(False, description="Whether to generate audio automatically.") - shot_type: str = Field("single") - - -class Image2VideoParametersField(BaseModel): - resolution: str = Field(...) - seed: int = Field(..., ge=0, le=2147483647) - duration: int = Field(5, ge=5, le=15) - prompt_extend: bool = Field(True) - watermark: bool = Field(False) - audio: bool = Field(False, description="Whether to generate audio automatically.") - shot_type: str = Field("single") - - -class Reference2VideoParametersField(BaseModel): - size: str = Field(...) - duration: int = Field(5, ge=5, le=15) - shot_type: str = Field("single") - seed: int = Field(..., ge=0, le=2147483647) - watermark: bool = Field(False) - - -class Text2ImageTaskCreationRequest(BaseModel): - model: str = Field(...) - input: Text2ImageInputField = Field(...) - parameters: Txt2ImageParametersField = Field(...) - - -class Image2ImageTaskCreationRequest(BaseModel): - model: str = Field(...) - input: Image2ImageInputField = Field(...) - parameters: Image2ImageParametersField = Field(...) - - -class Text2VideoTaskCreationRequest(BaseModel): - model: str = Field(...) - input: Text2VideoInputField = Field(...) - parameters: Text2VideoParametersField = Field(...) - - -class Image2VideoTaskCreationRequest(BaseModel): - model: str = Field(...) - input: Image2VideoInputField = Field(...) - parameters: Image2VideoParametersField = Field(...) - - -class Reference2VideoTaskCreationRequest(BaseModel): - model: str = Field(...) - input: Reference2VideoInputField = Field(...) - parameters: Reference2VideoParametersField = Field(...) - - -class TaskCreationOutputField(BaseModel): - task_id: str = Field(...) - task_status: str = Field(...) - - -class TaskCreationResponse(BaseModel): - output: TaskCreationOutputField | None = Field(None) - request_id: str = Field(...) - code: str | None = Field(None, description="Error code for the failed request.") - message: str | None = Field(None, description="Details about the failed request.") - - -class TaskResult(BaseModel): - url: str | None = Field(None) - code: str | None = Field(None) - message: str | None = Field(None) - - -class ImageTaskStatusOutputField(TaskCreationOutputField): - task_id: str = Field(...) - task_status: str = Field(...) - results: list[TaskResult] | None = Field(None) - - -class VideoTaskStatusOutputField(TaskCreationOutputField): - task_id: str = Field(...) - task_status: str = Field(...) - video_url: str | None = Field(None) - code: str | None = Field(None) - message: str | None = Field(None) - - -class ImageTaskStatusResponse(BaseModel): - output: ImageTaskStatusOutputField | None = Field(None) - request_id: str = Field(...) - - -class VideoTaskStatusResponse(BaseModel): - output: VideoTaskStatusOutputField | None = Field(None) - request_id: str = Field(...) - - RES_IN_PARENS = re.compile(r"\((\d+)\s*[x×]\s*(\d+)\)") @@ -179,7 +67,6 @@ class WanTextToImageApi(IO.ComfyNode): IO.Combo.Input( "model", options=["wan2.5-t2i-preview"], - default="wan2.5-t2i-preview", tooltip="Model to use.", ), IO.String.Input( @@ -936,6 +823,829 @@ class WanReferenceVideoApi(IO.ComfyNode): return IO.NodeOutput(await download_url_to_video_output(response.output.video_url)) +class Wan2TextToVideoApi(IO.ComfyNode): + @classmethod + def define_schema(cls): + return IO.Schema( + node_id="Wan2TextToVideoApi", + display_name="Wan 2.7 Text to Video", + category="api node/video/Wan", + description="Generates a video based on a text prompt using the Wan 2.7 model.", + inputs=[ + IO.DynamicCombo.Input( + "model", + options=[ + IO.DynamicCombo.Option( + "wan2.7-t2v", + [ + IO.String.Input( + "prompt", + multiline=True, + default="", + tooltip="Prompt describing the elements and visual features. " + "Supports English and Chinese.", + ), + IO.String.Input( + "negative_prompt", + multiline=True, + default="", + tooltip="Negative prompt describing what to avoid.", + ), + IO.Combo.Input( + "resolution", + options=["720P", "1080P"], + ), + IO.Combo.Input( + "ratio", + options=["16:9", "9:16", "1:1", "4:3", "3:4"], + ), + IO.Int.Input( + "duration", + default=5, + min=2, + max=15, + step=1, + display_mode=IO.NumberDisplay.number, + ), + ], + ), + ], + ), + IO.Audio.Input( + "audio", + optional=True, + tooltip="Audio for driving video generation (e.g., lip sync, beat-matched motion). " + "Duration: 3s-30s. If not provided, the model automatically generates matching " + "background music or sound effects.", + ), + IO.Int.Input( + "seed", + default=0, + min=0, + max=2147483647, + step=1, + display_mode=IO.NumberDisplay.number, + control_after_generate=True, + tooltip="Seed to use for generation.", + ), + IO.Boolean.Input( + "prompt_extend", + default=True, + tooltip="Whether to enhance the prompt with AI assistance.", + advanced=True, + ), + IO.Boolean.Input( + "watermark", + default=False, + tooltip="Whether to add an AI-generated watermark to the result.", + advanced=True, + ), + ], + outputs=[ + IO.Video.Output(), + ], + hidden=[ + IO.Hidden.auth_token_comfy_org, + IO.Hidden.api_key_comfy_org, + IO.Hidden.unique_id, + ], + is_api_node=True, + price_badge=IO.PriceBadge( + depends_on=IO.PriceBadgeDepends(widgets=["model", "model.resolution", "model.duration"]), + expr=""" + ( + $res := $lookup(widgets, "model.resolution"); + $dur := $lookup(widgets, "model.duration"); + $ppsTable := { "720p": 0.1, "1080p": 0.15 }; + $pps := $lookup($ppsTable, $res); + { "type": "usd", "usd": $pps * $dur } + ) + """, + ), + ) + + @classmethod + async def execute( + cls, + model: dict, + seed: int, + prompt_extend: bool, + watermark: bool, + audio: Input.Audio | None = None, + ): + validate_string(model["prompt"], strip_whitespace=False, min_length=1) + audio_url = None + if audio is not None: + validate_audio_duration(audio, 1.5, 60.0) + audio_url = await upload_audio_to_comfyapi( + cls, audio, container_format="mp3", codec_name="libmp3lame", mime_type="audio/mpeg" + ) + initial_response = await sync_op( + cls, + ApiEndpoint( + path="/proxy/wan/api/v1/services/aigc/video-generation/video-synthesis", + method="POST", + ), + response_model=TaskCreationResponse, + data=Wan27Text2VideoTaskCreationRequest( + model=model["model"], + input=Text2VideoInputField( + prompt=model["prompt"], + negative_prompt=model["negative_prompt"] or None, + audio_url=audio_url, + ), + parameters=Wan27Text2VideoParametersField( + resolution=model["resolution"], + ratio=model["ratio"], + duration=model["duration"], + seed=seed, + prompt_extend=prompt_extend, + watermark=watermark, + ), + ), + ) + if not initial_response.output: + raise Exception(f"An unknown error occurred: {initial_response.code} - {initial_response.message}") + response = await poll_op( + cls, + ApiEndpoint(path=f"/proxy/wan/api/v1/tasks/{initial_response.output.task_id}"), + response_model=VideoTaskStatusResponse, + status_extractor=lambda x: x.output.task_status, + poll_interval=7, + ) + return IO.NodeOutput(await download_url_to_video_output(response.output.video_url)) + + +class Wan2ImageToVideoApi(IO.ComfyNode): + @classmethod + def define_schema(cls): + return IO.Schema( + node_id="Wan2ImageToVideoApi", + display_name="Wan 2.7 Image to Video", + category="api node/video/Wan", + description="Generate a video from a first-frame image, with optional last-frame image and audio.", + inputs=[ + IO.DynamicCombo.Input( + "model", + options=[ + IO.DynamicCombo.Option( + "wan2.7-i2v", + [ + IO.String.Input( + "prompt", + multiline=True, + default="", + tooltip="Prompt describing the elements and visual features. " + "Supports English and Chinese.", + ), + IO.String.Input( + "negative_prompt", + multiline=True, + default="", + tooltip="Negative prompt describing what to avoid.", + ), + IO.Combo.Input( + "resolution", + options=["720P", "1080P"], + ), + IO.Int.Input( + "duration", + default=5, + min=2, + max=15, + step=1, + display_mode=IO.NumberDisplay.number, + ), + ], + ), + ], + ), + IO.Image.Input( + "first_frame", + tooltip="First frame image. The output aspect ratio is derived from this image.", + ), + IO.Image.Input( + "last_frame", + optional=True, + tooltip="Last frame image. The model generates a video transitioning from first to last frame.", + ), + IO.Audio.Input( + "audio", + optional=True, + tooltip="Audio for driving video generation (e.g., lip sync, beat-matched motion). " + "Duration: 2s-30s. If not provided, the model automatically generates matching " + "background music or sound effects.", + ), + IO.Int.Input( + "seed", + default=0, + min=0, + max=2147483647, + step=1, + display_mode=IO.NumberDisplay.number, + control_after_generate=True, + tooltip="Seed to use for generation.", + ), + IO.Boolean.Input( + "prompt_extend", + default=True, + tooltip="Whether to enhance the prompt with AI assistance.", + advanced=True, + ), + IO.Boolean.Input( + "watermark", + default=False, + tooltip="Whether to add an AI-generated watermark to the result.", + advanced=True, + ), + ], + outputs=[ + IO.Video.Output(), + ], + hidden=[ + IO.Hidden.auth_token_comfy_org, + IO.Hidden.api_key_comfy_org, + IO.Hidden.unique_id, + ], + is_api_node=True, + price_badge=IO.PriceBadge( + depends_on=IO.PriceBadgeDepends(widgets=["model", "model.resolution", "model.duration"]), + expr=""" + ( + $res := $lookup(widgets, "model.resolution"); + $dur := $lookup(widgets, "model.duration"); + $ppsTable := { "720p": 0.1, "1080p": 0.15 }; + $pps := $lookup($ppsTable, $res); + { "type": "usd", "usd": $pps * $dur } + ) + """, + ), + ) + + @classmethod + async def execute( + cls, + model: dict, + first_frame: Input.Image, + seed: int, + prompt_extend: bool, + watermark: bool, + last_frame: Input.Image | None = None, + audio: Input.Audio | None = None, + ): + media = [ + Wan27MediaItem( + type="first_frame", + url=await upload_image_to_comfyapi(cls, image=first_frame), + ) + ] + if last_frame is not None: + media.append( + Wan27MediaItem( + type="last_frame", + url=await upload_image_to_comfyapi(cls, image=last_frame), + ) + ) + if audio is not None: + validate_audio_duration(audio, 2.0, 30.0) + audio_url = await upload_audio_to_comfyapi( + cls, audio, container_format="mp3", codec_name="libmp3lame", mime_type="audio/mpeg" + ) + media.append(Wan27MediaItem(type="driving_audio", url=audio_url)) + initial_response = await sync_op( + cls, + ApiEndpoint( + path="/proxy/wan/api/v1/services/aigc/video-generation/video-synthesis", + method="POST", + ), + response_model=TaskCreationResponse, + data=Wan27ImageToVideoTaskCreationRequest( + model=model["model"], + input=Wan27ImageToVideoInputField( + prompt=model["prompt"] or None, + negative_prompt=model["negative_prompt"] or None, + media=media, + ), + parameters=Wan27ImageToVideoParametersField( + resolution=model["resolution"], + duration=model["duration"], + seed=seed, + prompt_extend=prompt_extend, + watermark=watermark, + ), + ), + ) + if not initial_response.output: + raise Exception(f"An unknown error occurred: {initial_response.code} - {initial_response.message}") + response = await poll_op( + cls, + ApiEndpoint(path=f"/proxy/wan/api/v1/tasks/{initial_response.output.task_id}"), + response_model=VideoTaskStatusResponse, + status_extractor=lambda x: x.output.task_status, + poll_interval=7, + ) + return IO.NodeOutput(await download_url_to_video_output(response.output.video_url)) + + +class Wan2VideoContinuationApi(IO.ComfyNode): + @classmethod + def define_schema(cls): + return IO.Schema( + node_id="Wan2VideoContinuationApi", + display_name="Wan 2.7 Video Continuation", + category="api node/video/Wan", + description="Continue a video from where it left off, with optional last-frame control.", + inputs=[ + IO.DynamicCombo.Input( + "model", + options=[ + IO.DynamicCombo.Option( + "wan2.7-i2v", + [ + IO.String.Input( + "prompt", + multiline=True, + default="", + tooltip="Prompt describing the elements and visual features. Supports English and Chinese.", + ), + IO.String.Input( + "negative_prompt", + multiline=True, + default="", + tooltip="Negative prompt describing what to avoid.", + ), + IO.Combo.Input( + "resolution", + options=["720P", "1080P"], + ), + IO.Int.Input( + "duration", + default=5, + min=2, + max=15, + step=1, + display_mode=IO.NumberDisplay.number, + tooltip="Total output duration in seconds. The model generates continuation " + "to fill the remaining time after the input clip.", + ), + ], + ), + ], + ), + IO.Video.Input( + "first_clip", + tooltip="Input video to continue from. Duration: 2s-10s. " + "The output aspect ratio is derived from this video.", + ), + IO.Image.Input( + "last_frame", + optional=True, + tooltip="Last frame image. The continuation will transition towards this frame.", + ), + IO.Int.Input( + "seed", + default=0, + min=0, + max=2147483647, + step=1, + display_mode=IO.NumberDisplay.number, + control_after_generate=True, + tooltip="Seed to use for generation.", + ), + IO.Boolean.Input( + "prompt_extend", + default=True, + tooltip="Whether to enhance the prompt with AI assistance.", + advanced=True, + ), + IO.Boolean.Input( + "watermark", + default=False, + tooltip="Whether to add an AI-generated watermark to the result.", + advanced=True, + ), + ], + outputs=[ + IO.Video.Output(), + ], + hidden=[ + IO.Hidden.auth_token_comfy_org, + IO.Hidden.api_key_comfy_org, + IO.Hidden.unique_id, + ], + is_api_node=True, + price_badge=IO.PriceBadge( + depends_on=IO.PriceBadgeDepends(widgets=["model", "model.resolution", "model.duration"]), + expr=""" + ( + $res := $lookup(widgets, "model.resolution"); + $dur := $lookup(widgets, "model.duration"); + $ppsTable := { "720p": 0.1, "1080p": 0.15 }; + $pps := $lookup($ppsTable, $res); + $outputPrice := $pps * $dur; + { + "type": "range_usd", + "min_usd": 2 * $pps + $outputPrice, + "max_usd": 5 * $pps + $outputPrice + } + ) + """, + ), + ) + + @classmethod + async def execute( + cls, + model: dict, + first_clip: Input.Video, + prompt: str = "", + negative_prompt: str = "", + last_frame: Input.Image | None = None, + seed: int = 0, + prompt_extend: bool = True, + watermark: bool = False, + ): + validate_video_duration(first_clip, min_duration=2, max_duration=10) + media = [ + Wan27MediaItem( + type="first_clip", + url=await upload_video_to_comfyapi(cls, first_clip), + ) + ] + if last_frame is not None: + media.append( + Wan27MediaItem( + type="last_frame", + url=await upload_image_to_comfyapi(cls, image=last_frame), + ) + ) + initial_response = await sync_op( + cls, + ApiEndpoint( + path="/proxy/wan/api/v1/services/aigc/video-generation/video-synthesis", + method="POST", + ), + response_model=TaskCreationResponse, + data=Wan27ImageToVideoTaskCreationRequest( + model=model["model"], + input=Wan27ImageToVideoInputField( + prompt=model["prompt"] or None, + negative_prompt=model["negative_prompt"] or None, + media=media, + ), + parameters=Wan27ImageToVideoParametersField( + resolution=model["resolution"], + duration=model["duration"], + seed=seed, + prompt_extend=prompt_extend, + watermark=watermark, + ), + ), + ) + if not initial_response.output: + raise Exception(f"An unknown error occurred: {initial_response.code} - {initial_response.message}") + response = await poll_op( + cls, + ApiEndpoint(path=f"/proxy/wan/api/v1/tasks/{initial_response.output.task_id}"), + response_model=VideoTaskStatusResponse, + status_extractor=lambda x: x.output.task_status, + poll_interval=7, + ) + return IO.NodeOutput(await download_url_to_video_output(response.output.video_url)) + + +class Wan2VideoEditApi(IO.ComfyNode): + @classmethod + def define_schema(cls): + return IO.Schema( + node_id="Wan2VideoEditApi", + display_name="Wan 2.7 Video Edit", + category="api node/video/Wan", + description="Edit a video using text instructions, reference images, or style transfer.", + inputs=[ + IO.DynamicCombo.Input( + "model", + options=[ + IO.DynamicCombo.Option( + "wan2.7-videoedit", + [ + IO.String.Input( + "prompt", + multiline=True, + default="", + tooltip="Editing instructions or style transfer requirements.", + ), + IO.Combo.Input( + "resolution", + options=["720P", "1080P"], + ), + IO.Combo.Input( + "ratio", + options=["16:9", "9:16", "1:1", "4:3", "3:4"], + tooltip="Aspect ratio. If not changed, approximates the input video ratio.", + ), + IO.Combo.Input( + "duration", + options=["auto", "2", "3", "4", "5", "6", "7", "8", "9", "10"], + default="auto", + tooltip="Output duration in seconds. 'auto' matches the input video duration. " + "A specific value truncates from the start of the video.", + ), + IO.Autogrow.Input( + "reference_images", + template=IO.Autogrow.TemplateNames( + IO.Image.Input("reference_image"), + names=[ + "image1", + "image2", + "image3", + "image4", + ], + min=0, + ), + ), + ], + ), + ], + ), + IO.Video.Input( + "video", + tooltip="The video to edit.", + ), + IO.Int.Input( + "seed", + default=0, + min=0, + max=2147483647, + step=1, + display_mode=IO.NumberDisplay.number, + control_after_generate=True, + tooltip="Seed to use for generation.", + ), + IO.Combo.Input( + "audio_setting", + options=["auto", "origin"], + default="auto", + tooltip="'auto': model decides whether to regenerate audio based on the prompt. " + "'origin': preserve the original audio from the input video.", + advanced=True, + ), + IO.Boolean.Input( + "watermark", + default=False, + tooltip="Whether to add an AI-generated watermark to the result.", + advanced=True, + ), + ], + outputs=[ + IO.Video.Output(), + ], + hidden=[ + IO.Hidden.auth_token_comfy_org, + IO.Hidden.api_key_comfy_org, + IO.Hidden.unique_id, + ], + is_api_node=True, + price_badge=IO.PriceBadge( + depends_on=IO.PriceBadgeDepends(widgets=["model", "model.resolution", "model.duration"]), + expr=""" + ( + $res := $lookup(widgets, "model.resolution"); + $dur := $lookup(widgets, "model.duration"); + $ppsTable := { "720p": 0.1, "1080p": 0.15 }; + $pps := $lookup($ppsTable, $res); + { "type": "usd", "usd": $pps, "format": { "suffix": "/second", "note": "(input + output)" } } + ) + """, + ), + ) + + @classmethod + async def execute( + cls, + model: dict, + video: Input.Video, + seed: int, + audio_setting: str, + watermark: bool, + ): + validate_string(model["prompt"], strip_whitespace=False, min_length=1) + validate_video_duration(video, min_duration=2, max_duration=10) + duration = 0 if model["duration"] == "auto" else int(model["duration"]) + media = [Wan27MediaItem(type="video", url=await upload_video_to_comfyapi(cls, video))] + reference_images = model.get("reference_images", {}) + for key in reference_images: + media.append( + Wan27MediaItem( + type="reference_image", url=await upload_image_to_comfyapi(cls, image=reference_images[key]) + ) + ) + initial_response = await sync_op( + cls, + ApiEndpoint( + path="/proxy/wan/api/v1/services/aigc/video-generation/video-synthesis", + method="POST", + ), + response_model=TaskCreationResponse, + data=Wan27VideoEditTaskCreationRequest( + model=model["model"], + input=Wan27VideoEditInputField(prompt=model["prompt"], media=media), + parameters=Wan27VideoEditParametersField( + resolution=model["resolution"], + ratio=model["ratio"], + duration=duration, + audio_setting=audio_setting, + watermark=watermark, + seed=seed, + ), + ), + ) + if not initial_response.output: + raise Exception(f"An unknown error occurred: {initial_response.code} - {initial_response.message}") + response = await poll_op( + cls, + ApiEndpoint(path=f"/proxy/wan/api/v1/tasks/{initial_response.output.task_id}"), + response_model=VideoTaskStatusResponse, + status_extractor=lambda x: x.output.task_status, + poll_interval=7, + ) + return IO.NodeOutput(await download_url_to_video_output(response.output.video_url)) + + +class Wan2ReferenceVideoApi(IO.ComfyNode): + @classmethod + def define_schema(cls): + return IO.Schema( + node_id="Wan2ReferenceVideoApi", + display_name="Wan 2.7 Reference to Video", + category="api node/video/Wan", + description="Generate a video featuring a person or object from reference materials. " + "Supports single-character performances and multi-character interactions.", + inputs=[ + IO.DynamicCombo.Input( + "model", + options=[ + IO.DynamicCombo.Option( + "wan2.7-r2v", + [ + IO.String.Input( + "prompt", + multiline=True, + default="", + tooltip="Prompt describing the video. Use identifiers such as 'character1' and " + "'character2' to refer to the reference characters.", + ), + IO.String.Input( + "negative_prompt", + multiline=True, + default="", + tooltip="Negative prompt describing what to avoid.", + ), + IO.Combo.Input( + "resolution", + options=["720P", "1080P"], + ), + IO.Combo.Input( + "ratio", + options=["16:9", "9:16", "1:1", "4:3", "3:4"], + ), + IO.Int.Input( + "duration", + default=5, + min=2, + max=10, + step=1, + display_mode=IO.NumberDisplay.number, + ), + IO.Autogrow.Input( + "reference_videos", + template=IO.Autogrow.TemplateNames( + IO.Video.Input("reference_video"), + names=["video1", "video2", "video3"], + min=0, + ), + ), + IO.Autogrow.Input( + "reference_images", + template=IO.Autogrow.TemplateNames( + IO.Image.Input("reference_image"), + names=["image1", "image2", "image3", "image4", "image5"], + min=0, + ), + ), + ], + ), + ], + ), + IO.Int.Input( + "seed", + default=0, + min=0, + max=2147483647, + step=1, + display_mode=IO.NumberDisplay.number, + control_after_generate=True, + tooltip="Seed to use for generation.", + ), + IO.Boolean.Input( + "watermark", + default=False, + tooltip="Whether to add an AI-generated watermark to the result.", + advanced=True, + ), + ], + outputs=[ + IO.Video.Output(), + ], + hidden=[ + IO.Hidden.auth_token_comfy_org, + IO.Hidden.api_key_comfy_org, + IO.Hidden.unique_id, + ], + is_api_node=True, + price_badge=IO.PriceBadge( + depends_on=IO.PriceBadgeDepends(widgets=["model", "model.resolution", "model.duration"]), + expr=""" + ( + $res := $lookup(widgets, "model.resolution"); + $dur := $lookup(widgets, "model.duration"); + $ppsTable := { "720p": 0.1, "1080p": 0.15 }; + $pps := $lookup($ppsTable, $res); + $outputPrice := $pps * $dur; + { + "type": "range_usd", + "min_usd": $outputPrice, + "max_usd": 5 * $pps + $outputPrice + } + ) + """, + ), + ) + + @classmethod + async def execute( + cls, + model: dict, + seed: int, + watermark: bool, + ): + validate_string(model["prompt"], strip_whitespace=False, min_length=1) + media = [] + reference_videos = model.get("reference_videos", {}) + for key in reference_videos: + media.append( + Wan27MediaItem(type="reference_video", url=await upload_video_to_comfyapi(cls, reference_videos[key])) + ) + reference_images = model.get("reference_images", {}) + for key in reference_images: + media.append( + Wan27MediaItem( + type="reference_image", + url=await upload_image_to_comfyapi(cls, image=reference_images[key]), + ) + ) + if not media: + raise ValueError("At least one reference video or reference image must be provided.") + if len(media) > 5: + raise ValueError( + f"Too many references ({len(media)}). The maximum total of reference videos and images is 5." + ) + + initial_response = await sync_op( + cls, + ApiEndpoint( + path="/proxy/wan/api/v1/services/aigc/video-generation/video-synthesis", + method="POST", + ), + response_model=TaskCreationResponse, + data=Wan27ReferenceVideoTaskCreationRequest( + model=model["model"], + input=Wan27ReferenceVideoInputField( + prompt=model["prompt"], + negative_prompt=model["negative_prompt"] or None, + media=media, + ), + parameters=Wan27ReferenceVideoParametersField( + resolution=model["resolution"], + ratio=model["ratio"], + duration=model["duration"], + watermark=watermark, + seed=seed, + ), + ), + ) + if not initial_response.output: + raise Exception(f"An unknown error occurred: {initial_response.code} - {initial_response.message}") + response = await poll_op( + cls, + ApiEndpoint(path=f"/proxy/wan/api/v1/tasks/{initial_response.output.task_id}"), + response_model=VideoTaskStatusResponse, + status_extractor=lambda x: x.output.task_status, + poll_interval=7, + ) + return IO.NodeOutput(await download_url_to_video_output(response.output.video_url)) + + class WanApiExtension(ComfyExtension): @override async def get_node_list(self) -> list[type[IO.ComfyNode]]: @@ -945,6 +1655,11 @@ class WanApiExtension(ComfyExtension): WanTextToVideoApi, WanImageToVideoApi, WanReferenceVideoApi, + Wan2TextToVideoApi, + Wan2ImageToVideoApi, + Wan2VideoContinuationApi, + Wan2VideoEditApi, + Wan2ReferenceVideoApi, ] From eb0686bbb60c83e44c3a3e4f7defd0f589cfef10 Mon Sep 17 00:00:00 2001 From: "Daxiong (Lin)" Date: Fri, 3 Apr 2026 14:52:10 +0800 Subject: [PATCH 07/11] Update template to 0.9.43 (#13265) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0d88fdcfb..1031ffa88 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ comfyui-frontend-package==1.42.8 -comfyui-workflow-templates==0.9.41 +comfyui-workflow-templates==0.9.43 comfyui-embedded-docs==0.4.3 torch torchsde From f21f6b22125a80d714be6f2a3a0f3a58850daee5 Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Fri, 3 Apr 2026 12:29:06 -0700 Subject: [PATCH 08/11] Add portable release for intel XPU. (#13272) --- .github/workflows/release-stable-all.yml | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release-stable-all.yml b/.github/workflows/release-stable-all.yml index 8f07a7b1c..d7cf69fe2 100644 --- a/.github/workflows/release-stable-all.yml +++ b/.github/workflows/release-stable-all.yml @@ -20,29 +20,12 @@ jobs: git_tag: ${{ inputs.git_tag }} cache_tag: "cu130" python_minor: "13" - python_patch: "11" + python_patch: "12" rel_name: "nvidia" rel_extra_name: "" test_release: true secrets: inherit - release_nvidia_cu128: - permissions: - contents: "write" - packages: "write" - pull-requests: "read" - name: "Release NVIDIA cu128" - uses: ./.github/workflows/stable-release.yml - with: - git_tag: ${{ inputs.git_tag }} - cache_tag: "cu128" - python_minor: "12" - python_patch: "10" - rel_name: "nvidia" - rel_extra_name: "_cu128" - test_release: true - secrets: inherit - release_nvidia_cu126: permissions: contents: "write" @@ -76,3 +59,20 @@ jobs: rel_extra_name: "" test_release: false secrets: inherit + + release_xpu: + permissions: + contents: "write" + packages: "write" + pull-requests: "read" + name: "Release Intel XPU" + uses: ./.github/workflows/stable-release.yml + with: + git_tag: ${{ inputs.git_tag }} + cache_tag: "xpu" + python_minor: "13" + python_patch: "12" + rel_name: "intel" + rel_extra_name: "" + test_release: true + secrets: inherit From 13917b388028aee922efce6b4714db96e8cfea36 Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Sat, 4 Apr 2026 16:02:47 -0700 Subject: [PATCH 09/11] Nightly Nvidia pytorch is now cu132 (#13288) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a47506fc8..7a7dd5614 100644 --- a/README.md +++ b/README.md @@ -276,7 +276,7 @@ Nvidia users should install stable pytorch using this command: This is the command to install pytorch nightly instead which might have performance improvements. -```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu130``` +```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu132``` #### Troubleshooting From 8cbbea8f6a571d8d2a859608bb9434103de769d7 Mon Sep 17 00:00:00 2001 From: "Daxiong (Lin)" Date: Sun, 5 Apr 2026 13:31:11 +0800 Subject: [PATCH 10/11] chore: update workflow templates to v0.9.44 (#13290) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1031ffa88..1a8e1ea1c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ comfyui-frontend-package==1.42.8 -comfyui-workflow-templates==0.9.43 +comfyui-workflow-templates==0.9.44 comfyui-embedded-docs==0.4.3 torch torchsde From 4b1444fc7a7d1dc542020f509dab2e2b90a4f16a Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Sun, 5 Apr 2026 16:37:27 -0700 Subject: [PATCH 11/11] Update README.md with new frontend release cycle. (#13301) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a7dd5614..1eeb810de 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ ComfyUI follows a weekly release cycle targeting Monday but this regularly chang - Builds a new release using the latest stable core version 3. **[ComfyUI Frontend](https://github.com/Comfy-Org/ComfyUI_frontend)** - - Weekly frontend updates are merged into the core repository + - Every 2+ weeks frontend updates are merged into the core repository - Features are frozen for the upcoming core release - Development continues for the next release cycle