Inflation Lora Character Expansion Effect Video
Upload a character image and input your prompt. Generate an animated video where the character expands with an inflation effect.
简介
This ComfyUI workflow, titled 'Inflation Lora Character Expansion Effect Video,' is designed to transform a static character image into an animated video with a unique inflation effect. By leveraging advanced AI models and custom nodes, this workflow allows users to input a character image and a descriptive prompt, which then guides the animation process.
The workflow utilizes the 'wan2.2 Animate' model, known for its capability to produce dynamic and visually appealing animations. Key nodes such as 'ComfyUI-WanAnimatePreprocess' and 'ComfyUI-WanVideoWrapper' are employed to preprocess the input image and wrap it into a video format, respectively.
Technically, the workflow begins with the 'VHS_LoadVideo' node to handle video input, followed by 'GetImageRangeFromBatch' and 'ImageResizeKJv2' to prepare the image for processing. Pose and face detection are achieved using 'PoseAndFaceDetection' and 'OnnxDetectionModelLoader', ensuring that the character's features are accurately identified and animated. The 'WanVideoModelLoader' and 'WanVideoLoraSelectMulti' nodes are crucial for loading the animation models and selecting the appropriate Lora settings for the inflation effect.
The workflow culminates in the 'WanVideoAnimateEmbeds' and 'WanVideoVAELoader' nodes, which generate the final animated video. This workflow is particularly useful for creating engaging content for social media, video games, or digital storytelling.
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。你可以在 Comfy Cloud 中打开(已预先加载所需内容),或下载后在自己的 ComfyUI 中使用。
在 Cloud 中试用查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview- 作者
- 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)常见问答
High-resolution character images with clear features work best to ensure accurate pose and face detection.
Yes, the 'WanVideoLoraSelectMulti' node allows you to tweak the Lora settings to adjust the effect's intensity.
This workflow is designed for post-production and may not be suitable for real-time applications due to processing requirements.
The workflow outputs standard video formats, compatible with most media players and editing software.