Nodes/ComfyUI-WanVideoWrapper/Create CFG Schedule Float List
ComfyUI Node Runs on cloud

Create CFG Schedule Float List

Change Wan's CFG per step, not per run

By kijai·Created about a year ago·Updated 2 months ago· 6,651
Create CFG Schedule Float List
    • float_list
    steps30
    cfg_scale_start5.00
    cfg_scale_end5.00
    interpolationlinear
    start_percent0.00
    end_percent1.00

    Normally you give Wan one CFG value and it uses it for every denoising step. This node lets you give it a different CFG for each step - a ramp, a curve, a spike early then flat later. It spits out a plain list of floats, one per step, that you feed into a sampler input expecting a CFG schedule. The node's own description spells out the useful default behavior: "outside the set range cfg is set to 1.0."

    Why would you want this? Because on Wan, CFG does its most important work early. The high-noise part of the schedule is where prompt adherence, motion, and composition get locked in, and that's where guidance matters. The later steps mostly refine detail, and there you can drop CFG toward 1.0 to save compute and avoid the over-cooked, contrasty look that high CFG can bake in. A per-step schedule lets you have both: strong guidance where it counts, cheap-and-clean where it doesn't.

    How it works

    You define a start value, an end value, an interpolation shape, and the slice of the schedule the ramp applies to. The node builds the full per-step list by interpolating between start and end across that window - and anywhere outside the window, it sets CFG to 1.0 (which on a flow-matching model effectively means "no guidance, just denoise"). Feed the resulting list into the sampler and each step reads its own CFG off the list.

    The inputs and outputs that matter

    • cfg_scale_start (default 5) and cfg_scale_end (default 5) - the two ends of the ramp. Set start high and end low for the classic "guide hard early, coast later" curve. Leave them equal for a flat schedule that only clamps CFG to 1.0 outside the active window.
    • start_percent (0) and end_percent (1) - where in the denoise the ramp is active, as a fraction. Everything before start_percent and after end_percent runs at CFG 1.0. This is the knob that decides when guidance is on.
    • interpolation (linear / ease_in / ease_out) - the shape of the ramp between start and end. Linear is the honest default; the eases just bias where the transition happens.
    • steps (default 30) - must match the step count your sampler actually runs, or the list won't line up.

    The single output, float_list, is the per-step CFG schedule. Wire it into the CFG-schedule input on your WanVideo sampler.

    How to install it

    Ships in the WanVideoWrapper. ComfyUI Manager: search ComfyUI-WanVideoWrapper, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
    pip install -r ComfyUI-WanVideoWrapper/requirements.txt
    

    then restart. No extra downloads for this one - it's pure math, it doesn't touch a model.

    Common issues & troubleshooting

    Step count mismatch. If steps here doesn't equal the sampler's steps, the schedule is stretched or truncated and you get CFG values on the wrong steps. Keep them in sync.

    You're on a speed LoRA, so this fights you. CausVid and lightx2v force CFG 1.0 across the board - that's the whole distilled deal (see the distillation notes). A CFG schedule on top of a pinned-CFG-1 setup does nothing useful. This node earns its keep on full-quality runs, where you actually have CFG headroom to shape.

    Motion got worse when you dropped CFG early. You probably clamped guidance off during the high-noise steps, which is exactly where Wan decides motion. Keep CFG up through the early percent and drop it late, not the other way around.

    CategoryWanVideoWrapper

    Inputs (6)

    NameTypeDefaultDescription
    stepsINT302–1000Number of steps to schedule cfg for
    cfg_scale_startFLOAT5.000–30CFG scale to use for the steps
    cfg_scale_endFLOAT5.000–30CFG scale to use for the steps
    interpolationCOMBOlinearInterpolation method to use for the cfg scale
    start_percentFLOAT0.000–1Start percent of the steps to apply cfg
    end_percentFLOAT1.000–1End percent of the steps to apply cfg

    Outputs (1)

    NameTypeDescription
    float_listFLOAT