Nodes/ComfyUI Layer Style/LayerUtility: String
ComfyUI Node Runs on cloud

LayerUtility: String

String — a plain text constant you can wire anywhere

By chflame163·Created 3 years ago·Updated 4 days ago· 3,113
LayerUtility: String
    • string
    ◄string—►

    The simplest node in the whole pack: one text field, one text output. No processing, no formatting, no logic - you type a value once and this node hands it to whatever's wired downstream. It exists so a fixed piece of text (a filename prefix, a fixed label, a subject word you reuse in three places) can live in one node instead of being retyped, or hard-coded, in every place that needs it.

    It sounds almost too small to write about, but it's the kind of node you end up dropping constantly once a graph grows past a couple dozen nodes. Anywhere you'd otherwise type the same literal string into three different widgets by hand - and then forget to update one of them when you change your mind - a single String node upstream of all three keeps them in sync automatically, because they're all just reading the same output.

    How it works

    There isn't a mechanism to speak of - it's a constant source. Set string once, and every node downstream reading its output gets exactly that value, every execution, until you change it. If you need to change the same piece of text in multiple places at once, this is the node that lets you do it in one spot instead of hunting down every copy.

    The inputs and outputs that matter

    • string - a single-line text field. That's the entire input surface.

    Output: string, wired into anything expecting STRING - a prompt, a filename, a label, or one of the slots on TextJoin if you're assembling something larger.

    How to install it

    Ships with LayerStyle. ComfyUI Manager: search ComfyUI Layer Style, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chflame163/ComfyUI_LayerStyle
    pip install -r ComfyUI_LayerStyle/requirements.txt
    

    Restart, find it under 😺dzNodes → LayerUtility → Data. No dependencies of its own to worry about.

    Common issues

    There's genuinely very little that can go wrong with a single text field. The one thing worth knowing: it's single-line, so if you paste in a full paragraph it'll just sit there as one long unwrapped line in the widget rather than displaying nicely - it still works as a value, but if you're building multi-paragraph text, reach for a proper multiline text node instead and use this one for short fragments.

    Past that, it's the same pack-wide caveat that applies to every LayerUtility node: if String is missing from your menu entirely, LayerStyle itself failed to import, not this node specifically. That's almost always a transformers/tensorflow version conflict from another custom node pack sharing your Python environment, and it's especially common on installs that predate LayerStyle's split into the base pack and the heavier LayerStyle Advance repo. Reinstall clean, or use Manager's "Try Fix" and check the actual traceback before chasing the wrong node - a node this simple is essentially never the actual cause of an import failure.

    Category😺dzNodes/LayerUtility/Data

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRING—

    Outputs (1)

    NameTypeDescription
    stringSTRING—