ComfyUI Node

OpenAI Responses API Node

Text, vision and image generation in one node — the OpenAI Responses API

By AhBumm·Created 2 years ago·Updated 3 months ago· 11
OpenAI Responses API Node
  • image
  • mask
  • text_output
  • images
  • response_id
  • revised_prompt
prompt
modelgpt-4o
api_urlhttps://api.openai.com/v1
api_keyYOUR_API_KEY_HERE
seed0
temperature-1.00
instructions
enable_image_generationfalse
previous_response_id
reasoning_effortnone
image_gen_options

OpenAI's Responses API is the newer, unified successor to the old chat completions API - the one where a single call can produce text, image analysis, and image generation through tools. This node is the pack's most capable LLM entry: it wraps responses.create, so one node can caption an image, hold a multi-turn conversation, or generate/edit an image with GPT Image, depending on how you set the flags. If you're on OpenAI's platform and you want the whole surface in one node, this is it.

How it works

It builds an OpenAI client against api_url (default https://api.openai.com/v1) and assembles a Responses API request:

  • Text goes in as input_text. Images (a whole batch, if you feed one) are downscaled, encoded to PNG base64, and attached as input_image content items - that's the vision path.
  • enable_image_generation adds the image_generation tool, which lets the model call GPT Image itself, including editing when you attach an image. The optional mask input is converted to an RGBA alpha image and sent as input_image_mask - the mask's transparent regions are what gets regenerated.
  • image_gen_options is a JSON string that overrides the image tool's defaults - quality, size, background transparency, output format, n, and so on. The type field is deliberately protected so you can't break the tool. If the JSON is malformed it's ignored with a console warning, so it won't take your workflow down.
  • previous_response_id threads a prior response's ID back in for actual multi-turn conversation.
  • reasoning_effort - none/low/medium/high - gets sent as the reasoning block for o-series/gpt-5 models. temperature of -1 means "don't send it, use the model default"; 0–2 sends a real value.

Outputs are the good part: text_output (STRING), images (actual IMAGE tensor - no conversion step), response_id (STRING, for chaining turns), and revised_prompt (STRING, from the image tool).

The inputs that matter

  • prompt, model (gpt-4o default; tooltip suggests gpt-4o, gpt-5.5, o3), api_url, api_key - the basics.
  • instructions - the system/developer context. Only sent if non-empty.
  • enable_image_generation - the master switch for the image tool.
  • image / mask - vision and editing inputs.
  • reasoning_effort and previous_response_id - for reasoning models and conversations.

Installing it

Part of AhBumm/ComfyUI_BillBum_APIset_Nodes. ComfyUI Manager → search "billbum" → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/AhBumm/ComfyUI_BillBum_APIset_Nodes.git
cd ComfyUI_BillBum_APIset_Nodes
pip install -r requirements.txt

Restart ComfyUI. Standard deps only (openai, pillow, requests, tenacity).

Common issues

  • The endpoint must speak the Responses API. responses.create is not the same as chat.completions - a lot of third-party "OpenAI-compatible" providers implement the latter only, and will fail or return garbage on this node. If you're not hitting real OpenAI, verify the provider supports Responses.
  • Images only appear when the image tool fires. If enable_image_generation is off, or the model decides not to call the tool, the images output is a 1×1 placeholder. Check text_output for what actually happened.
  • Mask without an image is ignored (with a console note). Mask editing requires a reference image - that's the whole point of a mask.
  • Reasoning models and temperature. o-series often ignore temperature anyway; -1 is the safe default that lets the model decide.

This is the node to reach for when your workflow wants "describe this image, then draw a variation, then tell me what you changed" - all in one call, all wired straight back into the graph.

CategoryBillBum_API

Inputs (13)

NameTypeDefaultDescription
promptSTRINGText prompt for the Responses API
modelSTRINGgpt-4oModel ID, e.g. gpt-4o, gpt-5.5, o3
api_urlSTRINGhttps://api.openai.com/v1OpenAI-compatible API base URL
api_keySTRINGYOUR_API_KEY_HERE
seedINT00–18446744073709550000
temperatureFLOAT-1.00-1–2-1 = none (use model default); 0~2 = custom temperature
instructionsSTRINGSystem/developer instructions inserted into the model context
enable_image_generationBOOLEANfalseEnable the image_generation tool for GPT Image generation/editing
imageoptIMAGEInput image(s) for vision or image editing/reference. Supports batch input (multiple images).
maskoptMASKOptional mask for image editing (areas to edit)
previous_response_idoptSTRINGPrevious response ID for multi-turn conversation
reasoning_effortoptCOMBOnoneReasoning effort for o-series/gpt-5 models (none = disabled)
image_gen_optionsoptSTRINGOptional JSON to override defaults for the image_generation tool. Leave empty to use API defaults. Example: {"quality":"high","size":"1024x1536","background":"transparent","output_format":"png"} Supported keys: quality, size, background, output_format, output_compression, n, input_fidelity, moderation. The 'type' field cannot be overridden.

Outputs (4)

NameTypeDescription
text_outputSTRING
imagesIMAGE
response_idSTRING
revised_promptSTRING