通貨膨脹Lora角色擴充效果影片
上傳角色圖像並輸入提示詞。產生一個動畫影片,角色會隨著膨脹效果而擴大。
關於
這個 ComfyUI 工作流程(標題為「Inflation Lora Character Expansion Effect Video」)用來把靜態角色圖片轉成帶有膨脹特效的動畫影片。它透過進階 AI 模型與自訂節點,讓使用者輸入角色圖片以及描述性提示,並由提示引導動畫。工作流程使用「wan2.2 Animate」模型,以產生動態且觀感良好的動畫。關鍵節點如「ComfyUI-WanAnimatePreprocess」以及「ComfyUI-WanVideoWrapper」,分別用於前處理輸入圖片以及將結果封裝成影片格式。
在技術流程上,工作流程先用「VHS_LoadVideo」處理影片輸入,接著以「GetImageRangeFromBatch」與「ImageResizeKJv2」準備影像。姿勢與人臉偵測透過「PoseAndFaceDetection」與「OnnxDetectionModelLoader」完成,確保能準確辨識並動畫化角色特徵。「WanVideoModelLoader」與「WanVideoLoraSelectMulti」負責載入動畫模型並選取適合膨脹效果的 LoRA 設定。最後由「WanVideoAnimateEmbeds」與「WanVideoVAELoader」產生最終動畫影片。這個工作流程適合用來製作社群媒體內容、遊戲素材或數位敘事。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
Loading the graph
Open full-size workflow preview此工作流程中的檔案
- lightx2v_14B_T2V_cfg_step_distill_lora_adaptive_rank_quantile_0.15_bf16.safetensors
- WanAnimate_relight_lora_fp16.safetensors
- clip_vision_h.safetensors
- umt5-xxl-enc-bf16.safetensors
- qwen_image_edit_2511_bf16.safetensors
- qwen_image_vae.safetensors
- qwen_2.5_vl_7b_fp8_scaled.safetensors
- Qwen_Image_Edit_2511-SYSTMS_INFL8.safetensors
- 作者
- ComfyUI
需要自訂節點
- 正在讀取工作流程
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"2": {
"class_type": "VHS_LoadVideo",
"inputs": {
"custom_height": 0,
"custom_width": 0,
"force_rate": 0,
"format": "AnimateDiff",
"frame_load_cap": 121,
"select_every_nth": 1,
"skip_first_frames": 0,
"video": "woman_walking.mp4"
},
"_meta": {
"title": "Load Video (Upload) 🎥🅥🅗🅢"
}
},
"11": {
"class_type": "GetImageRangeFromBatch",
"inputs": {
"images": [
"2",
0
],
"num_frames": 1,
"start_index": [
"359",
1
]
},
"_meta": {
"title": "Get Image or Mask Range From Batch"
}
},
"32": {
"class_type": "ImageResizeKJv2",
"inputs": {
"crop_position": "center",
"device": "cpu",
"divisible_by": 2,
"height": [
"52",
2
],
"image": [
"358:8",
0
],
"keep_proportion": "stretch",
"pad_color": "0, 0, 0",
"upscale_method": "lanczos",
"width": [
"52",
1
]
},
"_meta": {
"title": "Resize Image v2"
}
},
"33": {
"class_type": "PoseAndFaceDetection",
"inputs": {
"face_padding": 0,
"height": [
"52",
2
],
"images": [
"52",
0
],
"model": [
"35",
0
],
"width": [
"52",
1
]
},
"_meta": {
"title": "Pose and Face Detection"
}
},
"35": {
"class_type": "OnnxDetectionModelLoader",
"inputs": {
"onnx_device": "CUDAExecutionProvider",
"vitpose_model": "vitpose-l-wholebody.onnx",
"yolo_model": "yolov10m.onnx"
},
"_meta": {
"title": "ONNX Detection Model Loader"
}
},
"36": {
"class_type": "DrawViTPose",
"inputs": {
"body_stick_width": -1,
"draw_head": True,
"hand_stick_width": -1,
"height": [
"52",
2
],
"pose_data": [
"33",
0
],
"retarget_padding": 16,
"width": [
"52",
1
]
},
"_meta": {
"title": "Draw ViT Pose"
}
},
"43": {
"class_type": "VHS_VideoCombine",
"inputs": {
"audio": [
"2",
2
],
"crf": 10,
"filename_prefix": "INFL8/GENS/VID",
"format": "video/h264-mp4",
"frame_rate": [
"68",
0
],
"images": [
"67",
0
],
"loop_count": 0,
"pingpong": False,
"pix_fmt": "yuv420p",
"save_metadata": True,
"save_output": True,
"trim_to_audio": False
},
"_meta": {
"title": "Video Combine 🎥🅥🅗🅢"
}
},
"47": {
"class_type": "DownloadAndLoadSAM2Model",
"inputs": {
"device": "cuda",
"model": "sam2.1_hiera_large.safetensors",
"precision": "fp16",
"segmentor": "video"
},
"_meta": {
"title": "(Down)Load SAM2Model"
}
},
"48": {
"class_type": "Sam2Segmentation",
"inputs": {
"bboxes": [
"33",
3
],
"image": [
"52",
0
],
"individual_objects": False,
"keep_model_loaded": False,
"sam2_model": [
"47",
0
]
},
"_meta": {
"title": "Sam2Segmentation"
}
},
"49": {
"class_type": "BlockifyMask",
"inputs": {
"block_size": 32,
"device": "cpu",
"masks": [
"50",
0
]
},
"_meta": {
"title": "Blockify Mask"
}
},
"50": {
"class_type": "GrowMaskWithBlur",
"inputs": {
"blur_radius": 0,
"decay_factor": 1,
"expand": 40,
"fill_holes": False,
"flip_input": False,
"incremental_expandrate": 0,
"lerp_alpha": 1,
"mask": [
"48",
0
],
"tapered_corners": True
},
"_meta": {
"title": "Grow Mask With Blur"
}
},
"51": {
"class_type": "DrawMaskOnImage",
"inputs": {
"color": "0, 0, 0",
"device": "cpu",
"image": [
"52",
0
],
"mask": [
"49",
0
]
},
"_meta": {
"title": "Draw Mask On Image"
}
},
"52": {
"class_type": "ImageResizeKJv2",
"inputs": {
"crop_position": "center",
"device": "cpu",
"divisible_by": 2,
"height": 720,
"image": [
"2",
0
],
"keep_proportion": "crop",
"pad_color": "0, 0, 0",
"upscale_method": "lanczos",
"width": 1280
},
"_meta": {
"title": "Resize Image v2"
}
},
"53": {
"class_type": "WanVideoModelLoader",
"inputs": {
"attention_mode": "comfy",
"base_precision": "bf16",
"load_device": "offload_device",
"lora": [
"57",
0
],
"model": "wan2.2_animate_14B_bf16.safetensors",
"quantization": "disabled",
"rms_norm_function": "default"
},
"_meta": {
"title": "WanVideo Model Loader"
}
},
"57": {
"class_type": "WanVideoLoraSelectMulti",
"inputs": {
"lora_0": "lightx2v_14B_T2V_cfg_step_distill_lora_adaptive_rank_quantile_0.15_bf16.safetensors",
"lora_1": "WanAnimate_relight_lora_fp16.safetensors",
"lora_2": "none",
"lora_3": "none",
"lora_4": "none",
"low_mem_load": False,
"merge_loras": False,
"strength_0": 1,
"strength_1": 1,
"strength_2": 1,
"strength_3": 1,
"strength_4": 1
},
"_meta": {
"title": "WanVideo Lora Select Multi"
}
},
"58": {
"class_type": "WanVideoSamplerv2",
"inputs": {
"add_noise_to_samples": False,
"cfg": 1,
"force_offload": True,
"image_embeds": [
"60",
0
],
"model": [
"53",
0
],
"scheduler": [
"59",
0
],
"seed": 648178387160412,
"text_embeds": [
"65",
0
]
},
"_meta": {
"title": "WanVideo Sampler v2"
}
},
"59": {
"class_type": "WanVideoSchedulerv2",
"inputs": {
"end_step": -1,
"enhance_hf": True,
"scheduler": "dpm++_sde",
"shift": 5,
"start_step": 0,
"steps": 6
},
"_meta": {
"title": "WanVideo Scheduler v2"
}
},
"60": {
"class_type": "WanVideoAnimateEmbeds",
"inputs": {
"bg_images": [
"51",
0
],
"clip_embeds": [
"62",
0
],
"colormatch": "disabled",
"face_images": [
"33",
1
],
"face_strength": 1,
"force_offload": True,
"frame_window_size": 77,
"height": [
"52",
2
],
"mask": [
"49",
0
],
"num_frames": [
"2",
1
],
"pose_images": [
"36",
0
],
"pose_strength": 1,
"ref_images": [
"32",
0
],
"tiled_vae": False,
"vae": [
"61",
0
],
"width": [
"52",
1
]
},
"_meta": {
"title": "WanVideo Animate Embeds"
}
},
"61": {
"class_type": "WanVideoVAELoader",
"inputs": {
"model_name": "Wan2_1_VAE_fp32.safetensors",
"precision": "fp32",
"use_cpu_cache": False,
"verbose": False
},
"_meta": {
"title": "WanVideo VAE Loader"
}
},
"62": {
"class_type": "WanVideoClipVisionEncode",
"inputs": {
"clip_vision": [
"63",
0
],
"combine_embeds": "average",
"crop": "center",
"force_offload": True,
"image_1": [
"32",
0
],
"ratio": 0.5,
"strength_1": 1,
"strength_2": 1,
"tiles": 0
},
"_meta": {
"title": "WanVideo ClipVision Encode"
}
},
"63": {
"class_type": "CLIPVisionLoader",
"inputs": {
"clip_name": "clip_vision_h.safetensors"
},
"_meta": {
"title": "Load CLIP Vision"
}
},
"65": {
"class_type": "WanVideoTextEncode",
"inputs": {
"device": "gpu",
"force_offload": True,
"negative_prompt": "",
"positive_prompt": "INFL8, the inflated man is speaking on the phone",
"t5": [
"66",
0
],
"use_disk_cache": False
},
"_meta": {
"title": "WanVideo TextEncode"
}
},
"66": {
"class_type": "LoadWanVideoT5TextEncoder",
"inputs": {
"load_device": "offload_device",
"model_name": "umt5-xxl-enc-bf16.safetensors",
"precision": "fp32",
"quantization": "disabled"
},
"_meta": {
"title": "WanVideo T5 Text Encoder Loader"
}
},
"67": {
"class_type": "WanVideoDecode",
"inputs": {
"enable_vae_tiling": False,
"normalization": "default",
"samples": [
"58",
0
],
"tile_stride_x": 144,
"tile_stride_y": 128,
"tile_x": 272,
"tile_y": 272,
"vae": [
"61",
0
]
},
"_meta": {
"title": "WanVideo Decode"
}
},
"68": {
"class_type": "VHS_VideoInfo",
"inputs": {
"video_info": [
"2",
3
]
},
"_meta": {
"title": "Video Info 🎥🅥🅗🅢"
}
},
"359": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "a/2",
"values.a": [
"2",
1
]
},
"_meta": {
"title": "Math Expression"
}
},
"361": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"358:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"358:12": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2511_bf16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"358:349": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"358:350": {
"class_type": "FluxKontextMultiReferenceLatentMethod",
"inputs": {
"conditioning": [
"358:352",
0
],
"reference_latents_method": "index_timestep_zero"
},
"_meta": {
"title": "Edit Model Reference Method"
}
},
"358:351": {
"class_type": "FluxKontextMultiReferenceLatentMethod",
"inputs": {
"conditioning": [
"358:353",
0
],
"reference_latents_method": "index_timestep_zero"
},
"_meta": {
"title": "Edit Model Reference Method"
}
},
"358:352": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"358:355",
0
],
"image1": [
"358:88",
0
],
"prompt": "",
"vae": [
"358:349",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
},
"358:353": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"358:355",
0
],
"image1": [
"358:88",
0
],
"prompt": "inflate the woman",
"vae": [
"358:349",
0
]
},
"_meta": {
"title": "TextEncodeQwenImageEditPlus (Positive)"
}
},
"358:354": {
"class_type": "KSampler",
"inputs": {
"cfg": 4,
"denoise": 1,
"latent_image": [
"358:75",
0
],
"model": [
"358:64",
0
],
"negative": [
"358:350",
0
],
"positive": [
"358:351",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 544553820212047,
"steps": 40
},
"_meta": {
"title": "KSampler"
}
},
"358:355": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"358:64": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"358:71",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
},
"358:71": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"358:90",
0
],
"sampling": "flow",
"shift": 3.1
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"358:75": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"358:88",
0
],
"vae": [
"358:349",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"358:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"358:354",
0
],
"vae": [
"358:349",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"358:88": {
"class_type": "FluxKontextImageScale",
"inputs": {
"image": [
"11",
0
]
},
"_meta": {
"title": "FluxKontextImageScale"
}
},
"358:90": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen_Image_Edit_2511-SYSTMS_INFL8.safetensors",
"model": [
"358:12",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
建議使用高解析度、特徵明確的角色圖片,有助於準確偵測姿勢與臉部。
可以,透過「WanVideoLoraSelectMulti」節點調整 Lora 設定即可。
本流程設計為後製用途,因運算需求較高,不適合即時應用。
流程輸出標準影片格式,與大多數播放器與剪輯軟體相容。
相關工作流程
- wan2.2 Animate
3.2 進階:控制影片生成
- Wan, wan2.2 Animate
Wan2.2 Animate, 角色動畫與替換
- wan2.2 Animate
Wan2.2 Animate:自動角色替換
- wan2.2 Animate
Wan萬相動畫2.2角色替換工作流程
- LTX-2.3
Add camera motion first last frame
- Wan Animate
Copy movement from a video
- ElevenLabs
ElevenLabs:文生音效
- 合作夥伴節點
Gemini Omni Flash
- Kling, Kling 1.6
Kling 1.6:影片特效
- Kling 3.0
Kling 3.0:動作控制
- Kling 2.6, Kling
Kling2.6:運動控制
- Kling 1.6, Kling
Kling:雙角色互動特效