Nodes/ComfyUI_RP_Cast/RP Txt2Img (OpenAI)
ComfyUI Node

RP Txt2Img (OpenAI)

RP regional prompts, rendered by GPT-Image instead of your GPU

By AISeDam·Created 4 months ago·Updated 4 months ago· 4
RP Txt2Img (OpenAI)
  • regional_col_n_row
  • divide_mode
  • image
modelgpt-image-2
prompt
size1536x1024
qualityhigh
debugfalse
backgroundauto

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 through gpt-image-1 and gpt-image-1-mini.
  • size: 1024×1024, 1536×1024, 1024×1536, or auto.
  • quality: auto/high/medium/low.
  • background: optional, auto default.
  • 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.

CategoryRP Cast

Inputs (8)

NameTypeDefaultDescription
modelCOMBOgpt-image-24 options: gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini
promptSTRINGRP prompt with ADDCOMM/ADDBASE/ADDCOL/ADDROW syntax, or plain text.
sizeCOMBO1536x10244 options: 1024x1024, 1536x1024, 1024x1536, auto
qualityCOMBOhigh4 options: auto, high, medium, low
debugBOOLEANfalse
regional_col_n_rowoptRP_REGIONSConnect regional_col_n_row output from RPRatioParser. If not connected: auto-detected from ADDROW presence (default: Horizontal).
divide_modeoptRP_DIV_MODEConnect divide_mode output from RPPromptParser.
backgroundoptCOMBOauto3 options: auto, transparent, opaque

Outputs (1)

NameTypeDescription
imageIMAGE