From b7cecfd69e641786c262a882c3bc66835a928fff Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 27 Dec 2025 23:28:15 +1300 Subject: [PATCH] Use API format workflow instead of frontend format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The frontend-to-API conversion was using outdated widget names that don't match the current WanVideo node API. Using the exported API format workflow directly bypasses this issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- handler.py | 2 +- workflows/Wan22-I2V-Remix-API.json | 414 +++++++++++++++++++++++++++++ 2 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 workflows/Wan22-I2V-Remix-API.json diff --git a/handler.py b/handler.py index 23b1c10..e215b93 100644 --- a/handler.py +++ b/handler.py @@ -31,7 +31,7 @@ COMFYUI_HOST = f"http://127.0.0.1:{COMFYUI_PORT}" MAX_TIMEOUT = 600 # 10 minutes max for video generation POLL_INTERVAL = 1.0 STARTUP_TIMEOUT = 120 -DEFAULT_WORKFLOW_PATH = "/workspace/workflows/Wan22-I2V-Remix.json" +DEFAULT_WORKFLOW_PATH = "/workspace/workflows/Wan22-I2V-Remix-API.json" # Wan22-I2V-Remix node IDs NODE_IMAGE_INPUT = "148" diff --git a/workflows/Wan22-I2V-Remix-API.json b/workflows/Wan22-I2V-Remix-API.json new file mode 100644 index 0000000..00ecd8b --- /dev/null +++ b/workflows/Wan22-I2V-Remix-API.json @@ -0,0 +1,414 @@ +{ + "115": { + "inputs": { + "ckpt_name": "rife47.pth", + "clear_cache_after_n_frames": 50, + "multiplier": 2, + "fast_mode": true, + "ensemble": true, + "scale_factor": 1, + "frames": [ + "158", + 0 + ] + }, + "class_type": "RIFE VFI", + "_meta": { + "title": "RIFE VFI (recommend rife47 and rife49)" + } + }, + "116": { + "inputs": { + "fps": 32, + "images": [ + "115", + 0 + ] + }, + "class_type": "CreateVideo", + "_meta": { + "title": "Create Video" + } + }, + "117": { + "inputs": { + "filename_prefix": "video/ComfyUI", + "format": "auto", + "codec": "h264", + "video": [ + "116", + 0 + ] + }, + "class_type": "SaveVideo", + "_meta": { + "title": "Save Video" + } + }, + "127": { + "inputs": { + "backend": "inductor", + "fullgraph": false, + "mode": "default", + "dynamic": false, + "dynamo_cache_size_limit": 64, + "compile_transformer_blocks_only": true, + "dynamo_recompile_limit": 128, + "force_parameter_static_shapes": false, + "allow_unmerged_lora_compile": false + }, + "class_type": "WanVideoTorchCompileSettings", + "_meta": { + "title": "WanVideo Torch Compile Settings" + } + }, + "128": { + "inputs": { + "blocks_to_swap": 20, + "offload_img_emb": false, + "offload_txt_emb": false, + "use_non_blocking": false, + "vace_blocks_to_swap": 0, + "prefetch_blocks": 0, + "block_swap_debug": false + }, + "class_type": "WanVideoBlockSwap", + "_meta": { + "title": "WanVideo Block Swap" + } + }, + "131": { + "inputs": { + "model": "Wan2.2_Remix_NSFW_i2v_14b_high_lighting_v2.0.safetensors", + "base_precision": "fp16_fast", + "quantization": "disabled", + "load_device": "offload_device", + "attention_mode": "sageattn", + "rms_norm_function": "default", + "compile_args": [ + "127", + 0 + ], + "block_swap_args": [ + "128", + 0 + ] + }, + "class_type": "WanVideoModelLoader", + "_meta": { + "title": "WanVideo Model Loader" + } + }, + "132": { + "inputs": { + "model": "Wan2.2_Remix_NSFW_i2v_14b_low_lighting_v2.0.safetensors", + "base_precision": "fp16_fast", + "quantization": "disabled", + "load_device": "offload_device", + "attention_mode": "sageattn", + "rms_norm_function": "default", + "compile_args": [ + "127", + 0 + ], + "block_swap_args": [ + "128", + 0 + ] + }, + "class_type": "WanVideoModelLoader", + "_meta": { + "title": "WanVideo Model Loader" + } + }, + "133": { + "inputs": { + "clip_name": "nsfw_wan_umt5-xxl_fp8_scaled.safetensors", + "type": "wan", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "134": { + "inputs": { + "text": "", + "clip": [ + "133", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Positive Prompt)" + } + }, + "137": { + "inputs": { + "text": "low quality, lowres, bad hands, extra limbs, missing fingers, poorly drawn face, bad anatomy, blurred, jpeg artifacts, deformed, ugly, bad proportions, disfigured, watermark, text, logo, signature, unrealistic eyes, cross-eyed, lopsided, bad lighting, harsh shadows, flat shading, unshapely body, pixelated, duplicate limbs, bad perspective, morphed, distorted, glitch, malformed hands, distorted fingers, noisy background, overly saturated, unnatural colors, lens distortion, grainy, low detail,", + "clip": [ + "133", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Negative Prompt)" + } + }, + "138": { + "inputs": { + "positive": [ + "134", + 0 + ], + "negative": [ + "137", + 0 + ] + }, + "class_type": "WanVideoTextEmbedBridge", + "_meta": { + "title": "WanVideo TextEmbed Bridge" + } + }, + "139": { + "inputs": { + "steps": [ + "150", + 0 + ], + "cfg": 1, + "shift": 8, + "seed": 246405119682734, + "force_offload": true, + "scheduler": "euler", + "riflex_freq_index": 0, + "denoise_strength": 1, + "batched_cfg": false, + "rope_function": "comfy", + "start_step": 0, + "end_step": [ + "151", + 0 + ], + "add_noise_to_samples": true, + "model": [ + "131", + 0 + ], + "image_embeds": [ + "156", + 0 + ], + "text_embeds": [ + "138", + 0 + ] + }, + "class_type": "WanVideoSampler", + "_meta": { + "title": "WanVideo Sampler" + } + }, + "140": { + "inputs": { + "steps": [ + "150", + 0 + ], + "cfg": 1, + "shift": 8, + "seed": 941824044416901, + "force_offload": true, + "scheduler": "euler", + "riflex_freq_index": 0, + "denoise_strength": 1, + "batched_cfg": false, + "rope_function": "comfy", + "start_step": [ + "151", + 0 + ], + "end_step": 10000, + "add_noise_to_samples": false, + "model": [ + "132", + 0 + ], + "image_embeds": [ + "156", + 0 + ], + "text_embeds": [ + "138", + 0 + ], + "samples": [ + "139", + 0 + ] + }, + "class_type": "WanVideoSampler", + "_meta": { + "title": "WanVideo Sampler" + } + }, + "143": { + "inputs": { + "image": [ + "148", + 0 + ] + }, + "class_type": "GetImageSize", + "_meta": { + "title": "Get Image Size" + } + }, + "144": { + "inputs": { + "expression": "(round(a / min(a,b) * c) // 16) * 16", + "a": [ + "143", + 0 + ], + "b": [ + "143", + 1 + ], + "c": [ + "147", + 0 + ] + }, + "class_type": "MathExpression|pysssss", + "_meta": { + "title": "Width Calculation" + } + }, + "145": { + "inputs": { + "expression": "(round(b / min(a,b) * c) // 16) * 16", + "a": [ + "143", + 0 + ], + "b": [ + "143", + 1 + ], + "c": [ + "147", + 0 + ] + }, + "class_type": "MathExpression|pysssss", + "_meta": { + "title": "Height Calculation" + } + }, + "147": { + "inputs": { + "value": 720 + }, + "class_type": "easy int", + "_meta": { + "title": "Set Resolution" + } + }, + "148": { + "inputs": { + "image": "ComfyUI_00006_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "Load Image" + } + }, + "150": { + "inputs": { + "value": 8 + }, + "class_type": "INTConstant", + "_meta": { + "title": "Steps" + } + }, + "151": { + "inputs": { + "value": 4 + }, + "class_type": "INTConstant", + "_meta": { + "title": "Split_step" + } + }, + "156": { + "inputs": { + "width": [ + "144", + 0 + ], + "height": [ + "145", + 0 + ], + "num_frames": 65, + "noise_aug_strength": 0, + "start_latent_strength": 1, + "end_latent_strength": 1, + "force_offload": true, + "fun_or_fl2v_model": false, + "tiled_vae": false, + "augment_empty_frames": 0, + "vae": [ + "157", + 0 + ], + "start_image": [ + "148", + 0 + ] + }, + "class_type": "WanVideoImageToVideoEncode", + "_meta": { + "title": "WanVideo ImageToVideo Encode" + } + }, + "157": { + "inputs": { + "model_name": "wan_2.1_vae.safetensors", + "precision": "bf16", + "use_cpu_cache": false + }, + "class_type": "WanVideoVAELoader", + "_meta": { + "title": "WanVideo VAE Loader" + } + }, + "158": { + "inputs": { + "enable_vae_tiling": false, + "tile_x": 272, + "tile_y": 272, + "tile_stride_x": 144, + "tile_stride_y": 128, + "normalization": "default", + "vae": [ + "157", + 0 + ], + "samples": [ + "140", + 0 + ] + }, + "class_type": "WanVideoDecode", + "_meta": { + "title": "WanVideo Decode" + } + } +} \ No newline at end of file