ComfyUI Node

Constant String

Constant String — a shared text value you can edit in one place

By aesethtics·Created about a year ago·Updated about a year ago· 1
Constant String
    • value
    value

    Text gets reused in ComfyUI more than you'd think - a file prefix, a negative prompt shared across branches, a tag that appears in several places. This node holds a string of text and outputs it as a STRING, so you can wire the same text to multiple nodes and edit it in exactly one spot. It's the Utilitools pack's Constant String, the text sibling of its Constant Int and Constant Float.

    One required input: value (STRING, multiline, default empty). One output: value, the same string. The mechanism is a pass-through - return (value,) - and the multiline flag matters because it means the input renders as a proper multi-line text box rather than a single-line field. You can paste a paragraph, a prompt, or a file prefix and have it display sensibly on the canvas.

    What it's actually good for

    The killer use is a shared value you'll change later. Say every Save Image node in your workflow should use the same filename_prefix - wire them all to one Constant String and renaming the output set is a single edit instead of a search through every node. Same for a consistent tag or a chunk of prompt text you inject in two places. Give the node a descriptive title and the graph reads like a labeled spec: "Output Folder," "Negative Block," "Watermark Text."

    It also plays nicely with the pack's other text-adjacent patterns - you can feed a string into a Calculator if it's a math expression, use it as a branch value in If Then Else, or combine it with a Date Timestamp's pre_text/post_text for richer filenames. The output is a plain STRING, so it connects to any text input without conversion.

    The honest caveats

    Same rule as the other constants: if the text appears once, this node is an extra box - type it inline. It's a static value; nothing in this pack mutates it at runtime, so for text that changes as a workflow runs you'd want a different approach. And note the default is an empty string, so a freshly dropped node outputs nothing until you type in it - a dropped-and-forgotten Constant String will happily pass empty text around. That's not a bug, it's just a reminder to actually fill the box.

    Installing it

    Standard Utilitools install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/aesethtics/ComfyUI-Utilitools
    

    or search "Utilitools" in ComfyUI Manager and restart ComfyUI. It's under Utilitools → Constants. No dependencies, no downloads - the whole pack is stdlib Python. A small pack with no real community presence, but when you need one text box feeding five nodes, this is the one.

    CategoryUtilitools/Constants

    Inputs (1)

    NameTypeDefaultDescription
    valueSTRING

    Outputs (1)

    NameTypeDescription
    valueSTRING