Nodes/TW-CUI-Util/STRING Literal
ComfyUI Node

STRING Literal

STRING Literal

By TW-CUI·Created 2 years ago·Updated 2 years ago· 1
STRING Literal
    • STRING
    string

    The single-line member of this pack's literal-node family: one short string in, the same string out. Same passthrough idea as this pack's FLOAT Literal and INTEGER Literal, just for text instead of numbers.

    Why you'd reach for it: anywhere you've got a short piece of text - a filename prefix, a subfolder path, a model name override - that you want to type once and feed to more than one node. ComfyUI widgets live on exactly one node by default, so without something like this, keeping two nodes in sync means manually re-typing the same string in both places every time you change it, and one of them inevitably falls out of sync. Wire a StringLiteral to both instead, and there's only one place left to edit - a filename prefix you want mirrored into both a save node and a text-note node elsewhere in the graph is a good example.

    Mechanism. Stores a string, hands it back unmodified. Nothing more - no trimming, no escaping, no substitution of any kind.

    Inputs and outputs. One required string input (single-line STRING), one output typed STRING and named "STRING." That's the entire node - there's nothing else configurable on it.

    It's worth being clear about what this node is not: it doesn't encode anything, doesn't validate anything, and doesn't know whether the text it's holding is a filename, a model name, or a stray word you meant to delete. It's closer to a labeled sticky note stuck to a wire than a functional node - the value is entirely in letting you name and reuse a piece of text instead of retyping it.

    Installing it. Ships with TW-CUI-Util. ComfyUI Manager: search "TW-CUI-Util", install, restart. Or manually, git clone https://github.com/TW-CUI/TW-CUI-Util into ComfyUI/custom_nodes and restart. No dependencies, no downloads beyond the pack code.

    Troubleshooting.

    • This is single-line only - if you paste in something with line breaks (a full prompt, say), you probably want this pack's STRING Literal (Multiline) instead, which gives you a proper resizable text box rather than cramming everything onto one line.
    • Like this pack's other literal nodes, there's no validation on what you type - it'll happily feed a nonsense value to whatever's downstream, since the literal itself has no idea what field it's ultimately going into. If something downstream errors out unexpectedly, check the actual string value first before assuming the receiving node is broken.
    • A concrete pattern worth knowing: feed this into Save Image (Advanced)'s filename_prefix and also into a text-note node elsewhere in the same graph if you want your on-canvas documentation to always match your actual output filename - one source, two destinations, no drift between them.
    • If it vanishes from your node search after updating the pack, that's an import-failure symptom - check the ComfyUI startup console for a TW-CUI-Util error - rather than something wrong with this specific node.
    CategoryTW-CUI/util

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING