RP Prompt Parser
Two characters, one prompt, no attribute bleeding
- regional_prompts_nolora
- regional_lora_map
- divide_ratio
- divide_mode
- original_prompts
- NL_prompts
Why you're here
The problem that drags everyone into regional prompting: you want a blonde character on the left and a dark-haired one on the right, in the same image, and a single prompt describing both hands back their attributes blurred together - blonde bleeding onto the right, dark hair creeping left. That isn't a prompt-engineering failure; prompt adherence is global. The KB's regional-prompting panel calls this the standing answer to attribute bleeding, and RP Prompt Parser is the front door to that answer inside the RP Cast pack.
This is the node every RP Cast workflow starts at. You paste one multi-region prompt into it, it splits the text into per-region chunks plus a per-region LoRA map, and everything else in the pack consumes those outputs. There's no way around learning its syntax - it's the pack's spine.
The syntax
The default prompt widget is a working example:
beautiful scenery, 2girls
ADDCOMM
high quality, masterpiece
ADDBASE
character A, blonde hair
ADDCOL
character B, dark hair <lora:charB:0.8>
The markers come straight from hako-mikan's sd-webui-regional-prompter, the A1111 extension this pack ports to ComfyUI:
- Everything before
ADDCOMMis the common prompt, applied to every region. - Text between
ADDCOMMandADDBASEis the base. - Each
ADDCOLstarts a new column region; addingADDROWgives you a second row, so the parser builds a 2D grid in left-to-right, top-to-bottom order. - LoRA tags are stripped from the text and collected into the
regional_lora_mapoutput, so the sampler and detailer can weight them per region instead of mangling them into the prompt string.
What to actually set
Three fields matter for a beginner:
- divide_mode: Horizontal (columns) or Vertical (rows).
- auto_div_calc:
autois the sane default - it derives the divide_ratio from your prompt structure. Switch tomanualonly when you want to override region sizes with thedivide_ratiowidget (e.g.1,2gives the second column twice the width). - debug: prints the parse to console when you're chasing a mis-mapped region.
Outputs
The ones that matter: regional_prompts_nolora and regional_lora_map feed the sampler or detailer directly; divide_ratio and divide_mode go to RPRatioParser, which turns them into the grid geometry the sampler needs. original_prompts and NL_prompts are plain STRING conveniences - NL_prompts (added in v0.6.00) is a natural-language rendering you can feed straight into a CLIP Encode node or one of the pack's Txt2Img API nodes.
Install
ComfyUI Manager → search "ComfyUI_RP_Cast", or clone it in:
cd ComfyUI/custom_nodes
git clone https://github.com/AISeDam/ComfyUI_RP_Cast
Restart ComfyUI and the eight nodes register. The parser itself has no heavy dependencies (Pillow at most) - only the detailer nodes drag in ultralytics/opencv, and the Txt2Img nodes need an API key, not a GPU.
Where people trip
Keep use_base consistent: if you flip it on here, set it identically on RP KSampler (SDXL), or your regions mis-map. And know the honest limitation up front - the sampler averages all region LoRAs into one model, so true per-character LoRA isolation only happens later, in the detailer's inpainting pass. The parser isn't the bottleneck; it just hands the right data to both stages.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | beautiful scenery, 2girls ADDCOMM high quality, masterpiece ADDBASE character A, blonde hair ADDCOL character B, dark hair <lora:charB:0.8> | — |
| divide_mode | COMBO | 2 options: Horizontal, Vertical | |
| divide_ratio | STRING | Used when auto_div_calc=manual. Leave empty for auto calculation. | |
| auto_div_calc | COMBO | auto | auto: calculate divide_ratio from prompt automatically. manual: use the divide_ratio widget value directly. |
| debug | BOOLEAN | false | Print debug log when enabled. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| regional_prompts_nolora | RP_SUBPROMPTS | — |
| regional_lora_map | RP_LORA_MAP | — |
| divide_ratio | RP_DIV_RATIO | — |
| divide_mode | RP_DIV_MODE | — |
| original_prompts | STRING | — |
| NL_prompts | STRING | — |