Nodes/comfyui-multiprompt-batch/Conditioning Batch Stack
ComfyUI Node

Conditioning Batch Stack

The batch aligner

By JousiaPiha·Created 2 months ago·Updated 2 months ago· 0
Conditioning Batch Stack
  • conditioning_1
  • conditioning_2
  • conditioning_3
  • conditioning_4
  • conditioning_5
  • conditioning_6
  • conditioning_7
  • conditioning_8
  • conditioning_9
  • CONDITIONING

You've already built the workflow. Five CLIP Text Encode nodes, each holding a prompt you tuned by hand, all pointing at one KSampler. The problem is ComfyUI's sampler wants a single conditioning object whose batch dimension matches the latent - and yours are five separate wires. This node is the glue: it stacks 2–9 simple conditioning inputs into one batch-aligned CONDITIONING, so latent batch item 1 draws from input 1, item 2 from input 2, and so on, all in a single sampler execution.

That "batch-aligned" bit is the whole point. This is the compose-side sibling of the pack's Multi Prompt Text Encode: that node encodes lines of text for you, this one takes conditioning you've already encoded and stacks it. Reach for it when each prompt deserves its own encode node - you're reusing an existing graph, you want per-prompt CLIP weights, or you're proving that a given sampler can handle batched conditioning at all. The README's example is exactly that: CLIPTextEncode("a red sports car") and CLIPTextEncode("a blue medieval castle") into the stack, then into KSampler positive.

How it works

Read the source and it's refreshingly honest about its scope. Each input is validated as exactly one simple [tensor, metadata] conditioning entry - the kind a bare CLIP Text Encode produces. The tensors get concatenated along the batch dimension, and the sequence dimension is padded up to the longest prompt in the group. That padding matters for models like Krea 2 whose conditioning tensor is shaped (B, seq, 12*2560): prompts of different lengths still stack cleanly, with the attention_mask metadata padded so those zero-padded tokens are masked off instead of fed to the model. Non-tensor metadata (like pooled_output at batch 1) has to be identical across prompts, or it throws rather than guess.

Deliberately, it rejects the complicated stuff. Feed it a conditioning that carries masks, ControlNet, GLIGEN, hooks, regional/area metadata, or scheduled timesteps and it errors with a message telling you to add those later in the workflow - after the core prompt batch is working. That's a feature, not a bug: the first version aims to be predictable, not universal.

Inputs and outputs

Only two inputs are required - conditioning_1 and conditioning_2 - with conditioning_3 through conditioning_9 optional. Each must be a single text conditioning, so wire a CLIP Text Encode (or the Multi Prompt Text Encode sibling) straight in, not a ConditioningCombine output. The output is one CONDITIONING whose batch size is the sum of the inputs (normally 1 each, so 5 prompts → batch 5).

Set EmptyLatentImage.batch_size to the number of prompts, and both positive and negative flow into KSampler as usual. A shared negative stays at batch 1 and broadcasts through the sampler's conditioning path.

Install and gotchas

Install is the standard two ways - ComfyUI Manager (search "multi prompt batch") or:

cd ComfyUI/custom_nodes
git clone https://github.com/JousiaPiha/comfyui-multiprompt-batch

Restart ComfyUI and the nodes land under conditioning/multi prompt batch. The pack has zero dependencies beyond the torch ComfyUI already ships - no requirements.txt, no model downloads, nothing to babysit.

The failure mode you'll actually hit is the "must contain exactly one conditioning entry" ValueError, which almost always means you fed it regional or combined conditioning. The other classic is a sampler shape error, and that's on the latent side: latent["samples"].shape[0] must equal the stacked conditioning's batch size. Count your prompts, set the batch size to match, and you're done. It's a small, honest utility - no magic, but it does exactly the thing the UI makes awkward.

Categoryconditioning/multi prompt batch

Inputs (9)

NameTypeDefaultDescription
conditioning_1CONDITIONING
conditioning_2CONDITIONING
conditioning_3optCONDITIONING
conditioning_4optCONDITIONING
conditioning_5optCONDITIONING
conditioning_6optCONDITIONING
conditioning_7optCONDITIONING
conditioning_8optCONDITIONING
conditioning_9optCONDITIONING

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING