OpenAI Responses API Node
Text, vision and image generation in one node — the OpenAI Responses API
- image
- mask
- text_output
- images
- response_id
- revised_prompt
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 asinput_imagecontent items - that's the vision path. enable_image_generationadds theimage_generationtool, which lets the model call GPT Image itself, including editing when you attach an image. The optionalmaskinput is converted to an RGBA alpha image and sent asinput_image_mask- the mask's transparent regions are what gets regenerated.image_gen_optionsis a JSON string that overrides the image tool's defaults - quality, size, background transparency, output format, n, and so on. Thetypefield 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_idthreads a prior response's ID back in for actual multi-turn conversation.reasoning_effort-none/low/medium/high- gets sent as thereasoningblock for o-series/gpt-5 models.temperatureof -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.createis not the same aschat.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_generationis off, or the model decides not to call the tool, theimagesoutput is a 1×1 placeholder. Checktext_outputfor 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;
-1is 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.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Text prompt for the Responses API | |
| model | STRING | gpt-4o | Model ID, e.g. gpt-4o, gpt-5.5, o3 |
| api_url | STRING | https://api.openai.com/v1 | OpenAI-compatible API base URL |
| api_key | STRING | YOUR_API_KEY_HERE | — |
| seed | INT | 00–18446744073709550000 | — |
| temperature | FLOAT | -1.00-1–2 | -1 = none (use model default); 0~2 = custom temperature |
| instructions | STRING | System/developer instructions inserted into the model context | |
| enable_image_generation | BOOLEAN | false | Enable the image_generation tool for GPT Image generation/editing |
| imageopt | IMAGE | Input image(s) for vision or image editing/reference. Supports batch input (multiple images). | |
| maskopt | MASK | Optional mask for image editing (areas to edit) | |
| previous_response_idopt | STRING | Previous response ID for multi-turn conversation | |
| reasoning_effortopt | COMBO | none | Reasoning effort for o-series/gpt-5 models (none = disabled) |
| image_gen_optionsopt | STRING | Optional 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)
| Name | Type | Description |
|---|---|---|
| text_output | STRING | — |
| images | IMAGE | — |
| response_id | STRING | — |
| revised_prompt | STRING | — |