SkipLayerGuidanceDiT (Ray)
Get Composition Back Without the Double-Pass Cost
- ray_actors
- ray_actors
Modern DiT models - Flux, Hunyuan, Qwen, Chroma - run at CFG 1, which means the second-pass tricks that used to rescue composition are gone. SkipLayer Guidance (SLG) is the comeback: instead of an unconditional pass, it runs a pass with selected transformer layers skipped, creating a "perturbed" version that's structurally worse, then extrapolates away from it. The result is stronger prompt adherence and composition on models that can't do classic CFG. RaySkipLayerGuidanceDiT is the full version of the Raylight port.
The knobs, in order of how much they'll matter to you:
double_layersandsingle_layers- which blocks to skip. Both default to7, 8, 9, which is the community-proven set for Flux-class DiTs (it's what the original SLG tooling converged on). DiT blocks come in "double" (attn+MLP) and "single" (fused) flavors; the node parses comma-separated integers, so7, 8, 9means layers 7, 8, and 9. Leave these alone unless you know what you're doing.scale(default 3.0) - how hard to push away from the skipped result. This is your main quality lever.start_percent/end_percent(defaults 0.01 / 0.15) - the denoising window where SLG is active. Defaults say "early only," which is deliberate: the skip-layer signal is strongest while composition is being decided, and turning it off later avoids fighting the detail phase.rescaling_scale(default 0.0) - renormalizes the SLG result's magnitude against the clean prediction. 0 = off; nudge toward 1 if your SLG output drifts in contrast or brightness.
Mechanically it's a post-CFG patch: it takes the clean denoised result, runs a perturbed pass with the chosen blocks short-circuited, and adds (clean - perturbed) * scale - but only inside the sigma window, so outside it the model runs untouched.
Where it fits
Any Raylight DiT workflow (Flux, Hunyuan, Qwen-Image are the pack's covered names) where you want prompt adherence back on a CFG-1 model. One ray_actors-in/ray_actors-out patch after Ray Init Actor. On single GPU, the original SkipLayerGuidance nodes do the same job without Ray; this port exists for the workers.
Install
Part of raylight:
cd ComfyUI/custom_nodes
git clone https://github.com/komikndr/raylight
cd raylight
pip install -r requirements.txt
Restart, or install "raylight" via ComfyUI Manager.
Gotchas
The window defaults (0.01–0.15) are small on purpose - SLG is an early-generation tool. If you extend end_percent to 1.0 expecting "more SLG," you'll likely get artifacts in the detail phase instead of adherence. And the two block lists are parsed separately; empty both and the node short-circuits and returns the model untouched, which is a clean way to A/B test whether SLG is even helping before you tune it.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| ray_actors | RAY_ACTORS | — | |
| 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 |
|---|---|---|
| ray_actors | RAY_ACTORS | — |