Nodes/ComfyUI-0246/Junction Batch
ComfyUI Node

Junction Batch

Junction crossed with ComfyUI batching

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

Junction Batch is exactly what it sounds like: the pack's Junction node, but with ComfyUI's batch/list semantics bolted on. The author's own one-liner for it is "if Junction and ComfyUI batching have a kid." Regular Junction treats every value as a single item in a queue; Junction Batch treats whole lists as the items, and gives you a _mode switch to choose what that means.

What the two modes do

  • pluck - behaves like a plain Junction: it gathers your batch inputs and reads one position at a time. Use this when you want to reach into a batch and pull a single item out by type + index.
  • batch - flips it into true batch mode: inputs are aggregated into lists and outputs are lists. This is the mode for feeding a downstream node a whole stack of things at once.

There's a quirk worth knowing about batch mode, straight from the docs: if the same output type appears multiple times, the first same-type pin gets [11, 22, 33] and the next one gets [22, 33, 11] - the lists rotate. It's a deliberate rotation so repeated-type outputs don't all see identical data, but it can absolutely surprise you the first time you hit it. If you're seeing data in unexpected order, that's this, not a bug.

One more honesty note from the author: Junction Batch can aggregate batch inputs, but it deliberately does not try to do something like Latent From Batch - because latent batches are torch tensors internally, not lists, and this node doesn't pretend otherwise. Feed it lists, and it works with lists.

The inputs and outputs

  • _offset - same offset syntax as Junction: type,1, type,+2, type,-2, multiple ;-separated.
  • _mode - pluck or batch, above.
  • _junc_in (optional) - a JUNCTION_PIPE to extend from.
  • _junc_out - the JUNCTION_PIPE, plus dynamic output pins per type.

The demo workflow lives in the pack's assets/workflow_junction_batch.json if you want the author's own example of both modes side by side.

How to install it

The usual:

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

restart (or ComfyUI Manager → search "ComfyUI-0246"). No models; dependencies are wrapt, natsort, wat-inspector.

Common issues & troubleshooting

Outputs are lists when you expected single values (or vice versa). Check _mode. pluck = single items, batch = lists. The node swaps its OUTPUT_IS_LIST flag per mode, so the symptom tracks the enum directly.

Same-type pins show rotated data. As above - [11, 22, 33] then [22, 33, 11] is the documented behavior in batch mode. If you need identical data on both, that's a job for a Highway (named lanes), not a Junction.

Offset errors out of range. Same fix as Junction: count your packed items per type before writing offsets. The underlying exception is the pack's way of telling you the queue position doesn't exist.

Category0246

Inputs (3)

NameTypeDefaultDescription
_offsetSTRING;
_modeCOMBO2 options: pluck, batch
_junc_inoptJUNCTION_PIPE

Outputs (1)

NameTypeDescription
_junc_outJUNCTION_PIPE