ComfyUI Node

Simple Batch Prompts

The node that made batch prompting real

By tusharbhuttΒ·Created 3 years agoΒ·Updated about a year agoΒ· 68
Simple Batch Prompts
  • clip
  • CONDITIONING
  • PROMPT_LIST
  • PROMPT_COUNT
β—„promptsbeautiful landscape mountain sunset ocean waves field of sunflowersβ–Ί
β—„print_outputtrueβ–Ί
β—„max_batch_size0β–Ί

ComfyUI has a well-known hole: you can set a latent batch size of 8 and get eight images in one pass, but they all render the same prompt. Vary the prompt and you're stuck with queueing runs one at a time. SimpleBatchPrompts is the fix that started the whole Endless pack - the author built it because nothing else did true simultaneous multi-prompt batches, and plenty of other "batch prompt" nodes turned out to be glorified queue managers that still processed prompts sequentially.

This node is the SD1.x / SD2.x version (there's an SDXL sibling and a FLUX sibling). Type one prompt per line, and each prompt gets its own image - rendered in the same GPU pass, not serially. If you have a powerful card and a list of 8-12 variations you want to eyeball, this is the node that finally uses that VRAM properly.

How it works

Mechanically it's clean: split prompts on newlines, encode each line with your CLIP (clip.tokenize β†’ encode_from_tokens with pooled output), then torch.cat the tensors along the batch dimension. Out the other end is a single CONDITIONING object whose batch size equals your prompt count, plus the pooled outputs that SD models need for the KSampler. The README calls it "true batch" prompting because it's one sampler call over all prompts, not N separate encodes.

The max_batch_size input (default 0, max 64) is the one you should actually understand:

  • 0 - batch size = your line count. Leave it here 90% of the time.
  • less than your line count - truncates to the first N prompts.
  • more - cycles through your prompts to pad the batch out (line1, line2, line1, line2…). Handy for filling a fixed batch size without editing text.

A print_output toggle logs every prompt to the console - great for debugging, annoying after run three.

The inputs that matter

  • prompts - multiline, one prompt per line. This is the whole point of the node.
  • clip - your CLIP encoder. Wire the same CLIP you'd use for a normal positive encode.
  • max_batch_size and print_output as above.

Outputs: CONDITIONING β†’ the KSampler's positive input. PROMPT_LIST β†’ a pipe-separated (|) string of every prompt, designed to feed the Endless Image Saver so each saved image gets its own prompt baked into the filename. PROMPT_COUNT β†’ an INT you can wire into anything that needs to know how many you're running.

Wiring it into a workflow

The batch size has to line up on both sides. Set your Empty Latent Image's batch to the same number as your prompt count (or use max_batch_size to force a target), then:

CLIP β†’ SimpleBatchPrompts.prompts(clip) β†’ CONDITIONING β†’ KSampler.positive
      SimpleBatchPrompts.CONDITIONING β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
EmptyLatentImage (batch=N) β†’ LATENT β†’ KSampler.latent

Save with the Endless Image Saver and hook PROMPT_LIST into its prompt_list input to get per-image filenames.

Installing it

It's part of the Endless 🌊✨ Nodes pack. ComfyUI Manager β†’ search "Endless" β†’ install β†’ restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/tusharbhutt/Endless-Nodes
# restart ComfyUI

No extra dependencies for this node - the pack's declared requirements are empty and it only uses torch/PIL that ComfyUI already ships. No model files to download.

Common issues

  • "No valid prompts found" - you need at least one non-blank line. A trailing blank line is fine; an empty node is not.
  • One prompt fails to encode - the node catches it and substitutes an empty prompt rather than killing the batch, so you'll see a console warning and a possibly-blank image. Check print_output for which line died.
  • Sampler batch mismatch - if the latent batch size doesn't match the conditioning batch size, the sampler errors. Keep them in sync via max_batch_size or the latent node.
  • Know what you're installing - this is a hobby pack, one maintainer, written with AI assistance, and it had a full rewrite in June 2025. The batch nodes are the most-used, most-tested part of it, so the risk is low - but check the repo's recent activity before building a production workflow on it.
CategoryEndless 🌊✨/BatchProcessing

Inputs (4)

NameTypeDefaultDescription
promptsSTRINGbeautiful landscape mountain sunset ocean waves field of sunflowersβ€”
clipCLIPβ€”
print_outputBOOLEANtrueβ€”
max_batch_sizeINT00–64β€”

Outputs (3)

NameTypeDescription
CONDITIONINGCONDITIONINGβ€”
PROMPT_LISTSTRINGβ€”
PROMPT_COUNTINTβ€”