Nodes/ComfyUI-CitronNodes/String Literal (Citron Image Saver)
ComfyUI Node

String Literal (Citron Image Saver)

One prompt box, as many wires as you need

By citronlegacy·Created about a year ago·Updated 22 days ago· 0
String Literal (Citron Image Saver)
    • STRING
    ◄string►

    A multiline text box with one STRING output. ComfyUI ships a PrimitiveStringMultiline that does the same job, so this isn't novel - but if you're already using this pack's save nodes, it's here, it's typed, and it's the piece that makes your metadata's prompts true instead of "unknown".

    Here's the case for it in one sentence: the same positive prompt usually has to reach two CLIP encodes and the save node, and typing it three times means the file records a prompt that may not be the one that ran.

    How it works

    One required input, string, multiline, empty by default. One output, STRING. No processing at all - whatever's in the box comes out.

    That's fine, because the value is structural. Fan it out: into your positive CLIP encode, into a second encode for a refiner or a different model branch, into the save node's positive input. Change the wording once and every consumer follows, and the parameters block in the PNG ends up with the prompt you actually used.

    There's a second, less obvious payoff specific to this pack. The saver finds LoRA and embedding hashes by regex-scanning the prompt strings for <lora:name:weight> and embedding:name>. If your prompt lives in a widget on a CLIP Text Encode node and you never wire it into the saver, the saver sees unknown and hashes nothing - so your upload has no resource list. Feeding the prompt from a String Literal into both the encoder and the saver is what makes that hash lookup work.

    The usual structural caution applies: a value node records a value, not necessarily the value. If you leave the CLIP encoder's own text widget populated and also wire a String Literal into it, ComfyUI uses the wire - but anyone reading the canvas later will assume the visible text in the node is the prompt. Keep one prompt source or you'll confuse your future self, and nobody else will be able to debug your workflow.

    Do be aware of what this node isn't: no dynamic variable substitution, no wildcard expansion, no concatenation. It's a box. If you want to compose prompts from parts, you need a text-concat or wildcard node from another pack. This one exists so the pack's save nodes have a typed prompt source that isn't a hand-typed duplicate.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/citronlegacy/ComfyUI-CitronNodes
    # restart ComfyUI
    

    ComfyUI Manager may not list the pack yet - the README still marks support "coming soon" and the repo's packaging metadata is placeholder - so cloning is the reliable install. The only pip dependency is piexif, pulled in by the saver code; if it's missing the whole pack fails to import:

    pip install piexif
    

    No model downloads. Find it under Citron_ImageSaver/utils.

    Common issues

    • Metadata says unknown for the prompt. Nothing wired into the saver's positive/negative. This node's whole raison d'être.
    • LoRA names don't show up in the file. The <lora:...> tag isn't in the text the saver received - check what's actually on the wire, not what's displayed on the encode node.
    • Changed the text and nothing happened. There's a second prompt source upstream. ComfyUI doesn't warn about a widget that's been overridden by a wire.
    • Wanted a wildcard or a variable. Different node. This one passes a string through untouched.
    CategoryCitron_ImageSaver/utils

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRINGstring

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGstring (STRING)