Nodes/ComfyUI_Wan2_1_lora_trainer/Musubi Sampling Settings (Wan)
ComfyUI Node

Musubi Sampling Settings (Wan)

Sample images mid-training with Musubi Sampling Settings

By jaimitoes·Created about a year ago·Updated about a year ago· 61
Musubi Sampling Settings (Wan)
    • sampling_settings
    sample_every_n_steps0
    sample_every_n_epochs0
    sample_at_firsttrue
    vae_name
    t5_name
    clip_nameNone
    prompts_texta beautiful sunset over mountains

    Training a LoRA blind is a bad time. You set it running, come back eight hours later, and the final checkpoint is either overfit mush or a face that looks nothing like your subject. The fix - and the entire job of MusubiSamplingSettings - is to generate preview samples during training, at set intervals, so you can watch the LoRA converge in near-real-time. This is the pack's "sampler" node, added in version 1.1.0 of jaimitoes/ComfyUI_Wan2_1_lora_trainer, and it's the difference between flying a training run and hoping.

    It's an optional node in every sense: the README explicitly says that if you don't need to see progress, bypass it entirely. But for character work especially, where likeness is the whole point, the ability to checkpoint the intermediate states is worth the VRAM it costs.

    How it works

    It's a settings producer - a DICT factory like the pack's other two settings nodes. You fill in a prompt and an interval, and it builds the arguments that the trainer subprocess needs: a temp prompt file (written into ComfyUI's temp directory from your prompts_text box) plus the --sample_every_n_steps, --sample_every_n_epochs, and --sample_at_first flags. The output sampling_settings DICT plugs into the WanLoRATrainer node's optional sampling_settings input. Samples land in the sample folder inside your LoRA output directory, as .png for stills and .mp4 for video, matching musubi-tuner's own sampling behavior.

    The inputs that matter

    • prompts_text - the multiline box where you write what to generate. It's not just a prompt, it's a prompt file: you can set dimensions inline with --w and --h, e.g. a cat making surf --w 832 --h 480. If you leave this empty, the node bails and produces no settings - no sample run happens.
    • sample_every_n_steps / sample_every_n_epochs - the cadence. Both default to 0, which means "off." Pick one; step-based is the more predictable of the two.
    • sample_at_first - on by default, so you get a baseline sample at step zero to compare later ones against.
    • vae_name and t5_name - must be the same VAE and T5 you used during caching. Mixing them here is how you get preview images that look nothing like what training is actually doing.
    • clip_name - None unless you're training I2V, then the same clip vision you cached with. Same rule as every other node in this pack.

    Output

    One output, one wire: sampling_settings (DICT) → the trainer's sampling_settings input. If no prompt is given it returns an empty dict, which the trainer silently ignores.

    Install

    This node ships inside the pack, so:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jaimitoes/ComfyUI_Wan2_1_lora_trainer
    ..\..\..\python_embeded\python -m pip install -r requirements.txt
    

    restart ComfyUI, and run it from the README's custom .bat (Visual Studio Build Tools loaded via vcvarsall.bat) with Include_and_libs.zip extracted into python_embeded.

    Where people get burned

    Sampling during training eats VRAM - musubi's own docs warn it's "considerable," especially for long video samples - and it slows the run. If your training is already near the VRAM ceiling, or you just want maximum throughput overnight, leave this node bypassed and check the final checkpoints. The default prompt is a beach sunset; change it to something that actually stress-tests your subject, or every preview will look great while your real prompt does nothing. That's the silent trap here: previews that lie because they're not testing what you're training.

    Categorymusubi-tuner/wan/settings

    Inputs (7)

    NameTypeDefaultDescription
    sample_every_n_stepsINT0Generate a sample every n steps.
    sample_every_n_epochsINT0Generate a sample every n epoch.
    sample_at_firstBOOLEANtrueGenera a sample at the starting training.
    vae_nameCOMBOThe same vae used to caching
    t5_nameCOMBOThe same T5 used to caching
    clip_nameCOMBONoneIf I2V, the same clip vision used for caching
    prompts_textSTRINGa beautiful sunset over mountainsWrite a prompt. You can specify width and height by using --w --h. Example : a cat making surf --w 832 --h 480

    Outputs (1)

    NameTypeDescription
    sampling_settingsDICT