ComfyUI Node

SK Merge Prompt

Stitch up to 20 prompt strings into one clean line

By sinvks·Created 8 months ago·Updated 3 months ago· 13
SK Merge Prompt
    • string
    string_1
    string_2
    string_3
    string_4
    string_5
    string_6
    string_7
    string_8
    string_9
    string_10
    string_11
    string_12
    string_13
    string_14
    string_15
    string_16
    string_17
    string_18
    string_19
    string_20
    input_count2
    preset_sepPipe (竖线 |)
    custom_sep
    remove_newlinesfalse
    remove_empty_linesfalse
    sep_as_segmentfalse

    Prompt assembly is the plumbing nobody enjoys, and this node exists to make it less fiddly. SK Merge Prompt takes up to twenty string inputs and joins them into one - with a twist that separates it from the plain "concatenate" nodes: it splits each input on the separator first, then rejoins everything. So you can dump in a prompt with commas or pipes scattered through it and get back a flattened, cleaned-up single string.

    Where it earns its place is inside this pack. The SK Lora Loader hands you a trigger_words output - a comma-joined blob of every LoRA tag it applied - and you usually want that merged into your base prompt with the rest of your positive conditioning. This node is the natural splice point: base prompt in one input, trigger words in another, one string out the front into your CLIPTextEncode.

    How it works. Pick a separator (or type your own), and each input is split into pieces by it, cleaned of whitespace, optionally scrubbed of empty lines and newlines, then joined with the separator. A couple of nice details in the implementation: comma and period presets also match the Chinese full-width variants ( and ), so prompts copied from Chinese-language workflows split correctly. And sep_as_segment flips the logic - instead of splitting inside each box, it treats each input box as one whole segment and joins them with newline + separator + newline, which is what you want when each input is already a self-contained block.

    Inputs that matter. string_1 and string_2 are required; string_3 through string_20 are optional - so it scales from "merge two things" to "assemble a prompt from twenty sources." The fiddly one is input_count (2–20): it changes how many inputs the node shows, and per the author's tooltip you set the number first, then click the "change prompt input count" button at the bottom of the node to apply it. If you're wiring strings in and inputs aren't appearing, that's the step you missed. preset_sep gives you Comma, Period, Pipe, or Newline; custom_sep overrides the preset whenever it's non-empty. remove_newlines and remove_empty_lines are self-explanatory cleanup toggles.

    Output. One string, the merged result. Wire it into a CLIPTextEncode and you're done.

    Installing. ComfyUI Manager (search "SK LoRA Manager") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sinvks/ComfyUI-SKLora-Manager.git
    pip install -r requirements.txt
    

    Restart. No dependencies beyond the pack's standard ones, no model downloads.

    One honest note. The default separator is Pipe (|), which is a slightly odd default for an English prompt workflow - most people will want Comma. If your output comes out with pipes in it, that's not a bug; the preset is doing exactly what it says. Swap to Comma (or a custom , ) and move on.

    Category🪄 SK LoRA Manager/Prompt

    Inputs (26)

    NameTypeDefaultDescription
    string_1STRING
    string_2STRING
    string_3optSTRING
    string_4optSTRING
    string_5optSTRING
    string_6optSTRING
    string_7optSTRING
    string_8optSTRING
    string_9optSTRING
    string_10optSTRING
    string_11optSTRING
    string_12optSTRING
    string_13optSTRING
    string_14optSTRING
    string_15optSTRING
    string_16optSTRING
    string_17optSTRING
    string_18optSTRING
    string_19optSTRING
    string_20optSTRING
    input_countoptINT22–20修改接入提示词的数量。使用时先修改数量,再点击底部的【修改提示词接入数量】。
    preset_sepoptCOMBOPipe (竖线 |)选择一个预设分隔符。若自定义分隔符不为空,则此选项被忽略。
    custom_sepoptSTRING输入自定义分隔符。若此项不为空,则使用此分隔符。
    remove_newlinesoptBOOLEANfalse移除换行符
    remove_empty_linesoptBOOLEANfalse移除空行
    sep_as_segmentoptBOOLEANfalse如果勾选,合并后的每个【提示词输入框】片段将由换行符 + 分隔符 + 换行符连接。此时,输入框内部的分隔符将不会被用于拆分。如果分隔符本身是换行,则使用双换行符连接(\n\n)。

    Outputs (1)

    NameTypeDescription
    stringSTRING