NAI 角色分区编辑器
Put the red-haired girl on the left and the blue one on the right, for real
- nai_pipe
- core_settings
- nai_pipe
- 角色数量
- 配置摘要
Regional prompting is the standing fix for the problem that a single prompt describing two characters smears their attributes together - the girl on the left picks up the blue hair meant for the one on the right. In ComfyUI you'd normally reach for regional conditioning nodes or a lot of careful prompt gymnastics. NAI 角色分区编辑器 (Character Region Editor) is NovelAI's built-in answer to the same problem, and it's genuinely the best thing this pack does: it gives every character its own prompt, negative prompt, and a position on the canvas, then folds all of that into the request NovelAI sends.
It slots into the pipe between the model loader and a sampler:
NAI 模型加载器 → NAI 角色分区编辑器 → NAI 文生图/图生图采样器
How it works
Inputs are the NAI_PIPE (so it knows which model you're on), the NAI_CORE_SETTINGS (it reads width/height from the core card to draw its canvas at the true aspect ratio - portrait, landscape or square), and roles_json. The JSON is the edited role list, and it's where the editor's UI puts your roles when you edit them in the node's panel. You don't hand-write it; the node's own editor does.
Per role you get a positive prompt, a negative prompt, an enabled toggle, and an AI-decide-location option (ai_choice) - NovelAI's "let the model figure out where this character goes" mode, which is often the better default. For manual placement, the model decides the coordinate system:
- V5 - up to 32 characters, and manual positions use continuous free coordinates (0–1 x/y), so you place a character anywhere, not on a grid.
- V4 / V4.5 - up to 6 characters on the classic 5×5 grid centers, same as NovelAI's own UI.
The node bakes everything into the pipe, and it validates against the model: V3 has no character regions at all, so it errors cleanly instead of shipping a meaningless request. Outputs are the modified nai_pipe, a 角色数量 count, and a 配置摘要 summary showing characters, canvas size and the coordinate mode.
Where people get burned
The capability matrix again. V5 Curated falls back to V4.5 Curated inpainting for inpaint requests, so a V5 Curated inpainting run caps at 6 characters even though V5 Full text-to-image allows 32. If your region count suddenly refuses to go above six, check whether you're on the Curated model and doing inpainting.
Also: the editor respects the core card's width/height, so if the card says 832×1216 and you drop a different size into the sampler with size_mode set to something else, the placements were designed for the card's canvas and may land oddly. Keep the canvas consistent between the editor and the sampler.
One design note in its favor: roles, prompts and positions persist in the workflow, but the token never does. Position data survives reloads; your credential doesn't.
Install
Same pack recipe: search ComfyUI-NovelAI-GENYTOOLS in ComfyUI Manager, or git clone into custom_nodes + pip install -r requirements.txt, token in ComfyUI settings. This pack's README recommends enabling ComfyUI Node 2.0 for the best-looking node UI, and the region editor is where you'll feel it most.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| nai_pipe | NAI_PIPE | — | |
| core_settings | NAI_CORE_SETTINGS | — | |
| roles_json | STRING | [] | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| nai_pipe | NAI_PIPE | — |
| 角色数量 | INT | — |
| 配置摘要 | STRING | — |