MusubiTunerWanGenerateVideo
Run musubi-tuner's Wan script from inside ComfyUI — without pretending it's native
- stdout
- stderr
- return_code
Let's be clear about what this node is, because the name overpromises: it doesn't load Wan into ComfyUI's graph and it doesn't call any API. MusubiTunerWanGenerateVideo is a command builder. It takes your settings, turns them into a wan_generate_video.py invocation for kohya-ss/musubi-tuner, and runs that script as a subprocess in musubi-tuner's own virtualenv. The output never enters the graph - it's written to disk, and the node hands you back stdout, stderr, and a return code.
Why you'd reach for it
musubi-tuner is the community's primary tool for training Wan LoRAs - it's how most of the good character-LoRA packs on CivitAI got made, and it's where you end up when you outgrow ComfyUI-native training. But it's pure CLI with no UI. If you train there, you already have a full Wan 2.1 stack (DiT, VAE, T5, CLIP checkpoints plus a venv) sitting on disk, and this node is a way to run that same environment for generation without keeping a second terminal workflow alive.
Honest framing: if you don't already live in musubi-tuner, skip this. Native ComfyUI Wan (or Kijai's wrapper) is easier, and this node deliberately forgoes everything that makes ComfyUI generation nice - no preview in the graph, no upscaling into other nodes, video saved to a folder you have to go dig in. It exists for musubi-tuner people who want to generate from the same weights, LoRAs, and flag vocabulary they train with.
How it works
The node validates your inputs, builds the CLI args, locates your musubi-tuner install, and shells out. Under the hood it's picky in ways that tell you it's a wrapper:
- It needs
musubi_tuner_pathpointing at the musubi-tuner repo root - the code insists onsrc/musubi_tunerexisting, and on avenv,.venv, orenvdirectory with a Python binary inside. That venv's Python is what actually runs the generation. - Video sizes are enforced per task.
t2v-14Bonly accepts 720x1280, 1280x720, 480x832, or 832x480; the 1.3B tasks only the two 832/480 combos. Set 1024x576 and it errors before anything runs. i2v-*tasks require aclippath;*-FC(Fun Control) tasks requirecontrol_path. Empty them and it refuses.
The interesting inputs beyond task, prompt, and the three model paths (dit, vae, t5 - all plain file-path strings, no auto-downloading here):
image_path+clipfor i2v, plusend_image_pathfor first/last-frame (flf2v).lora_weight(comma-separated paths) withlora_multiplier- the reason most people install this.- The memory knobs:
fp8,fp8_scaled,fp8_fast,fp8_t5, andblocks_to_swap(0–39) for offloading transformer blocks to RAM.attn_modepickstorch,sdpa,xformers,sageattn,flash/flash2/flash3. output_type(video,images,latent,both,latent_images) andcfg_skip_modefor the CFG-skip tricks.
Its three outputs - stdout, stderr, return_code - are diagnostics, not media. If you're hunting for the clip, the node saves into ComfyUI/custom_nodes/ComfyUI-musubi-tuner/output/.
Installing it
The node itself is trivial - no Python deps of its own, since it reuses musubi-tuner's venv:
cd ComfyUI/custom_nodes
git clone https://github.com/keit0728/ComfyUI-musubi-tuner.git
Then restart ComfyUI. The real installation is the prerequisite the README states flatly: musubi-tuner must already be installed and working for Wan generation before you start. Get that running first; this node is only a front door to it.
Where people get burned
- "musubi-tuner path not found": point
musubi_tuner_pathat the repo root, notsrc/musubi_tuner. The node checks for that subdirectory itself. - "Virtual environment not found": musubi-tuner setup creates a venv; if you skipped it and installed into system Python, the node can't find a Python to execute with.
- The size error: it's not a bug - those are the only resolutions musubi-tuner's script supports for that task. Drop to a listed size.
- "Command execution failed": that's musubi-tuner's script dying with a non-zero exit; the real reason is in
stderr, and withshow_progresson, the live log also streams into ComfyUI's console.
One more honest note: the author's last commit here was mid-2025, and it's a personal, low-star wrapper rather than a maintained ecosystem project. It works, but treat it as a handy shim for your existing musubi-tuner setup, not as the future of ComfyUI Wan.
Inputs (38)
| Name | Type | Default | Description |
|---|---|---|---|
| task | COMBO | t2v-14B | 8 options: t2v-1.3B, t2v-14B, i2v-14B, t2i-14B, flf2v-14B, t2v-1.3B-FC, +2 |
| prompt | STRING | — | |
| dit | STRING | — | |
| vae | STRING | — | |
| t5 | STRING | — | |
| video_size_width | INT | 832256–2048 | — |
| video_size_height | INT | 480256–2048 | — |
| video_length | INT | 811–200 | — |
| fps | INT | 161–60 | — |
| infer_steps | INT | 201–100 | — |
| negative_promptopt | STRING | — | |
| seedopt | INT | -1 | — |
| guidance_scaleopt | FLOAT | 5.000–20 | — |
| flow_shiftopt | FLOAT | -1.00 | — |
| fp8opt | BOOLEAN | false | — |
| fp8_scaledopt | BOOLEAN | false | — |
| fp8_fastopt | BOOLEAN | false | — |
| fp8_t5opt | BOOLEAN | false | — |
| blocks_to_swapopt | INT | 00–39 | — |
| attn_modeopt | COMBO | torch | 7 options: torch, sdpa, xformers, sageattn, flash, flash2, +1 |
| vae_cache_cpuopt | BOOLEAN | false | — |
| image_pathopt | STRING | — | |
| end_image_pathopt | STRING | — | |
| video_pathopt | STRING | — | |
| clipopt | STRING | — | |
| control_pathopt | STRING | — | |
| lora_weightopt | STRING | — | |
| lora_multiplieropt | FLOAT | 1.00 | — |
| cfg_skip_modeopt | COMBO | none | 6 options: none, early, late, middle, early_late, alternate |
| cfg_apply_ratioopt | FLOAT | 1.000–1 | — |
| trim_tail_framesopt | INT | 0 | — |
| output_typeopt | COMBO | video | 5 options: video, images, latent, both, latent_images |
| cpu_noiseopt | BOOLEAN | false | — |
| musubi_tuner_pathopt | STRING | — | |
| working_directoryopt | STRING | — | |
| environment_jsonopt | STRING | {} | — |
| timeoutopt | INT | 36001–86400 | — |
| show_progressopt | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| stdout | STRING | — |
| stderr | STRING | — |
| return_code | INT | — |