Nodes/GENKAI Nodes/Prompt Merge (genkai)
ComfyUI Node

Prompt Merge (genkai)

The separator field is the whole trick

By GENKAIx·Created about a month ago·Updated a day ago· 9
Prompt Merge (genkai)
  • prompts
  • STRING
◄rows_json{}►
◄separator,►

Prompt Merge is the second half of this pack's text pair: it takes the collection from Prompt Bank, gives each entry a name and an on/off switch, and joins the enabled ones into one string you can wire into anything.

If you've used a prompt-combiner before, you know the two things that decide whether you keep it: does the toggle state survive you deleting a row, and can you control the separator exactly. This one is good at both.

How it works

Two inputs matter. prompts (optional, type GENKAI_PROMPTS) is the bank's collection. separator is a plain text field, and it is literal - the default is exactly , with no space after it.

The join is deliberately dumb in the way you want: it walks the bank in order, keeps entries whose row is enabled and whose text isn't blank, and glues them together with your separator. Nothing else is added - no leading comma, no trailing whitespace, no cleverness.

rows_json is the third input and the one you ignore: it's the JSON the frontend writes to hold each row's label and switch state, keyed by prompt id. Because it's keyed by id rather than by position, removing one prompt doesn't shuffle everyone else's names and toggles around. Row labels are labels - they never appear in the output text.

The node is also an output node, which in practice means it keeps an OUTPUT PREVIEW panel alive in the UI that updates as you edit. That preview is the reason you don't need a separate "show text" node in the pair; it shows the finished prompt before you run anything.

The separator, which is a prompt-engineering decision

This is the part worth thinking about rather than clicking past.

On the SDXL-lineage tag models, the convention is , - comma and a space. Feed them tag1,tag2 and you're off-distribution in a small way that shows up as slightly mushier adherence; the corpus advice on tag structure (commas, spaces after commas, no underscores, block structure with blank lines for distinct sections) exists because these models were trained on that format.

On natural-language and LLM-encoder models, commas between clauses fight the model - it wants sentences or short paragraphs, so a real line break or a period-space is often the better separator. And if you want run-on concatenation, an empty separator is legal and does precisely that: no characters between prompts.

Point being: there's no correct default, which is why the field is exposed instead of baked in. Set it to , on the first run of a tag workflow, and stop wondering why your bank output reads masterpiece,cinematic in the preview.

Inputs and outputs at a glance

  • prompts - the bank collection. Optional; with nothing connected, the output is just an empty string.
  • separator - literal text, line breaks allowed, empty allowed.
  • STRING - the joined result. This is an ordinary string, so it feeds CLIP Text Encode, a text-file saver, an LLM node, anything. This is the output you wire, not the bank's.

How to install it

cd ComfyUI/custom_nodes
git clone https://github.com/GENKAIx/Genkai-ComfyUI-Nodes

ComfyUI Manager → Genkai-ComfyUI-Nodes, restart, Ctrl+F5. Find both text nodes under GENKAI → Text. No models, no dependencies.

Common issues

"masterpiece,cinematic lighting,8k" - where's the space? That's the default doing what it says. Set the separator to , .

Only some prompts came through. Rows that are switched off are skipped, and so is any row whose text is blank or whitespace-only. Check both before you go hunting for a bug.

Nothing on the output at all. Either the bank is empty, the bank's output isn't connected, or every row is off. Unconnected prompts is legal and produces an empty string rather than an error, so this one is silent by design.

New rows in the bank don't show their old name. They will after a reload - labels travel with the collection, and the Merge node rebuilds its row list from what arrives on the wire. Adding a prompt to the bank and expecting Merge to know its name before a run is the classic small confusion here.

CategoryGENKAI/Text

Inputs (3)

NameTypeDefaultDescription
rows_jsonSTRING{}—
separatorSTRING,—
promptsoptGENKAI_PROMPTS—

Outputs (1)

NameTypeDescription
STRINGSTRING—