Nodes/ComfyUI-PJLatent/PJ-动态文本拼接
ComfyUI Node

PJ-动态文本拼接

Glue your prompt fragments together without a forest of text-concat nodes

By pongjoo·Created 7 months ago·Updated 3 days ago· 0
PJ-动态文本拼接
    • 合并文本
    合并行数3
    连接分隔符,
    文本_1
    文本_2
    文本_3
    文本_4
    文本_5
    文本_6
    文本_7
    文本_8
    文本_9
    文本_10
    文本_11
    文本_12
    文本_13
    文本_14
    文本_15
    文本_16
    文本_17
    文本_18
    文本_19
    文本_20

    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 \n and \t escapes if you type them in, so you can build line-separated output for multiline CLIP boxes.
    • 文本_1 … 文本_20 - the fragments. They're forceInput strings, so wire anything that emits STRING: wildcard picks, your PJ_JSON_To_Prompt result, 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.

    CategoryPJ_Text

    Inputs (22)

    NameTypeDefaultDescription
    合并行数INT31–20
    连接分隔符STRING,
    文本_1optSTRING
    文本_2optSTRING
    文本_3optSTRING
    文本_4optSTRING
    文本_5optSTRING
    文本_6optSTRING
    文本_7optSTRING
    文本_8optSTRING
    文本_9optSTRING
    文本_10optSTRING
    文本_11optSTRING
    文本_12optSTRING
    文本_13optSTRING
    文本_14optSTRING
    文本_15optSTRING
    文本_16optSTRING
    文本_17optSTRING
    文本_18optSTRING
    文本_19optSTRING
    文本_20optSTRING

    Outputs (1)

    NameTypeDescription
    合并文本STRING