ComfyUI Node

Junction

A typed, offset-addressed queue on one wire

By Trung0246·Created 3 years ago·Updated about a year ago· 137
Junction
  • _junc_in
  • _junc_out
_offset;

Junction is the second of ComfyUI-0246's two pipe designs, and it does the thing Highway refuses to: sequential, typed packing. Highway gives every value a name; Junction gives every value a position. You push values into a JUNCTION_PIPE one after another, and you pull them out by telling the node which slot of each type to read.

The author's own framing is the clearest one: imagine a train station where every passenger type is forced through a specific gate. Model types go through the model gate, latents through the latent gate, and so on - and the _offset widget decides which passenger in each line you actually grab. It's inspired by a suggestion from the redditor GianoBifronte, who's also the person who later called this pack's Beautify the best debug node in the ecosystem. Small pack, real fans.

Where does this earn its keep? When your data is naturally a queue rather than a set of names - say you've packed several latents and want to hand them to a consumer one at a time, or you're chaining Junctions so the same position is read consistently down a line of nodes. It's also what the pack's batching (0246.JunctionBatch) and its scripting system (ScriptNode in pin_junction mode) are built on top of.

The _offset syntax (the whole node)

The _offset string defaults to ";" (nothing). The syntax, from the pack's docs:

  • type,1 - set that type's read index to 1
  • type,+2 - increment that type's offset by 2
  • type,-2 - decrement it by 2
  • type1, -1; type2, +2; type3, 4 - multiple offsets, ;-separated

The offset is persistent: once set, it carries through linked Junctions, so a chain of Junctions all skip to the same positions. Pins auto-expand as you connect things - wire a second LATENT output and the node grows another pin.

The inputs and outputs

  • _offset - the offset string above.
  • _junc_in (optional) - a JUNCTION_PIPE from another Junction, letting you extend the queue.
  • _junc_out - the JUNCTION_PIPE plus one output pin per packed type.

Internally everything lives in a RevisionDict: data/<type>/<index> holds values, index/<type> tracks the current offset, and type/<type> records the Python type. That's also what 0246.Meta can show you if you ever want to peek inside.

How to install it

Pack standard: ComfyUI Manager → search "ComfyUI-0246", or

cd ComfyUI/custom_nodes
git clone https://github.com/Trung0246/ComfyUI-0246

restart. No models, no heavy deps.

Common issues & troubleshooting

"Offset ... is too large" / "too small" - you asked for an index that doesn't exist in the queue. Count what you packed; remember the offset is per type, and indexes start at 0.

"Type ... in offset string does not available in junction." You wrote _offset for a type that was never packed. If you're chaining Junctions, the value has to exist earlier in the chain, not just locally.

Workflow broke after a pack update. The README warns Junction's type-tracking changed between versions; the migration path is to copy the _offset string, make a fresh Junction, paste it, and reconnect. The pack has been dormant since early 2025, so treat any node based on its custom pipe internals as something you maintain deliberately - not as infrastructure that updates itself.

Category0246

Inputs (2)

NameTypeDefaultDescription
_offsetSTRING;
_junc_inoptJUNCTION_PIPE

Outputs (1)

NameTypeDescription
_junc_outJUNCTION_PIPE