Nodes/ComfyUI-musubi-tuner/MusubiTunerWanGenerateVideo
ComfyUI Node

MusubiTunerWanGenerateVideo

Run musubi-tuner's Wan script from inside ComfyUI — without pretending it's native

By keit0728·Created about a year ago·Updated about a year ago· 1
MusubiTunerWanGenerateVideo
    • stdout
    • stderr
    • return_code
    taskt2v-14B
    prompt
    dit
    vae
    t5
    video_size_width832
    video_size_height480
    video_length81
    fps16
    infer_steps20
    negative_prompt
    seed-1
    guidance_scale5.00
    flow_shift-1.00
    fp8false
    fp8_scaledfalse
    fp8_fastfalse
    fp8_t5false
    blocks_to_swap0
    attn_modetorch
    vae_cache_cpufalse
    image_path
    end_image_path
    video_path
    clip
    control_path
    lora_weight
    lora_multiplier1.00
    cfg_skip_modenone
    cfg_apply_ratio1.00
    trim_tail_frames0
    output_typevideo
    cpu_noisefalse
    musubi_tuner_path
    working_directory
    environment_json{}
    timeout3600
    show_progresstrue

    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_path pointing at the musubi-tuner repo root - the code insists on src/musubi_tuner existing, and on a venv, .venv, or env directory with a Python binary inside. That venv's Python is what actually runs the generation.
    • Video sizes are enforced per task. t2v-14B only 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 a clip path; *-FC (Fun Control) tasks require control_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 + clip for i2v, plus end_image_path for first/last-frame (flf2v).
    • lora_weight (comma-separated paths) with lora_multiplier - the reason most people install this.
    • The memory knobs: fp8, fp8_scaled, fp8_fast, fp8_t5, and blocks_to_swap (0–39) for offloading transformer blocks to RAM. attn_mode picks torch, sdpa, xformers, sageattn, flash/flash2/flash3.
    • output_type (video, images, latent, both, latent_images) and cfg_skip_mode for 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_path at the repo root, not src/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 with show_progress on, 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.

    CategoryMusubiTuner/Wan2.1

    Inputs (38)

    NameTypeDefaultDescription
    taskCOMBOt2v-14B8 options: t2v-1.3B, t2v-14B, i2v-14B, t2i-14B, flf2v-14B, t2v-1.3B-FC, +2
    promptSTRING
    ditSTRING
    vaeSTRING
    t5STRING
    video_size_widthINT832256–2048
    video_size_heightINT480256–2048
    video_lengthINT811–200
    fpsINT161–60
    infer_stepsINT201–100
    negative_promptoptSTRING
    seedoptINT-1
    guidance_scaleoptFLOAT5.000–20
    flow_shiftoptFLOAT-1.00
    fp8optBOOLEANfalse
    fp8_scaledoptBOOLEANfalse
    fp8_fastoptBOOLEANfalse
    fp8_t5optBOOLEANfalse
    blocks_to_swapoptINT00–39
    attn_modeoptCOMBOtorch7 options: torch, sdpa, xformers, sageattn, flash, flash2, +1
    vae_cache_cpuoptBOOLEANfalse
    image_pathoptSTRING
    end_image_pathoptSTRING
    video_pathoptSTRING
    clipoptSTRING
    control_pathoptSTRING
    lora_weightoptSTRING
    lora_multiplieroptFLOAT1.00
    cfg_skip_modeoptCOMBOnone6 options: none, early, late, middle, early_late, alternate
    cfg_apply_ratiooptFLOAT1.000–1
    trim_tail_framesoptINT0
    output_typeoptCOMBOvideo5 options: video, images, latent, both, latent_images
    cpu_noiseoptBOOLEANfalse
    musubi_tuner_pathoptSTRING
    working_directoryoptSTRING
    environment_jsonoptSTRING{}
    timeoutoptINT36001–86400
    show_progressoptBOOLEANtrue

    Outputs (3)

    NameTypeDescription
    stdoutSTRING
    stderrSTRING
    return_codeINT