Nodes/ComfyUI_agilly1989_motorway/CLIPSetLastLayer_motorway_edition
ComfyUI Node

CLIPSetLastLayer_motorway_edition

CLIP skip, keyed in

By agilly1989·Created 2 years ago·Updated about a year ago· 7
CLIPSetLastLayer_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_clip_keyclip
stop_at_clip_layer-1
OUTPUT_CLIP_keyCLIP

This is the "CLIP skip" node, in Motorway form. CLIPSetLastLayer tells the text encoder to stop one (or more) layers early and condition on an earlier representation instead of the final one - a technique that predates ComfyUI and lives on as a convention in a lot of anime and SD 1.5-era workflows. The _motorway_edition wraps it for agilly1989's Motorway pipe: the CLIP comes out of the Motorway by key, gets its "stop at layer" setting changed, and goes back in under a key you name.

If you've seen stop_at_clip_layer = -2 in an old workflow and wondered what it was doing: it's skipping the last layer of the text encoder, which reads the prompt from a slightly more general representation. The origin is historical - NovelAI followed Imagen and conditioned on CLIP's penultimate layer back in October 2022, its weights became the ancestor of a huge chunk of the anime checkpoint tree, and every descendant through Pony and Illustrious inherits that expectation. Some models want the skip; others actively fight it.

How it works

The wrapper pulls one thing out of the Motorway and writes one back:

  • INPUT_clip_key - key for the CLIP to modify (default clip)
  • stop_at_clip_layer - an integer from −24 to −1, default −1. −1 means "use the final layer" (no skip); −2 skips the last layer; deeper negatives go further back.
  • OUTPUT_CLIP_key - where the modified CLIP goes, default CLIP

The node instantiates the real core CLIPSetLastLayer, applies the layer setting, and stores the modified CLIP under the output key. The only visible output is the MOTORWAY 🚌💨. Downstream, your text-encode node reads the CLIP key and conditions with the skipped-layer encoder.

Two reality checks. First, CLIP skip only exists where there's a CLIP to skip - the newer LLM-style encoders (Flux's T5, Qwen, the 2026 crowd) have no such knob, and this node is meaningless there. Second, the effect is model-specific and you can't predict it from first principles; it's a "try −2, A/B it against −1" knob, not a "set and forget" one. The _for_testing pedigree of some siblings doesn't apply here - this one is core and stable, just subtle.

Motorway specifics

MOTORWAY 🚌💨 is required. The defaults assume the CLIP lives under clip and you want the modified version under CLIP - different keys on purpose, so the original survives. Reuse the same key and the modified version overwrites it, since keys overwrite as they flow down the chain. A key that was never written throws the signature 'MotorwayClass' object has no attribute 'hash_' error.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway

Restart, or find "ComfyUI_agilly1989_motorway" in ComfyUI Manager. No pip dependencies, no model downloads.

Fine print

The pack is an explicitly-beta side project - README opens "BIG BROKEN WITH ASYNC WILL FIX WHEN I GET THE TIME/MOTIVATION" - and the current hotfix release has the _motorway_edition clone generation commented out of __init__.py, so on the newest main these nodes may not load at all. An old workflow referencing them and coming up with missing nodes is hitting exactly that. GitHub issues are the channel; the author has said his Discord DMs get ignored.

Categoryagilly1989 Nodes/Motorway-ed/conditioning

Inputs (4)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_clip_keySTRINGclip
stop_at_clip_layerINT-1-24–-1
OUTPUT_CLIP_keySTRINGCLIP

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨