SkipLayerGuidanceDiT_motorway_edition
Skip-layer guidance for DiT models, without the cable salad
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
This is the ComfyUI SkipLayerGuidanceDiT node wearing a Motorway costume. It patches a DiT-family model (think Flux and friends) so that during sampling the model also predicts from a version of itself with certain layers skipped, and pushes the two predictions apart - which sharpens detail and prompt adherence in a way plain CFG doesn't.
Skip-layer guidance is one of those advanced techniques that's quietly excellent and wildly underused. The idea: you take the same forward pass, but compute it twice - once normally, once with the specified layers dropped - and guide toward the difference. It tends to pull out crisp texture and structure, which is why you'll find it bolted onto Flux workflows that feel a bit soft. It's not a beginner knob, but it's real, and it's been in core ComfyUI for a while.
What to set
The model comes from the Motorway, the settings are widgets on the node:
INPUT_model_key(defaultmodel) - which key holds the MODEL to patch.double_layersandsingle_layers(both default"7, 8, 9") - comma-separated layer indices to skip in the double/single blocks of the DiT. The defaults are the standard starting point.scale(default3, 0–10) - how hard to push toward the skip-layer difference. 3 is a sane start; crank up if you want more bite.start_percent/end_percent(defaults0.01/0.15) - the denoising window where guidance is active. It fires early and shuts off, which is why it adds detail without wrecking composition.rescaling_scale(default0) - an extra rescaling factor; leave at 0 unless you know why you need it.OUTPUT_MODEL_key(defaultMODEL) - where the patched model is written.
Wire the resulting MODEL into your sampler and run. It's a model patch, so it composes fine with the rest of a custom-sampling setup.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway
Restart ComfyUI; find it under agilly1989 Nodes → Motorway-ed → advanced → guidance. ComfyUI Manager can install the pack too. No pip dependencies - the wrapper adds nothing to your environment.
Where people get burned
Same Motorway hazards as the rest of the pack. Key mismatch ('MotorwayClass' object has no attribute 'hash_') means the model key isn't in the pipe - check the key on whatever loaded your checkpoint. Keys are case-sensitive, which is the most common silent cause of "the node found nothing."
On the SLG side, the window matters more than the scale. A default end_percent of 0.15 means guidance stops after the first 15% of denoising; if you're on a low-step distilled pipeline that whole window might be over in two steps, and you'll wonder why nothing changed. And the usual caveat about this pack: it's an active beta, the author says so in the README. If an update reshuffles the auto-generated motorway-ed nodes (they've been disabled at times), that's the pack evolving, not your install rotting.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — | |
| INPUT_model_key | STRING | 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 | — |
| OUTPUT_MODEL_key | STRING | MODEL | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |