Nodes/KJNodes for ComfyUI/Skip Layer Guidance WanVideo
ComfyUI Node Runs on cloud

Skip Layer Guidance WanVideo

The SLG quality trick tuned for Wan

By kijai·Created 3 years ago·Updated about 7 hours ago· 2,930
Skip Layer Guidance WanVideo
  • model
  • MODEL
blocks10
start_percent0.200
end_percent1.000

Skip Layer Guidance (SLG) is one of those "free quality" toggles that floats around the Wan threads - it can clean up motion and detail without costing you speed or a model swap. This is kijai's Wan-specific take on it. Its own description is precise about what it does: "Simplified skip layer guidance that only skips the uncond on selected blocks." If that sentence means nothing yet, here's the unpack.

How it works

A diffusion transformer is a stack of blocks, and CFG runs two passes each step - one conditioned on your prompt, one unconditional (uncond). SLG deliberately skips a specific block during the unconditional pass. Removing a block from the uncond changes the guidance direction the model gets pushed along, and on Wan the empirical result is often better structure and motion - the model leans harder toward the conditioned output on the axes that block was muddying. It's a nudge to the guidance math, not new weights and not extra compute worth mentioning.

The catch is that it's fiddly and model-specific: which block you skip and when matters, and the good values were found by community trial-and-error, not derived. Block 9 or 10 is the usual Wan sweet spot, which is why the node defaults there. Treat it as a tuning knob you A/B test, not a guaranteed win - sometimes it helps, sometimes it does nothing, occasionally it hurts.

The inputs and output

It's a model patch: MODEL in, patched MODEL out, dropped before your sampler.

  • blocks (default "10") - which transformer block(s) to skip in the uncond, as a string. The default single block is the community-standard starting point; you can try a different index or list, but this is the setting most worth experimenting with.
  • start_percent (default 0.2) / end_percent (default 1) - the slice of the denoising schedule over which the skip is active. It starts a fifth of the way in by default rather than at step 0, because the earliest steps set up global structure and you generally don't want to perturb the guidance there.

The output is the patched MODEL.

How to install it

It's in kijai's KJNodes pack. (Worth knowing: kijai also wrote ComfyUI-WanVideoWrapper, the main third-party Wan wrapper, so his nodes and Wan go together closely - but this SLG node lives in KJNodes and works on the native Wan path.)

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

No downloads or dependencies.

Common issues & troubleshooting

No visible difference. SLG is a subtle effect and its impact depends heavily on the block and the model variant. A/B it - render the same seed with and without, and with a couple different blocks values - rather than assuming it's on and working. If nothing changes, it may just not be doing much for your setup.

Quality got worse. Skipping the wrong block can degrade output. Go back to the default block, or try the neighbours (9, 10). This is a knob you tune, and the wrong value is a real outcome, not a broken node.

It's for Wan. The node is tuned for Wan's block structure - the block indices that work here don't transfer to other architectures. For non-Wan models, use the guidance tricks meant for those.

Running at CFG 1. SLG works on the unconditional pass, and at CFG 1 there effectively isn't a meaningful uncond to skip within. It's a CFG-above-1 tool - pair it with a normal-CFG Wan setup, not a fully distilled CFG-1 one.

Categoryadvanced/guidance

Inputs (4)

NameTypeDefaultDescription
modelMODEL
blocksSTRING10
start_percentFLOAT0.2000–1
end_percentFLOAT1.0000–1

Outputs (1)

NameTypeDescription
MODELMODEL