ComfyUI Node

String Param

The prompt's front door for API-driven workflows

By FaraamFide·Created about a year ago·Updated about a year ago· 1
String Param
    • value
    value

    If you've ever tried to serve a ComfyUI workflow as a backend, you know the pain this node exists to fix: every prompt is hardcoded into a CLIPTextEncode widget, and swapping it per request means reaching into the workflow JSON and hoping you edit the right field. String Param is the designated entry point for text. It's one string input, one string output, and it's the example the whole pack is built around.

    How it fits the API flow

    The value of this node isn't in what it computes - it computes nothing. It's in how ComfyUI treats it as a parameter endpoint. The pack's own usage guide is the clearest explanation of the pattern, and it works exactly like this:

    1. Add ParamString to your workflow and wire its value output into wherever text goes (a CLIPTextEncode text input, a wildcard processor, whatever).
    2. Right-click the node → Title, and rename it to the parameter name you want your API to expose (like prompt).
    3. Save the workflow in API format (the option in the workflow menu that exports the JSON your backend actually consumes).
    4. In your backend, load that JSON, find the node by its class_type, and replace inputs.value with the incoming request data before queueing it.

    That's the entire contract. The node title becomes the parameter name; the widget value is what your API overwrites. Give it a boring, predictable title and your backend code stays boring too.

    The inputs and outputs that matter

    One input: value, a STRING that's multiline by default - prompts, captions, and wildcard text will behave like a text box, not a one-liner. One output: value, the same string you put in. There's no processing, no truncation, no escaping. What goes in comes out, which is exactly what you want from an entry point.

    Notes and gotchas

    • The title is the API name. People stumble here constantly: they rename the widget's label and wonder why their backend key doesn't line up. It's the node title (right-click → Title) that becomes the parameter name, not the on-screen label.
    • It's a plain string. No dynamic prompt expansion, no wildcard substitution. If you want {prompt}-style randomness from a wildcard pack, this node isn't a replacement for it - wire it into a wildcard processor if that's your goal. But if you just need "the backend's text arrives at the encoder," done.
    • No escaping surprises. Whatever string you send is the string that arrives. Newlines survive because the widget is multiline.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/FaraamFide/ComfyUI-ParamNodes.git
    

    Restart ComfyUI, or use ComfyUI Manager and search "ComfyUI-ParamNodes". No dependencies, no models to download. You'll find it under Params/Input.

    It's the most boring node in the pack, and that's the compliment. When the boring node is the one that makes your prompt API-callable, boring is exactly what you want.

    CategoryParams/Input

    Inputs (1)

    NameTypeDefaultDescription
    valueSTRING

    Outputs (1)

    NameTypeDescription
    valueSTRING