ComfyUI Node

Prompt Weight

A 10-line node that stops you hand-typing (word:1.3)

By MainamSuwan48·Created 6 months ago·Updated 6 months ago· 0
Prompt Weight
    • prompt
    prompt
    weight1.00

    You know how every other prompt on SDXL-era checkpoints has some (thing:1.3) wedged in the middle of it? Prompt Weight is the node that writes that syntax for you. Feed it any string and a number, and it hands back the same string wrapped as (string:1.3). It's not doing anything clever - the whole node is about ten lines of Python - but it turns "the number that controls how strongly this concept lands" into a widget you can grab, instead of text you have to keep in sync.

    It's part of Cornman Utils Nodes, a tiny pack from Cornman (this copy is MainamSuwan48's fork, per the project metadata) that ships exactly three string- and resolution-wrangling helpers. Prompt Weight is the one you'd actually reach for in a real workflow: it's how you parameterize prompt emphasis.

    How it actually works

    Read the source and there are three behaviors worth knowing, because two of them will bite you:

    1. Weight 1.0 is a passthrough. If the widget reads exactly 1.0, the node returns your prompt untouched - no parentheses at all. That's deliberate, not a bug; it means at default settings the node is invisible in your prompt, and nothing changes until you actually move the slider.
    2. It wraps the entire string, not per-tag. Give it red jacket, studio light at 1.3 and you get (red jacket, studio light:1.3), which raises attention on the whole group as one unit. If you wanted only red jacket boosted, split the strings before this node.
    3. It appends a trailing , . The output is literally (string:1.3), - comma and space baked in. That's fine when this feeds into a prompt builder that appends more text, but if it's the last thing before your CLIP Text Encode, you're sending a dangling separator to the encoder. Harmless to the image, mildly annoying when you inspect the generated prompt.

    It also strips surrounding whitespace, and returns an empty string if you give it nothing - so an unconnected or empty upstream prompt won't crash your graph.

    The inputs and output

    Two inputs, both required:

    • prompt (STRING) - anything you can wire a string into. Note it's forceInput, so you can't type in the widget; this node exists to take text from something else, like a Prompt Router or a multiline text node.
    • weight (FLOAT) - a slider from 0.0 to 3.0, step 0.05, default 1.0.

    The single output is prompt (STRING), ready to go into whatever eats a prompt string. There's no is_output_node on this one, so you're meant to chain it into a CLIP Text Encode or a builder, not run it standalone.

    The one number that matters is weight. Keep it in the 0.5–1.5 band; below 0.5 a concept barely registers, above 1.5 you get oversaturation and distortion. The widget letting you crank to 3.0 is the node being permissive, not an endorsement.

    Where people get burned

    The big one has nothing to do with this pack: prompt weighting is CLIP-era syntax, and it's dead on LLM-encoded models. On Z-Image, Flux 2 Klein, Anima and friends, Comfy disabled weighting on the encoder path - so your (string:1.3) isn't ignored, it's fed to the model as literal punctuation inside an instruction, which is worse than nothing. On those checkpoints, this node is a trap. On SD 1.5, SDXL, Illustrious, NoobAI and Pony V6, it does exactly what it says.

    The other gotcha: the max is 3.0 but the useful range is 1.5-ish. And remember the whole-string grouping - if you've got a comma-heavy prompt and only mean to boost one clause, wire the clause in separately.

    Installing it

    The README is explicit: these nodes are local only and do not show up in ComfyUI Manager's search. So skip Manager and clone:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MainamSuwan48/ComfyUI-Cornman-Utils-nodes
    

    Restart ComfyUI, then right-click the canvas → Add Node → Cornman-Utils → Prompt Weight, or just search "Prompt Weight". No dependencies, no model downloads, no requirements.txt - it's pure stdlib Python.

    The verdict

    If you write prompts on SDXL-derived checkpoints and you're tired of editing (word:1.2) by hand in every workflow, this is a tidy little quality-of-life node - and unlike a lot of "utils" packs, the weight-1.0 passthrough means it never pollutes your prompt when you're not using it. If your stack is all 2026 LLM-encoder models, save the clone and the bytes; weighting is a habit that model family has already retired.

    CategoryCornman-Utils

    Inputs (2)

    NameTypeDefaultDescription
    promptSTRING
    weightFLOAT1.000–3

    Outputs (1)

    NameTypeDescription
    promptSTRING