Nodes/ComfyUI Easy Civitai (XTNodes)/Prompt Concatenate(XTNodes)
ComfyUI Node

Prompt Concatenate(XTNodes)

Merge up to five prompt pieces into one clean string

By X-T-E-R·Created 2 years ago·Updated 2 years ago· 50
Prompt Concatenate(XTNodes)
  • prompt_A
  • prompt_B
  • prompt_C
  • prompt_D
  • prompt_E
  • result
remove_duplicatestrue
whitespace_stylekeep

Clean Prompt's sibling, and arguably the more useful one of the pair once you're actually building a workflow: it takes up to five separate prompt pieces - trigger words from three different LoRAs, a manually written subject line, a style tag list - and merges them into one clean, deduped string in a single node, instead of you chaining string-concatenate nodes four deep.

How it works

Five optional inputs, all typed as ComfyUI's wildcard type (*), so any of them can be a plain STRING or a LIST like the civitai_trigger_words output this pack's loaders produce - mix and match freely, connect only the ones you're using. Internally it converts whatever's connected to a string (joining a list with commas first), joins all five with , , and then runs the exact same cleanup Clean Prompt does: split on commas, strip whitespace, drop empty entries, and - since remove_duplicates defaults to true - collapse anything that repeats once it's stripped down to letters, digits, spaces and underscores. whitespace_style then optionally forces every surviving tag to use spaces or underscores consistently, which matters if you're merging Civitai's space-style trigger words with hand-typed underscore tags.

This is genuinely the point of the two Civitai-lookup outputs this pack's loaders all carry: wire three loaders' civitai_trigger_words straight into prompt_A, prompt_B, prompt_C here, and you get one clean prompt fragment with the duplicates already gone, instead of hand-copying trigger words off three separate Civitai pages.

The inputs and outputs that matter

  • prompt_A through prompt_E (all optional, wildcard type) - leave any unconnected and it's simply skipped, not treated as an error.
  • remove_duplicates (BOOLEAN, default true).
  • whitespace_style (enum: keep / space / underscore, default keep).

Output is one result STRING, ready for a CLIP Text Encode node or further concatenation.

How to install it

ComfyUI Manager, search "ComfyUI Easy Civitai (XTNodes)", or clone plus pip install -r requirements.txt, then restart. Like Clean Prompt, this node has no dependency on the pack's Civitai machinery at all - it's pure string handling, no blake3, no network call, nothing that can fail beyond Python itself.

Common issues & troubleshooting

That independence is exactly why this is one of two nodes that keeps showing up even when this pack's loaders silently don't - a real, reported situation (two open GitHub issues, one asking outright if the project's abandoned) where installing the pack leaves you with only Clean Prompt and this node, because the loader files depend on five pip packages (blake3, dynaconf, pydantic, codetiming, sanitize_filename) and this pack's __init__.py discards any import failure among them without printing a word. If you installed expecting the checkpoint and LoRA loaders too, that silent gap is almost certainly why - re-run pip install -r requirements.txt inside ComfyUI's actual Python environment and read what it says.

As for this node's own behavior: the one easy mistake is expecting it to add anything between entries beyond a comma and a space - if you need a prompt built from full sentences rather than a tag list, the comma-split cleanup will mangle it, since it treats every comma as a hard tag boundary. It's built for the LoRA-trigger-word, comma-separated-tags style of prompting, not prose.

CategoryXTNodes/prompt

Inputs (7)

NameTypeDefaultDescription
remove_duplicatesBOOLEANtrue
whitespace_styleCOMBOkeep3 options: keep, space, underscore
prompt_Aopt*
prompt_Bopt*
prompt_Copt*
prompt_Dopt*
prompt_Eopt*

Outputs (1)

NameTypeDescription
resultSTRING