Nodes/ComfyUI-Danbooru-Gallery/多角色编辑器 (Multi Character Editor)
ComfyUI Node

多角色编辑器 (Multi Character Editor)

Lay characters out on a canvas, get back Attention Couple or Regional Prompter syntax

By Aaalice233·Created 11 months ago·Updated 24 days ago· 224
多角色编辑器 (Multi Character Editor)
    • generated_prompt
    syntax_modeattention_couple
    use_fillfalse
    mce_config{}
    base_prompt
    canvas_width1024
    canvas_height1024

    Putting two different-looking characters in one image is arguably the single most friction-filled operation in AI image generation - models process the whole latent at once, so prompt tokens for character A and character B compete across the entire canvas, and without something anchoring each one to a region, features blend, or you get a third character that looks like an average of both. The standard fix is regional prompting: split the canvas into regions, give each its own prompt, and mask the conditioning so region A's prompt only steers region A. Multi Character Editor is a tool for building the prompt syntax that drives that split - it doesn't do the masking itself.

    What it actually outputs - read the type carefully

    The single output, generated_prompt, is a plain STRING, not a mask or a conditioning object. That matters: this node's job is to take however you've laid characters out (presumably through its own canvas-based front-end panel, sized by canvas_width/canvas_height) and serialize that layout into a formatted syntax string - attention_couple or regional_prompts, whichever you pick - that a separate downstream node built to consume that syntax then acts on. You still need a compatible Attention Couple or Regional Prompter implementation elsewhere in your graph; this node prepares the instructions for it, it doesn't do the region masking itself.

    Both syntax modes are real, established approaches to the same problem, just from different tool lineages - Attention Couple masks the cross-attention text tokens (looser bounds, regions stay aware of each other), while the classic Regional Prompter-style syntax works on the older split-and-blend model. Pick whichever matches the specific downstream node you're pairing this with.

    The inputs and outputs that matter

    • syntax_mode (required, enum: attention_couple / regional_prompts, default attention_couple) - which syntax to emit. Match this to whatever node is going to consume generated_prompt.
    • use_fill (required, BOOLEAN, default off) - presumably controls whether uncovered canvas area gets filled with a base/background prompt rather than left unspecified; the schema doesn't spell out the exact fill behavior beyond the flag itself.
    • mce_config (required, STRING, multiline, default "{}") - a JSON blob holding the actual character layout (positions, per-character prompts). In practice this is built by the node's own editor panel rather than hand-typed.
    • base_prompt (optional, STRING) - a global prompt applied outside or alongside the per-character regions.
    • canvas_width / canvas_height (optional, INT, 256–2048, default 1024 each) - the coordinate space your character layout is defined against.
    • Output: generated_prompt (STRING).

    Why this pairs with Character Feature Swap

    This pack ships two nodes aimed at the exact same pain point from different angles: Character Feature Swap transplants one character's specific features into a single prompt (good for one character at a time), while Multi Character Editor handles the harder case of multiple distinct characters coexisting in one frame. If your workflow needs both - several characters, each with a locked-in look - building each character's prompt with Feature Swap first, then feeding the results into this node's per-region prompts, is the more disciplined path than writing everything by hand.

    How to install it

    ComfyUI Manager: search "ComfyUI-Danbooru-Gallery", install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Aaalice233/ComfyUI-Danbooru-Gallery.git
    cd ComfyUI-Danbooru-Gallery
    pip install -r requirements.txt
    

    Restart ComfyUI. No model downloads for this node itself - it's a prompt/config generator, not a sampler.

    Common issues & troubleshooting

    Nothing seems to happen to your image. This is the single most likely confusion: generated_prompt is text, not a mask or conditioning object. If you're not seeing regional separation in your output, check that you actually have a downstream Attention Couple / Regional Prompter-style node consuming this string - Multi Character Editor alone doesn't touch the sampling process.

    Syntax doesn't match what your downstream node expects. Double-check syntax_mode against the specific node you're feeding - attention_couple and regional_prompts are genuinely different formats from different tool lineages, and picking the wrong one for your downstream consumer will produce a string that node can't parse correctly.

    Characters still bleed into each other in the output. This is a known, unsolved-in-general limitation of regional prompting as a technique, not specific to this node - even well-regarded 2026-era implementations still describe "some bleeding" as expected. Giving each character at least one attribute the other doesn't have, and matching your canvas aspect ratio to your character count, are the practical mitigations the wider community has converged on.

    Node doesn't appear in the menu. Standard pack-load check: confirm the repo path, confirm dependencies installed, check the ComfyUI console at startup for an import error.

    Categorydanbooru

    Inputs (6)

    NameTypeDefaultDescription
    syntax_modeCOMBOattention_couple2 options: attention_couple, regional_prompts
    use_fillBOOLEANfalse
    mce_configSTRING{}
    base_promptoptSTRING
    canvas_widthoptINT1024256–2048
    canvas_heightoptINT1024256–2048

    Outputs (1)

    NameTypeDescription
    generated_promptSTRING