Nodes/CometAPI/Comet 文本追加
ComfyUI Node

Comet 文本追加

Gluing two strings together without fighting the whitespace

By nkxx188·Created 3 months ago·Updated 3 months ago· 15
Comet 文本追加
    • text
    base
    suffix

    Comet 文本追加 is the pack's string-concatenation utility: base in, suffix in, combined text out. If that sounds like the most boring node in the world, you haven't spent an hour with a prompt composed from two sources where the join point looks like subjectdetail because nothing put a space or newline between them. This node's one party trick is that it doesn't do that.

    It's categorized as an internal utility node, and it behaves like one: two inputs, one output, no network, no key, nothing to configure beyond typing. It's the glue layer for the pack's "compose a prompt from parts" workflow - base style from a 文本卡片, subject line from another, appended together before the whole thing hits a Comet 图像 node or the LLM.

    How it works

    The logic is one rule with a sensible default. If both base and suffix are non-empty, it joins them with a separator - a newline, unless either end already has trailing or leading whitespace, in which case it uses that existing space instead of doubling up. If only one is provided, it returns that one alone. So "cyberpunk city" + "neon rain" becomes "cyberpunk city\nneon rain", and if your base already ends in a space it won't add a second one on top.

    Inputs: base (a forced-input STRING - you must wire it; there's no editable widget) and suffix (multiline, type-able). Output: text, the joined result. Because base is wired, this node slots naturally into graphs where the base prompt is a moving value - an LLM's output, a card's content, a previous append.

    Where it fits

    Composition is the whole game. Two 文本卡片 nodes feeding this node, then into the prompt of a Comet 图像 node. Or chain two of them to build a three-part prompt: base + subject, then that result + a negative-style suffix. It's the pack's answer to the repetitiveness problem - define the stable parts once, append the variable part at the end.

    Install

    Comes with the ComfyUI-CometAPI pack - ComfyUI Manager (search "ComfyUI-CometAPI") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jieg9341-lab/ComfyUI-CometAPI.git
    

    Restart. No dependencies beyond the pack's requests/aiohttp, no API key. It's one of the few nodes in the pack that works before you've configured a single thing.

    Gotchas

    • base can't be typed in. It's forceInput - a wire is mandatory. People drag the node in, try to type the base text, find they can't, and think it's broken. It isn't; wire something in or type in suffix only.
    • The separator is a newline, not a space. For prompts that's usually what you want (prompt parts read fine on separate lines), but if you need foo bar on one line you'll get foo\nbar instead. Mind the expectation.
    • It's plain concatenation with no intelligence. No dedup, no trimming of the middle beyond the whitespace rule, no prompt-weight logic. It joins strings; that's the whole contract.
    CategoryCOMET/Internal

    Inputs (2)

    NameTypeDefaultDescription
    baseSTRING
    suffixSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING