Nodes/ComfyUI-JDCN/LogicUtil_Merge String
ComfyUI Node

LogicUtil_Merge String

The two-input string joiner that fixes prompt plumbing

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_Merge String
  • input1
  • input2
  • STRING

Every workflow eventually needs to stick two strings together. A base prompt plus a style suffix. A filename prefix plus a counter. A "no" plus whatever you're currently negative-prompting. LogicUtil_Merge String is that join, reduced to its minimum: input1 and input2 in, one STRING out, and the output is just str(input1) + str(input2).

How it works

The detail that matters most: there's no separator inserted between the two inputs. Merge "cat" and "girl" and you get "catgirl". If you want a space or a comma in the middle, you have to include it yourself - end input1 with a space ("cat "), start input2 with one (" girl"), or insert a separator node. Forgetting this is the number one way people get confusing concatenated prompts and blame the node.

Because both inputs are typed *, it's not even strictly for strings - anything you feed it gets str()-ed and glued, so you can merge a number into a prompt without a conversion node first. That's handy, and it's also the trap: str(1.0) gives "1.0", str(True) gives "True", so the text you get reflects Python's formatting, not necessarily what you typed. If you feed it a list, it'll print the Python list repr with brackets and quotes - almost never what you want in a prompt.

It composes well with the rest of the LogicUtil family, which is a port of aria1th's ComfyUI-LogicUtils riding inside the JDCN pack. The classic build: Manual Choice String picks a style token, Merge String concatenates it onto your base prompt, and you get clean, deterministic prompt variation without editing text between runs. The JDCN README documents the pack's file and latent batch nodes but never mentions this family, so the source is the doc: two inputs, one concatenation, no magic.

Install

Install is the standard JDCN routine: ComfyUI Manager → "Install Custom Node" → search JDCN → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/daxcay/ComfyUI-JDCN
cd ComfyUI-JDCN && pip install -r requirements.txt

Only piexif on the requirements list, no models to fetch. And the fastest debug move when your merged prompt looks wrong: check the spacing at the seam - nine times out of ten it's a missing space, not a broken node.

CategoryLogicUtil

Inputs (2)

NameTypeDefaultDescription
input1*
input2*

Outputs (1)

NameTypeDescription
STRINGSTRING