Nodes/AK Pack/AK CLIP Encode Multiple
ComfyUI Node

AK CLIP Encode Multiple

Encode a whole list of prompts in one pass, skip the repeats

By akawana·Created 9 months ago·Updated 7 days ago· 2
AK CLIP Encode Multiple
  • str_list
  • clip
  • mask_list
  • combined_con
  • cond_0
  • cond_1
  • cond_2
  • cond_3
  • cond_4
  • cond_5
  • cond_6
  • cond_7
  • cond_8
  • cond_9
  • cond_10
  • cond_11
  • cond_12
  • cond_13
  • cond_14
  • cond_15
  • cond_16
  • cond_17
  • cond_18
  • cond_19
starting_index0
length1

AK CLIP Encode Multiple is the conditioning sibling of the pack's AK Index Multiple node: instead of pulling a slice out of a list of images or masks, it pulls a slice out of a list of prompt strings and CLIP-encodes each one into its own conditioning output. If you've ever built a workflow that sweeps prompts (XY-plot style, or batch testing a few variations), this is the node that stops you from stacking five separate CLIP Text Encode nodes and hand-wiring them.

The author's framing matters here: this pack was built for large, complex workflows where six to eight samplers run at once, and every wasted re-encode is time you feel. The node is honest about the caching it does. CLIP encoding isn't free - your text goes through the tokenizer and through the text encoder every time, and in a big workflow the same prompt can get encoded on every queue. This node encodes the empty (NONE) conditioning exactly once and reuses it, caches per-string encodings so unchanged prompts don't re-tokenize, and fingerprints the whole list so unchanged input skips the work entirely.

The inputs. Four required, one optional:

  • str_list - the list of strings to encode. This is a wildcard * input and it's list-mode, so the wire on it carries a list of prompts, not one prompt.
  • clip - your CLIP model, same as any text encoder.
  • starting_index - where in the list to start (default 0).
  • length - how many entries to encode (default 1, max 20).
  • mask_list (optional) - a matching list of masks, one per entry, so each conditioning can carry a region mask for inpainting or regional work.

The outputs. combined_con plus cond_0 through cond_19. The combined output concatenates every encoded conditioning in the window into a single bundle - that's the one you'll usually wire into the positive or negative input of a KSampler. The individual cond_0... outputs let you take entries out individually, e.g. to mix or reorder before sampling. Unused outputs just stay empty; you can leave them dangling.

How to install. ComfyUI Manager, search "AK Pack", or:

cd ComfyUI/custom_nodes
git clone https://github.com/akawana/ComfyUI-Utils-extra

Restart ComfyUI. No extra pip packages, no models to download - this pack has zero external dependencies beyond what ComfyUI already ships.

Where people get burned. The list input trips everyone up at first. This isn't a node where you type a prompt and click encode - str_list has to actually be a list, which means a node upstream that produces one (AK Index Multiple, a text-list node, a primitive feeding a batch). If you wire a single plain string, it wraps to a list of one and only encodes that one. Also remember length is capped at 20, so a 60-prompt sweep means three nodes (or chaining windows with starting_index). And because the caching is the whole point, it only helps if the prompt text actually stays the same between runs - change every prompt every queue and you've bought nothing but a prettier graph.

CategoryAK/conditioning

Inputs (5)

NameTypeDefaultDescription
str_list*
clipCLIP
starting_indexINT0
lengthINT11–20
mask_listoptMASK

Outputs (21)

NameTypeDescription
combined_conCONDITIONING
cond_0CONDITIONING
cond_1CONDITIONING
cond_2CONDITIONING
cond_3CONDITIONING
cond_4CONDITIONING
cond_5CONDITIONING
cond_6CONDITIONING
cond_7CONDITIONING
cond_8CONDITIONING
cond_9CONDITIONING
cond_10CONDITIONING
cond_11CONDITIONING
cond_12CONDITIONING
cond_13CONDITIONING
cond_14CONDITIONING
cond_15CONDITIONING
cond_16CONDITIONING
cond_17CONDITIONING
cond_18CONDITIONING
cond_19CONDITIONING