RP Txt2Img (OpenAI)
RP regional prompts, rendered by GPT-Image instead of your GPU
- regional_col_n_row
- divide_mode
- image
What it is
An API bridge: it takes an RP prompt, converts it to natural language with position labels, and sends it to OpenAI's image generation API. No GPU, no checkpoint, no YOLO model. The appeal is that your regional workflow's syntax stays intact while the rendering happens on OpenAI's side - handy when your local card is busy, or when there isn't a card at all.
How the conversion works
The node turns the region grid into a sentence. The scene text stays, and each region becomes a position phrase - "1girl on the upper-left side", "1boy on the upper-right side" - all joined with "interacting naturally in the same scene, seamless composition", plus any style tags. Position labels are computed from the actual grid, not guessed: a Horizontal 2×2 gives upper-left/upper-right/lower-left/lower-right, and vertical or asymmetric layouts get their own correct labels. Connect regional_col_n_row and divide_mode from your parser and ratio parser for accurate layout detection (leave them unconnected and it falls back to auto-detecting from ADDROW presence).
Inputs that matter
- model:
gpt-image-2(default) down throughgpt-image-1andgpt-image-1-mini. - size:
1024×1024,1536×1024,1024×1536, orauto. - quality:
auto/high/medium/low. - background: optional,
autodefault. - prompt: RP syntax or plain text.
- debug: prints the converted prompt so you can see exactly what the API received.
Setup
API key lives in Settings → ComfyUI-RP-Cast → Configuration (openai_api_key), from platform.openai.com. No extra pip packages - the node uses Python's built-in urllib. The output is a normal IMAGE you can wire into a preview or save node.
The honest caveat
This is a translation layer, not regional conditioning. The API model can't hold regions the way area conditioning does; it just gets a well-phrased positional sentence and mostly follows it. There's real money per image, and responses arrive as base64 over urllib, so 4K renders take a while. It's a great draft engine and a way to sanity-check a composition before committing GPU hours - just don't expect the attribute isolation you get from the local sampler plus detailer pair.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | gpt-image-2 | 4 options: gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini |
| prompt | STRING | RP prompt with ADDCOMM/ADDBASE/ADDCOL/ADDROW syntax, or plain text. | |
| size | COMBO | 1536x1024 | 4 options: 1024x1024, 1536x1024, 1024x1536, auto |
| quality | COMBO | high | 4 options: auto, high, medium, low |
| debug | BOOLEAN | false | — |
| regional_col_n_rowopt | RP_REGIONS | Connect regional_col_n_row output from RPRatioParser. If not connected: auto-detected from ADDROW presence (default: Horizontal). | |
| divide_modeopt | RP_DIV_MODE | Connect divide_mode output from RPPromptParser. | |
| backgroundopt | COMBO | auto | 3 options: auto, transparent, opaque |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |