Nodes/comfyui-prompt-composer/Prompt Composer Grouping
ComfyUI Node

Prompt Composer Grouping

Wrap a whole chunk of prompt in one weighted group

By florestefano1975·Created 3 years ago·Updated 6 months ago· 305
Prompt Composer Grouping
    • text_out
    text_in
    weight1.0
    activefalse

    Every other node in Prompt Composer gives you your own typing box. Grouping doesn't - its entire job is to take whatever text has already accumulated from upstream and wrap the whole thing in parentheses as one weighted unit, instead of you weighting each phrase inside it separately. Say you've chained three Single Text nodes together to build "red dress, floral pattern, knee length" - running that through Grouping at weight 1.3 turns it into (red dress, floral pattern, knee length:1.3), one group pushed up together, rather than three separate weights fighting each other.

    That's the distinction that matters here: Single Text and Multiple Text weight pieces. Grouping weights the combination.

    How it works

    Grouping has no text field of its own. It takes a required text_in, and if weight is anything other than 1, it encapsulates that entire string in () with :weight appended - the standard attention-weighting bracket, applied to a group instead of a single term. At weight 1 it passes the text through unwrapped, same rule as the rest of the pack.

    The inputs and outputs that matter

    • text_in (string, required) - this is the one real difference from Single Text, Multiple Text and the others: there's no optional chain-in here, this input has to be wired for the node to do anything. Feed it the accumulated text_out of whatever chain you've built so far.
    • weight (0 to 1.95, step 0.1, default 1) - the group-level weight. 1 leaves the text as-is; anything else wraps it in (…:weight).
    • active (boolean) - bypass switch, same as elsewhere in the pack.
    • text_out - the (possibly wrapped) string, ready to feed onward.

    Where this fits in a chain

    Grouping is meant to sit inline: upstream node → text_in → Grouping → text_out → downstream node, with everything before it treated as one unit. It's the tool for "these five words need to move together at the same strength," as opposed to weighting each of the five individually and hoping the ratios land right.

    The usual weighting caveat

    (…:weight) is a CLIP-era attention mechanism. It does real work on SD1.5, SDXL and SDXL-lineage checkpoints (Illustrious, NoobAI, Pony). On an LLM-encoded checkpoint - Flux, Z-Image, Anima - the encoder doesn't parse it as weighting at all; the parentheses and colon just become literal characters inside your instruction, which reads worse than plain text. On those models, skip the weight slider here and rely on word order and phrasing instead - the community's own finding is that structure and word order carry the same job that weighting used to do on CLIP models.

    How to install it

    Via ComfyUI Manager: search florestefano1975, install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/florestefano1975/comfyui-prompt-composer
    

    restart ComfyUI, done. No model downloads, no heavyweight dependencies - it's a text-utility pack.

    Common issues & troubleshooting

    The node errors with a missing-input complaint. Unlike Single Text, Multiple Text, Styler and Effect, Grouping's text input (text_in) is required, not optional. If you drop it into a graph and forget to wire something into it, ComfyUI will flag it rather than silently passing an empty string through - that's the tradeoff for this node not having its own typing box.

    Weight isn't visibly doing anything. Check the checkpoint's text encoder - this is inert on LLM-encoded models, as above.

    Nested groups get messy fast. You can chain Grouping nodes to nest weights, but stacked parentheses cause the same oversaturation and distortion on CLIP models that stacked (((word))) syntax always has. One or two levels of grouping is usually plenty; more than that and you're fighting the model rather than steering it.

    CategoryAI WizArt/Prompt Composer Tools

    Inputs (3)

    NameTypeDefaultDescription
    text_inSTRING
    weightFLOAT1.00–1.95
    activeBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    text_outSTRING