RP KSampler (SDXL)
Where regional conditioning actually happens in SDXL
- model
- clip
- vae
- regional_prompts_nolora
- regional_col_n_row
- regional_lora_map
- negative
- threshold
- latent_image
- divide_mode
- latent
- image
The real engine
RP Prompt Parser prepares the text; this node is where the regional magic happens. RP KSampler (SDXL) is a drop-in KSampler replacement for SDXL and SD 1.x that encodes each region's prompt as its own conditioning area and blends them during sampling. For SDXL workflows in this pack it replaces the normal KSampler entirely - checkpoint and EmptyLatentImage feed in, and you get a latent plus a preview image out.
How the blending works
Under the hood it uses ComfyUI's area conditioning: each column prompt applies only to its rectangle of the canvas (from divide_ratio), the base prompt fills the whole frame, and the two are mixed by base_ratio. A base_ratio of 0.2 means 20% base + 80% region; 0.2,0.3,0.5 gives per-region control. The common prompt is pre-merged into every region's encoding exactly once, so it shows up everywhere without doubling.
The inputs that matter
- use_base: must match what you set on RPPromptParser, or regions mis-map.
- use_common: applies the COMMON text to all regions - leave on.
- base_ratio: the big creative dial,
0.2default. - threshold: connect
threshold_outfrom RPRatioParser; this is the end-step ratio that lets regions relax back into the base composition. - steps_add_per_div / cfg_add_per_div: extra steps or CFG per region (total = steps + n_div × steps_add_per_div). Both default to
0, a no-op - reach for them when a 3-4 region grid needs more time to resolve. - lora_weight_adj: multiplier for the combined LoRA weight,
100= unchanged,50= half,200= double.
Here's a trap worth calling out: lora_weight_adj defaults to 0, which disables LoRAs entirely. If you wire a LoRA through the parser and see zero effect, this is almost certainly why - set it to 100.
Outputs
latent (LATENT) → VAE decode or upscale; image (IMAGE) is a convenience preview. Wire the latent into the detailer or a VAE Decode and you're done.
The honest trap: per-region LoRAs
The README is admirably straight about this: ComfyUI can't safely hot-swap LoRA weights mid-sample, so all region LoRAs get averaged into a single shared model applied to the whole image. Your "blonde on the left" and "dark hair on the right" LoRAs blend globally - use lora_weight_adj to scale the combined weight, but don't expect isolation here. True per-region character reinforcement happens at the detailer stage, where each YOLO-detected person is inpainted with their own prompt and LoRA.
Common issues
- Smeared or bleeding characters →
base_ratiotoo high or too low; try0.2–0.3, or per-region values. - LoRA seemingly doing nothing →
lora_weight_adjat 0 (off). Set 100. - Regions in the wrong place →
use_basemismatch with the parser, or stale divide_ratio; reconnect from RPRatioParser.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| clip | CLIP | — | |
| vae | VAE | — | |
| regional_prompts_nolora | RP_SUBPROMPTS | — | |
| regional_col_n_row | RP_REGIONS | — | |
| regional_lora_map | RP_LORA_MAP | — | |
| negative | CONDITIONING | — | |
| threshold | RP_THRESHOLD | — | |
| latent_image | LATENT | — | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–200 | — |
| cfg | FLOAT | 7.00–30 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| denoise | FLOAT | 1.000–1 | — |
| use_base | BOOLEAN | false | Set the same as use_base in RPPromptParser. |
| use_common | BOOLEAN | true | — |
| base_ratio | STRING | 0.2 | BASE:REGION blend ratio. 0.2 → 20% BASE + 80% REGION. Per-region: '0.2,0.3,0.5' |
| steps_add_per_div | INT | 00–20 | Add steps per DIV region. Total steps = steps + (n_div × steps_add_per_div) |
| cfg_add_per_div | FLOAT | 0.00–5 | Add CFG per DIV region. Total cfg = cfg + (n_div × cfg_add_per_div) |
| lora_weight_adj | INT | 00–500 | LoRA weight multiplier (%). 0=disabled, 100=original, 50=half, 200=double |
| debug | BOOLEAN | false | Print debug log when enabled. |
| divide_modeopt | RP_DIV_MODE | Horizontal | Connect divide_mode from RPPromptParser. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| image | IMAGE | — |