ComfyUI Node Runs on cloud

HunyuanVideo SLG

A cheaper way to get CFG's benefit on part of the network

By kijai·Created 2 years ago·Updated 12 months ago· 2,595
HunyuanVideo SLG
    • slg_args
    double_blocks
    single_blocks20
    start_percent0.40
    end_percent0.80

    Skip Layer Guidance is a technique that first showed up in Stability's SD3.5 work: instead of running the full unconditional (negative) pass through every transformer layer, you skip it on a chosen subset of layers and run it normally on the rest. The idea is that some layers contribute little to the unconditional signal's usefulness anyway, so skipping the unconditional computation there saves compute while keeping most of guidance's actual benefit. This node's own description puts it plainly: it "skips uncond on the selected blocks."

    It's a settings node - wire its output into HyVideoSampler's optional slg_args input.

    The inputs that matter

    • double_blocks - a comma-separated string of block indices to skip on (default empty, meaning none). HunyuanVideo's double-stream blocks max out at 20 (the same block count you'll see referenced in HyVideoBlockSwap), so valid indices run from 0 up to that range.
    • single_blocks - same idea, default "20", meaning index 20 is skipped by default. Single-stream blocks go up to 40.
    • start_percent (default 0.4) / end_percent (default 0.8) - the tooltips describe these as the start and end percent of "the SLG signal." Unlike most of this pack's percent ranges which default to the full 0-1 schedule, SLG defaults to the middle 40% of the run - not the earliest steps (structure formation) and not the last (fine detail refinement), but the middle stretch where this technique's tradeoff is presumably most favorable.

    Output: slg_args.

    How to install it

    Ships with the pack - no separate download for the node.

    • ComfyUI Manager - search ComfyUI-HunyuanVideoWrapper, install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-HunyuanVideoWrapper, then pip install -r ComfyUI-HunyuanVideoWrapper/requirements.txt, restart.

    No model files for this node - pure sampling-time behavior on top of a model you've already loaded.

    Common issues & troubleshooting

    No visible effect after connecting it. Check slg_args is wired into HyVideoSampler, and that your block index strings aren't empty when you actually want the effect active - double_blocks defaults to an empty string, which does nothing until you fill in indices.

    Errors or apparent no-op from an out-of-range block index. Double blocks run 0 to 19 (20 total, matching the count HyVideoBlockSwap references), single blocks 0 to 39. An index past that range for whichever block type you're targeting isn't valid.

    Motion or detail looks noticeably different, and you're not sure if that's good. This is fundamentally a guidance-shaping technique, similar in spirit to FreSca and the sampler's own CFG controls - it's worth comparing a generation with and without it on the same seed before committing to it in a workflow, rather than assuming it's a strict improvement. The default start_percent/end_percent window (0.4 to 0.8) is a reasonable starting point to leave alone while you evaluate whether the block indices you've chosen help your specific output.

    CategoryHunyuanVideoWrapper

    Inputs (4)

    NameTypeDefaultDescription
    double_blocksSTRINGBlocks to skip uncond on, separated by comma, index starts from 0
    single_blocksSTRING20Blocks to skip uncond on, separated by comma, index starts from 0
    start_percentFLOAT0.400–1Start percent of SLG signal
    end_percentFLOAT0.800–1End percent of SLG signal

    Outputs (1)

    NameTypeDescription
    slg_argsSLGARGS