Nodes/ymc-node-suite-comfyui/region text burn
ComfyUI Node

region text burn

Build an attention-weighted region prompt without the manual parentheses

By YMC-GitHub·Created 3 years ago·Updated about a year ago· 20
region text burn
    • region_text
    • target_text
    • prompt_weight
    main_textdress
    target_textwhite
    weight1.0

    The idea behind Region text burn is the SDXL-era "cutoff" trick: isolate a concept so the model pays attention to it without it bleeding into everything else. The node doesn't do any of that isolation itself - what it does is assemble the text you'd use for it, correctly, every time. You give it a main subject and a target attribute, and it produces a prompt fragment like (white dress:1.3) ready to drop into your positive prompt.

    Where people get burned with manually-built prompts is the fiddly syntax - the parentheses, the colon, the weight, the trailing spaces. This node removes the syntax errors by generating it for you, and it's honest about what it needs: three plain strings in, one formatted string out.

    How it works

    It's a string assembler with a small decision tree. Given main_text (say dress) and target_text (white), it joins them with a space. Then, if weight is unset or "1.0", it leaves the result bare - white dress - because weight 1.0 is the default and wrapping it would be noise. For any other weight it wraps the whole thing in parentheses with a colon: (white dress:1.3).

    There's a defensive undefined guard on both text inputs (ComfyUI sends the string "undefined" for unconnected inputs), so an unconnected field degrades to an empty string instead of literally printing the word undefined into your prompt. That's the kind of detail you only notice when it's missing.

    Inputs and outputs

    • main_text - the subject, default "dress", multiline
    • target_text - the attribute, default "white"
    • weight - a STRING (yes, a string), default "1.0"; anything other than 1.0 triggers the parenthesized form
    • Outputs: region_text (the assembled fragment), plus target_text and prompt_weight echoed back for inspection

    Wire region_text into whatever joins or encodes your positive prompt. The echo outputs are there so you can see what went in while you debug.

    Installing it

    # ComfyUI Manager: search "ymc suite" and install ymc-node-suite-comfyui
    # or:
    cd ComfyUI/custom_nodes
    git clone https://github.com/YMC-GitHub/ymc-node-suite-comfyui
    

    Restart after installing. Four tiny pure-Python PyPI helpers self-install; no models, no GPU footprint.

    Gotchas

    • Weight is a string input, not a slider. Type 1.3, don't wire a FLOAT in expecting a conversion - it compares text against "1.0".
    • Remember the attention-weighting caveat from modern prompting: (word:1.3) syntax is respected on SDXL-lineage models but silently discarded by the newer LLM-encoded encoders (Flux 2 Klein, Anima, Z-Image). Great tool for SD1.5/SDXL/Illustrious-style workflows; pointless theater elsewhere.
    • On the WAS-conflict front: if you also run WAS Node Suite, Manager may flag shared node names between the packs - disable one if you hit save-node weirdness.
    Categoryymc suite/text/cutoff

    Inputs (3)

    NameTypeDefaultDescription
    main_textSTRINGdress
    target_textSTRINGwhite
    weightSTRING1.0

    Outputs (3)

    NameTypeDescription
    region_textSTRING
    target_textSTRING
    prompt_weightSTRING