Nodes/ComfyUI_agilly1989_motorway/SkipLayerGuidanceDiT_motorway_edition
ComfyUI Node

SkipLayerGuidanceDiT_motorway_edition

Skip-layer guidance for DiT models, without the cable salad

By agilly1989·Created 2 years ago·Updated about a year ago· 7
SkipLayerGuidanceDiT_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_model_keymodel
double_layers7, 8, 9
single_layers7, 8, 9
scale3.0
start_percent0.010
end_percent0.150
rescaling_scale0.00
OUTPUT_MODEL_keyMODEL

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 (default model) - which key holds the MODEL to patch.
  • double_layers and single_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 (default 3, 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 (defaults 0.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 (default 0) - an extra rescaling factor; leave at 0 unless you know why you need it.
  • OUTPUT_MODEL_key (default MODEL) - 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.

Categoryagilly1989 Nodes/Motorway-ed/advanced/guidance

Inputs (9)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_model_keySTRINGmodel
double_layersSTRING7, 8, 9
single_layersSTRING7, 8, 9
scaleFLOAT3.00–10
start_percentFLOAT0.0100–1
end_percentFLOAT0.1500–1
rescaling_scaleFLOAT0.000–10
OUTPUT_MODEL_keySTRINGMODEL

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨