SkipLayerGuidanceDiT
Sharper detail without raising CFG
- model
- MODEL
Some images come back technically correct and structurally mushy - the composition is there, the colors are right, but fine detail and contrast never firm up, and raising CFG only buys you burn. SkipLayerGuidanceDiT is the node that attacks that directly: it enhances guidance toward detailed structure by running an extra pass where selected transformer layers are skipped, then uses the difference as a detail boost. It's the generic version of skip-layer guidance (SLG) that works on any diffusion transformer - Flux, Wan, SD3, AuraFlow - and it's been in ComfyUI core since July 2025.
The idea comes from Perturbed Attention Guidance (arXiv 2403.17377), which showed that running the network with attention perturbed and subtracting gives you a cheap structural-detail signal. SLG does the same thing but cruder and more effective in practice: skip whole blocks instead of perturbing attention. The original experimental implementation for SD3 was by Dango233@StabilityAI, and ComfyUI generalized it to every DiT.
How it works
During the sigma window you choose (default the very early steps, 1%–15%), the node runs the model a second time with your chosen double and single blocks patched out to a no-op skip. That produces a lower-detail prediction, slg. It then adds the gap back on top of the normal CFG result:
cfg_result = cfg_result + (cond_pred - slg) * scale
You're essentially telling the sampler "the layers I removed would have added this much structure" and re-adding it with force. The optional rescaling_scale renormalizes the result's standard deviation so the boost doesn't blow out contrast.
Inputs and what to set
model- the MODEL to patch.double_layers/single_layers- comma-separated block indices, both default to7, 8, 9. On Flux-style DiTs, 7–9 are the late double blocks where high-level detail settles; on Wan and SD3 you tune these to the model's actual block count. Layers beyond what the model has are ignored, not errors.scale- default 3.0. How hard the detail signal is applied. 2–4 is the working range; 10 is the max and will look overcooked.start_percent/end_percent- default 0.01 / 0.15. When the extra pass runs. Early steps are where structure forms, so the short default window keeps the cost down.rescaling_scale- default 0 (off). Set ~0.6–0.8 if the boost leaves contrast too hot.
Output is the patched MODEL. Ships with ComfyUI core.
Common issues & troubleshooting
It's expensive. During the window, every step runs the model twice. With the default 0.01–0.15 window that's manageable, but if you extend end_percent toward 1.0 you're paying double for the whole generation.
Works on native Wan workflows - the community's SLG-vs-Teacache confusion applies to the Wan-specific wrapper node, not this one; SkipLayerGuidanceDiT slots into stock ComfyUI Wan workflows directly.
On distilled CFG-1 models, pair it with real guidance. The extra pass runs off the conditional prediction, so it still fires - but the effect is calibrated for models that already run a cond/uncond split. On Turbo models keep the scale low and the window short.
Experimental flag, defaults that lie. Every SLG variant is is_experimental, and the defaults are tuned for Flux-style 24-block DiTs. On a smaller model, 7, 8, 9 may not exist - check your architecture before blaming the node.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| double_layers | STRING | 7, 8, 9 | — |
| single_layers | STRING | 7, 8, 9 | — |
| scale | FLOAT | 3.00–10 | — |
| start_percent | FLOAT | 0.0100–1 | — |
| end_percent | FLOAT | 0.1500–1 | — |
| rescaling_scale | FLOAT | 0.000–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |