Nodes/ComfyUI-Bada-Utils/🌊 Bada Visual Regional Prompt
ComfyUI Node

🌊 Bada Visual Regional Prompt

It Builds the Prompt, Not the Mask

By bada-yaΒ·Created a day agoΒ·Updated a day agoΒ· 0
🌊 Bada Visual Regional Prompt
    • prompt
    β—„prompt_textβ–Ί
    β—„formatNatural Spatial (Krea/MiniMax/Gemini/GPT)β–Ί
    β—„aspect_ratio16:9β–Ί
    β—„grid_cols6β–Ί
    β—„grid_rows3β–Ί
    β—„ui_languageEnglishβ–Ί
    β—„grid_data{}β–Ί
    β—„prefix_promptβ–Ί
    β—„suffix_promptβ–Ί

    Regional prompting has one job: stop the girl on the left and the girl on the right from wearing each other's hair colour. Conditioning applies to the whole canvas, so one prompt describing two subjects reliably smears their attributes together - good for twenty to forty forum threads a month, every month, for three years.

    Nearly every tool in that space attacks it by masking conditioning: Attention Couple, Conditioning (Set Area), Forge Couple, Krita's paint surface. Bada Visual Regional Prompt does something else. It never touches conditioning. You drag boxes onto a grid on the node, type a prompt per box, and it emits one carefully formatted spatial prompt that goes into a text encoder like any other prompt.

    So, the honest verdict: on local SDXL or Flux, if you want two characters who don't merge, this isn't your fix - that's an attention-masking job. Reach for this when the target reads layout from text: the 2026 layout-aware image models, the bbox-caption JSON that Ideogram 4 takes as its native prompt format, or any multi-panel character sheet. Prompt-side regional control is arguably the better half of the problem to be on anyway - better text encoders keep reducing when masking is necessary, but "put this there, explicitly" never stops being useful.

    How it works

    The class is BadaRegionalPrompt in nodes/bada_regional_prompt.py; the grid you drag on is drawn by web/visual_grid_prompt.js, which writes a JSON blob into the hidden grid_data string. That blob is an areas list, each entry carrying column and row bounds (c1, c2, r1, r2), an id and a prompt, plus a character profile field and white_bg / grid_borders flags.

    generate() sorts those areas top-to-bottom, left-to-right, turns each cell rectangle into a normalised bounding box and a directional description ("upper left", "left half"), then writes the string for the format you chose. grid_borders decides whether it appends "crisp thin black divider lines, clean comic grid panels" or "seamlessly blended, unified lighting" language. white_bg appends a clean studio-white backdrop tail - the character-sheet-on-white idiom. Prefix and suffix wrap the whole thing.

    One invisible mechanism worth knowing about: if your text contains Korean, the node translates it over HTTP during generation, trying Google's clients5 endpoint, then its mobile one, then GTX, then MyMemory, each with a 3-second timeout, before falling back to a built-in regex dictionary of common tags. English prompts skip all of it.

    Inputs and outputs that matter

    • prompt_text - free text, and it's a fallback, not the main event. It only becomes the output when grid_data has no areas.
    • format - the setting that decides whether the output is useful. Six options: Natural Spatial (Krea/MiniMax/Gemini/GPT), ComfyUI / SD BREAK Syntax, Structured Tags, Coordinates Bounding Box, Comma-Separated List, Raw JSON. Match the target, not your taste: BREAK is an A1111/ComfyUI convention that chat models won't parse, while the bbox and JSON formats are what layout-trained caption schemas want.
    • grid_cols / grid_rows - define the cell math and how many cells you can drag over. They change the percentages written into the prompt; they don't resize anything.
    • prefix_prompt / suffix_prompt - global style, quality and lighting on one side, atmosphere on the other. Keep what applies to every panel here.
    • aspect_ratio and ui_language - the first is written into the layout header (your output size still comes from your latent), the second switches the interface labels.
    • Output: prompt (STRING). One string, no negative. Into a CLIP Text Encode text field, or whatever prompt input your API workflow uses.

    Installing it

    Same pack: Manager β†’ ComfyUI-Bada-Utils β†’ Install β†’ restart β†’ Ctrl+F5, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bada-ya/ComfyUI-Bada-Utils.git
    

    Dependencies are aiohttp and Pillow. No models, no ControlNets, nothing to download. Turn Nodes 2.0 off in settings - the interactive grid is legacy-canvas JavaScript.

    Where people get burned

    It's all-or-nothing on the grid. If grid_data has no areas, your dragged boxes are irrelevant and the output is just your translated prompt_text. If neither exists you get an empty string, and ComfyUI will cheerfully render a picture of nothing in particular.

    grid_data is written by the frontend. Load a workflow on a machine where the JavaScript didn't initialise and it can come through empty, silently collapsing your layout prompt into fallback text. Hence the hard refresh after installing.

    Korean costs a network round trip. The dictionary fallback catches common tags, but unusual phrasing run offline degrades into partial gibberish.

    This pack is obscure. Corpus searches turn up effectively nothing for it, so there's no thread to search when something misbehaves - the source is readable and that's your support line. Treat the README's "optimized for" list as the author's target list, not community-verified mileage.

    Category🌊 Bada Utils/Prompting

    Inputs (9)

    NameTypeDefaultDescription
    prompt_textSTRINGβ€”
    formatCOMBONatural Spatial (Krea/MiniMax/Gemini/GPT)6 options: Natural Spatial (Krea/MiniMax/Gemini/GPT), ComfyUI / SD Regional Prompt (BREAK Syntax), Structured Tags ([Area 1 | LEFT]), Coordinates Bounding Box (<area_1 bbox=...>), Comma-Separated List, Raw JSON
    aspect_ratioCOMBO16:98 options: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, +2
    grid_colsINT61–20β€”
    grid_rowsINT31–20β€”
    ui_languageCOMBOEnglish2 options: English, ν•œκ΅­μ–΄
    grid_dataoptSTRING{}β€”
    prefix_promptoptSTRINGβ€”
    suffix_promptoptSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    promptSTRINGβ€”