PJ-动态文本拼接
Glue your prompt fragments together without a forest of text-concat nodes
- 合并文本
Real prompts are rarely typed in one box anymore. You've got a style prefix from one place, a subject from a wildcard roll, camera language from a translator node, negative fragments from another branch - and at the end you need all of it joined into a single string that feeds your text encoder. Default ComfyUI makes you chain text-concat nodes like a game of snake. PJTextCombine (pongjoo/ComfyUI-PJLatent, menu "PJ_Text") is the flat version: up to 20 text inputs, joined by one separator, one string out.
The inputs:
- 合并行数 (merge count) - how many of the text slots actually get included. That's the "dynamic" part; it's a widget, not wiring.
- 连接分隔符 (separator) - what goes between fragments. Default is
,- the comma-space that is basically the universal tag prompt convention. It also honors\nand\tescapes if you type them in, so you can build line-separated output for multiline CLIP boxes. - 文本_1 … 文本_20 - the fragments. They're
forceInputstrings, so wire anything that emits STRING: wildcard picks, yourPJ_JSON_To_Promptresult, a translated line, a hardcoded prefix.
Empty or None slots are skipped rather than turning into stray commas - so you can leave slots unwired and the output stays clean. Output is a single 合并文本 string.
Where it sits in a workflow: the classic assembly line is wildcard/LLM fragments in, joined with , , then straight into a positive CLIP text encode. It also works for negatives - same node, negative fragments, different separator if you want , without the space. Since it's pure string plumbing there's nothing heavy about it; it exists to keep your graph from turning into forty concat nodes in series.
One UI note: the node uses the pack's frontend extension to show a "更新输入端口 (Update Inputs)" button - you set 合并行数 and click it, and the node actually adds or removes the corresponding 文本_N ports instead of leaving 20 dangling inputs. If you loaded a workflow that references more text ports than the node currently shows, click that button to materialize them.
Install
It's one node inside pongjoo/ComfyUI-PJLatent (MIT, Chinese-authored pack). ComfyUI Manager → search "ComfyUI-PJLatent", or:
cd ComfyUI/custom_nodes/
git clone https://github.com/pongjoo/ComfyUI-PJLatent.git
Restart ComfyUI - no dependencies, no models. Look for PJ-动态文本拼接 under "PJ_Text".
Verdict: unglamorous and genuinely handy. Every prompt-assembly workflow eventually needs exactly this shape of node, and once you've got one that skips empties and honors a custom separator, you stop noticing it - which is the point.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| 合并行数 | INT | 31–20 | — |
| 连接分隔符 | STRING | , | — |
| 文本_1opt | STRING | — | |
| 文本_2opt | STRING | — | |
| 文本_3opt | STRING | — | |
| 文本_4opt | STRING | — | |
| 文本_5opt | STRING | — | |
| 文本_6opt | STRING | — | |
| 文本_7opt | STRING | — | |
| 文本_8opt | STRING | — | |
| 文本_9opt | STRING | — | |
| 文本_10opt | STRING | — | |
| 文本_11opt | STRING | — | |
| 文本_12opt | STRING | — | |
| 文本_13opt | STRING | — | |
| 文本_14opt | STRING | — | |
| 文本_15opt | STRING | — | |
| 文本_16opt | STRING | — | |
| 文本_17opt | STRING | — | |
| 文本_18opt | STRING | — | |
| 文本_19opt | STRING | — | |
| 文本_20opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 合并文本 | STRING | — |