Wan Dancer: Music to Dance
Generate minute-scale coherent dance videos from music using a hierarchical Wan Dancer framework. Input a music file and reference image to produce…
Download WorkflowTry in Cloud API documentation
About
Generate minute-scale coherent dance videos from music using a hierarchical Wan Dancer framework. Input a music file and reference image to produce…
What you provide
- Reading the workflow
Runs in ComfyUI. This workflow can't run on this page. Download it and open it in ComfyUI.
Download WorkflowNo sample outputs for this workflow yet.
Inside the workflow
A read-only preview of the node graph. Open it in Comfy Cloud or download it to edit the nodes.
Loading the graph
Open full-size workflow previewFiles in this workflow
- Comfy Cloud
- Yes
- Author
- Author unavailable
Requires custom nodes
- Reading the workflow
Use this workflow from code
Generated from the workflow graph and inputs when possible; stored examples are shown otherwise. Review credentials and endpoints before running code, which may incur charges.
1 Get API key ↗
What you need
- Runs on
- Comfy Cloud
- Key
- COMFY_API_KEY
Needs a paid Cloud plan and credits.
Download API JSONAPI documentation ↗
# 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({
"547": {
"class_type": "LoadImage",
"inputs": {
"image": "blue_dancer.png"
},
"_meta": {
"title": "Load Image: Start image"
}
},
"548": {
"class_type": "LoadAudio",
"inputs": {
"audio": "wan_dancer_reference_audio.mp3"
},
"_meta": {
"title": "Load Audio"
}
},
"698": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/WanDancer_preview",
"format": "auto",
"format.codec": "auto",
"video": [
"696:642",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"699": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/WanDancer",
"format": "auto",
"format.codec": "auto",
"video": [
"696:158",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"696:158": {
"class_type": "CreateVideo",
"inputs": {
"audio": [
"696:494",
0
],
"bit_depth": 8,
"chroma_subsampling": "auto",
"codec": "none",
"color_space": "sRGB",
"fps": 30,
"images": [
"696:671",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"696:398": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 720
},
"_meta": {
"title": "Width"
}
},
"696:400": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 1280
},
"_meta": {
"title": "Height"
}
},
"696:475": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "wan2.2_dancer_14b_local_fp8_scaled.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"696:476": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors",
"model": [
"696:475",
0
],
"strength_model": 1.03
},
"_meta": {
"title": "Load LoRA"
}
},
"696:477": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "umt5_xxl_fp16.safetensors",
"device": "default",
"type": "wan"
},
"_meta": {
"title": "Load CLIP"
}
},
"696:478": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "Wan2_1_VAE_bf16.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"696:479": {
"class_type": "CLIPVisionLoader",
"inputs": {
"clip_name": "clip_vision_h.safetensors"
},
"_meta": {
"title": "Load CLIP Vision"
}
},
"696:484": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "wan2.2_dancer_14b_global_fp8_scaled.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"696:488": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors",
"model": [
"696:484",
0
],
"strength_model": 3
},
"_meta": {
"title": "Load LoRA"
}
},
"696:491": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 149
},
"_meta": {
"title": "Length"
}
},
"696:494": {
"class_type": "TrimAudioDuration",
"inputs": {
"audio": [
"548",
0
],
"duration": 25,
"start_index": 0
},
"_meta": {
"title": "Trim Audio Duration"
}
},
"696:561": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "max(16, floor(a / 16) * 16)",
"values.a": [
"696:398",
0
]
},
"_meta": {
"title": "Math Expression"
}
},
"696:562": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "max(16, floor(a / 16) * 16)",
"values.a": [
"696:400",
0
]
},
"_meta": {
"title": "Math Expression"
}
},
"696:629": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"696:477",
0
],
"text": "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走\n"
},
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"696:630": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"696:477",
0
],
"text": [
"696:632",
0
]
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"696:631": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": [
"696:685",
0
]
},
"_meta": {
"title": "Gobal Gen Prompt"
}
},
"696:632": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": [
"696:631",
0
],
"string_b": [
"696:651",
1
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"696:633": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"696:636",
0
],
"on_true": [
"696:635",
0
],
"switch": [
"696:639",
0
]
},
"_meta": {
"title": "Switch(CFG)"
}
},
"696:634": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"696:641",
0
],
"on_true": [
"696:637",
0
],
"switch": [
"696:639",
0
]
},
"_meta": {
"title": "Switch(Steps)"
}
},
"696:635": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 1
},
"_meta": {
"title": "CFG"
}
},
"696:636": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 5
},
"_meta": {
"title": "CFG"
}
},
"696:637": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 6
},
"_meta": {
"title": "Steps"
}
},
"696:638": {
"class_type": "CLIPVisionEncode",
"inputs": {
"clip_vision": [
"696:479",
0
],
"crop": "none",
"image": [
"696:640",
0
]
},
"_meta": {
"title": "CLIP Vision Encode"
}
},
"696:639": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Enable lightx2v lora"
}
},
"696:640": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"547",
0
],
"resize_type": "scale dimensions",
"resize_type.crop": "center",
"resize_type.height": [
"696:562",
1
],
"resize_type.width": [
"696:561",
1
],
"scale_method": "lanczos"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"696:641": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 25
},
"_meta": {
"title": "Steps"
}
},
"696:642": {
"class_type": "CreateVideo",
"inputs": {
"bit_depth": 8,
"chroma_subsampling": "auto",
"codec": "none",
"color_space": "sRGB",
"fps": 8,
"images": [
"696:646",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"696:643": {
"class_type": "ModelSamplingSD3",
"inputs": {
"model": [
"696:644",
0
],
"shift": 5
},
"_meta": {
"title": "ModelSamplingSD3"
}
},
"696:644": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"696:484",
0
],
"on_true": [
"696:488",
0
],
"switch": [
"696:639",
0
]
},
"_meta": {
"title": "Switch(Model)"
}
},
"696:645": {
"class_type": "SkipLayerGuidanceDiTSimple",
"inputs": {
"double_layers": "9",
"end_percent": 1,
"model": [
"696:643",
0
],
"single_layers": "",
"start_percent": 0
},
"_meta": {
"title": "SkipLayerGuidanceDiTSimple"
}
},
"696:646": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"696:652",
0
],
"vae": [
"696:478",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"696:647": {
"class_type": "WanDancerVideo",
"inputs": {
"audio_encoder_output": [
"696:651",
0
],
"clip_vision_output": [
"696:638",
0
],
"clip_vision_output_ref": [
"696:638",
0
],
"height": [
"696:562",
1
],
"length": [
"696:491",
0
],
"negative": [
"696:629",
0
],
"positive": [
"696:630",
0
],
"start_image": [
"696:640",
0
],
"vae": [
"696:478",
0
],
"width": [
"696:561",
1
]
},
"_meta": {
"title": "WanDancerVideo"
}
},
"696:651": {
"class_type": "WanDancerEncodeAudio",
"inputs": {
"audio": [
"696:494",
0
],
"audio_inject_scale": 1,
"video_frames": 149
},
"_meta": {
"title": "WanDancerEncodeAudio"
}
},
"696:652": {
"class_type": "LatentCutToBatch",
"inputs": {
"dim": "t",
"samples": [
"696:655",
0
],
"slice_size": 1
},
"_meta": {
"title": "LatentCutToBatch"
}
},
"696:653": {
"class_type": "BasicScheduler",
"inputs": {
"denoise": 1,
"model": [
"696:645",
0
],
"scheduler": "simple",
"steps": [
"696:634",
0
]
},
"_meta": {
"title": "BasicScheduler"
}
},
"696:654": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 0
},
"_meta": {
"title": "RandomNoise"
}
},
"696:655": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"696:657",
0
],
"latent_image": [
"696:647",
2
],
"noise": [
"696:654",
0
],
"sampler": [
"696:656",
0
],
"sigmas": [
"696:653",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"696:656": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"696:657": {
"class_type": "CFGGuider",
"inputs": {
"cfg": [
"696:633",
0
],
"model": [
"696:645",
0
],
"negative": [
"696:647",
1
],
"positive": [
"696:647",
0
]
},
"_meta": {
"title": "CFG Guider"
}
},
"696:658": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"696:667",
0
],
"vae": [
"696:478",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"696:659": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "euler"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"696:661": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"696:663",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"696:662": {
"class_type": "BasicScheduler",
"inputs": {
"denoise": 1,
"model": [
"696:476",
0
],
"scheduler": "simple",
"steps": 6
},
"_meta": {
"title": "BasicScheduler"
}
},
"696:663": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"696:477",
0
],
"text": [
"696:691",
0
]
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"696:664": {
"class_type": "CLIPVisionEncode",
"inputs": {
"clip_vision": [
"696:479",
0
],
"crop": "none",
"image": [
"696:665",
0
]
},
"_meta": {
"title": "CLIP Vision Encode"
}
},
"696:665": {
"class_type": "ImageFromBatch",
"inputs": {
"batch_index": 0,
"image": [
"696:670",
0
],
"length": 1
},
"_meta": {
"title": "Get Image from Batch"
}
},
"696:666": {
"class_type": "PrimitiveInt",
"inputs": {
"value": [
"696:491",
0
]
},
"_meta": {
"title": "Length"
}
},
"696:667": {
"class_type": "SamplerCustom",
"inputs": {
"add_noise": True,
"cfg": 1,
"latent_image": [
"696:668",
2
],
"model": [
"696:476",
0
],
"negative": [
"696:668",
1
],
"noise_seed": 1,
"positive": [
"696:668",
0
],
"sampler": [
"696:659",
0
],
"sigmas": [
"696:662",
0
]
},
"_meta": {
"title": "SamplerCustom"
}
},
"696:668": {
"class_type": "WanDancerVideo",
"inputs": {
"audio_encoder_output": [
"696:669",
0
],
"clip_vision_output": [
"696:664",
0
],
"clip_vision_output_ref": [
"696:638",
0
],
"height": [
"696:562",
1
],
"length": [
"696:666",
0
],
"mask": [
"696:670",
1
],
"negative": [
"696:661",
0
],
"positive": [
"696:663",
0
],
"start_image": [
"696:670",
0
],
"vae": [
"696:478",
0
],
"width": [
"696:561",
1
]
},
"_meta": {
"title": "WanDancerVideo"
}
},
"696:669": {
"class_type": "WanDancerEncodeAudio",
"inputs": {
"audio": [
"696:670",
2
],
"audio_inject_scale": 1,
"video_frames": [
"696:491",
0
]
},
"_meta": {
"title": "WanDancerEncodeAudio"
}
},
"696:670": {
"class_type": "WanDancerPadKeyframesList",
"inputs": {
"audio": [
"696:494",
0
],
"images": [
"696:646",
0
],
"num_segments": [
"696:701",
1
],
"segment_length": [
"696:491",
0
]
},
"_meta": {
"title": "WanDancerPadKeyframesList"
}
},
"696:671": {
"class_type": "RebatchImages",
"inputs": {
"batch_size": 4096,
"images": [
"696:658",
0
]
},
"_meta": {
"title": "Rebatch Images"
}
},
"696:685": {
"class_type": "StringReplace",
"inputs": {
"find": "<dance style>",
"replace": [
"696:688:8",
0
],
"string": "一个人正在跳舞,舞蹈种类是<dance style>"
},
"_meta": {
"title": "Text Replace (Global prompt)"
}
},
"696:686": {
"class_type": "StringReplace",
"inputs": {
"find": "<amplitude>",
"replace": [
"696:690:14",
0
],
"string": ",图像清晰程度高,人物动作幅度<amplitude>"
},
"_meta": {
"title": "Text Replace (Local prompt)"
}
},
"696:688:10": {
"class_type": "StringReplace",
"inputs": {
"find": "index",
"replace": [
"696:688:7",
0
],
"string": "(?:[^\\n]*\\n){index}([^\\n]+)"
},
"_meta": {
"title": "Replace Text"
}
},
"696:688:7": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"696:688:9",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"696:688:8": {
"class_type": "RegexExtract",
"inputs": {
"case_insensitive": False,
"dotall": False,
"group_index": 1,
"mode": "First Group",
"multiline": False,
"regex_pattern": [
"696:688:10",
0
],
"string": "古典舞\n韩舞\n街舞\n拉丁舞\n踢踏舞"
},
"_meta": {
"title": "Extract Text"
}
},
"696:688:9": {
"class_type": "PrimitiveInt",
"inputs": {
"value": [
"696:695",
1
]
},
"_meta": {
"title": "Int"
}
},
"696:690:13": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"696:690:15",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"696:690:14": {
"class_type": "RegexExtract",
"inputs": {
"case_insensitive": False,
"dotall": False,
"group_index": 1,
"mode": "First Group",
"multiline": False,
"regex_pattern": [
"696:690:16",
0
],
"string": "低\n中等\n高\n最大"
},
"_meta": {
"title": "Extract Text"
}
},
"696:690:15": {
"class_type": "PrimitiveInt",
"inputs": {
"value": [
"696:694",
1
]
},
"_meta": {
"title": "Int"
}
},
"696:690:16": {
"class_type": "StringReplace",
"inputs": {
"find": "index",
"replace": [
"696:690:13",
0
],
"string": "(?:[^\\n]*\\n){index}([^\\n]+)"
},
"_meta": {
"title": "Replace Text"
}
},
"696:691": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": "",
"string_a": [
"696:685",
0
],
"string_b": [
"696:686",
0
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"696:694": {
"class_type": "CustomCombo",
"inputs": {
"choice": "low 低"
},
"_meta": {
"title": "Custom Combo (Motion Amplitude)"
}
},
"696:695": {
"class_type": "CustomCombo",
"inputs": {
"choice": "Latin Dance 拉丁舞"
},
"_meta": {
"title": "Custom Combo (Dance Style)"
}
},
"696:700": {
"class_type": "CustomCombo",
"inputs": {
"choice": "5"
},
"_meta": {
"title": "Custom Combo (Duration)"
}
},
"696:701": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "a + 1",
"values.a": [
"696:700",
1
]
},
"_meta": {
"title": "Math Expression"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)Related workflows
- Wan, Wan2.2
Image to Video (New)
- Kling, Nano Banana Pro, Wan
Product Scene Transformation
- Wan2.1, Wan
Wan 2.1 ControlNet
- Wan2.1, Wan
Wan 2.1 FLF2V 720p F16
- Wan2.1, Wan
Wan 2.1 Fun Camera 1.3B
- Wan2.1, Wan
Wan 2.1 Fun Camera 14B
- Wan2.1, Wan
Wan 2.1 Image to Video
- Wan2.1, Wan
Wan 2.1 Inpainting
- Wan2.1, Wan
Wan 2.1 Text to Video
- Wan2.2, Wan
Wan 2.2 14B First-Last Frame to Video
- Wan2.2, Wan
Wan 2.2 14B Fun Camera Control
- Wan2.2, Wan
Wan 2.2 14B Fun Control