Skip to main content
OpenAI GPT-Image-1 Node Screenshot OpenAI GPT-Image-1 is part of the ComfyUI API nodes series that allows users to generate images through OpenAI’s GPT-Image-1 model. This is the same model used for image generation in ChatGPT 4o. This node supports:
  • Text-to-image generation
  • Image editing functionality (inpainting through masks)

Node Overview

The OpenAI GPT-Image-1 node synchronously generates images through OpenAI’s image generation API. It receives text prompts and returns images matching the description. GPT-Image-1 is OpenAI’s most advanced image generation model currently available, capable of creating highly detailed and realistic images.
To use the API nodes, you need to ensure that you are logged in properly and using a permitted network environment. Please refer to the API Nodes Overview section of the documentation to understand the specific requirements for using the API nodes.
Make sure your ComfyUI is updated.Workflows in this guide can be found in the Workflow Templates. If you can’t find them in the template, your ComfyUI may be outdated.(Desktop version’s update will delay sometime)If nodes are missing when loading a workflow, possible reasons:
  1. You are not using the latest ComfyUI version(Nightly version)
  2. You are using Stable or Desktop version (Latest changes may not be included)
  3. Some nodes failed to import at startup

Parameter Description

Required Parameters

ParameterTypeDescription
promptTextText prompt describing the image content you want to generate

Widget Parameters

ParameterTypeOptionsDefaultDescription
seedInteger0-21474836470Random seed used to control generation results
qualityOptionlow, medium, highlowImage quality setting, affects cost and generation time
backgroundOptionopaque, transparentopaqueWhether the returned image has a background
sizeOptionauto, 1024x1024, 1024x1536, 1536x1024autoSize of the generated image
nInteger1-81Number of images to generate

Optional Parameters

ParameterTypeOptionsDefaultDescription
imageImageAny image inputNoneOptional reference image for image editing
maskMaskMask inputNoneOptional mask for inpainting (white areas will be replaced)

Usage Examples

Text-to-Image Example

The image below contains a simple text-to-image workflow. Please download the image and drag it into ComfyUI to load the corresponding workflow.
ComfyUI openai-gpt-image-1 workflow
The corresponding workflow is very simple: ComfyUI openai-gpt-image-1 workflow example You only need to load the OpenAI GPT-Image-1 node, input the description of the image you want to generate in the prompt node, connect a Save Image node, and then run the workflow.

Image-to-Image Example

The image below contains a simple image-to-image workflow. Please download the image and drag it into ComfyUI to load the corresponding workflow.
ComfyUI openai-gpt-image-1 workflow
We will use the image below as input:
ComfyUI openai-gpt-image-1 workflow input
In this workflow, we use the OpenAI GPT-Image-1 node to generate images and the Load Image node to load the input image, then connect it to the image input of the OpenAI GPT-Image-1 node. ComfyUI openai-gpt-image-1 workflow example

Multiple Image Input Example

Please download the image below and drag it into ComfyUI to load the corresponding workflow.
Multiple Image Input Example
Use the hat image below as an additional input image.
Hat
The corresponding workflow is shown in the image below: Multiple Image Input Example The Batch Images node is used to load multiple images into the OpenAI GPT-Image-1 node.

Inpainting Workflow

GPT-Image-1 also supports image editing functionality, allowing you to specify areas to replace using a mask. Below is a simple inpainting workflow example: Download the image below and drag it into ComfyUI to load the corresponding workflow. We will continue to use the input image from the image-to-image workflow section.
ComfyUI openai-gpt-image-1 workflow
The corresponding workflow is shown in the image ComfyUI openai-gpt-image-1 workflow example Compared to the image-to-image workflow, we use the MaskEditor in the Load Image node through the right-click menu to draw a mask, then connect it to the mask input of the OpenAI GPT-Image-1 node to complete the workflow. Notes
  • The mask and image must be the same size
  • When inputting large images, the node will automatically resize the image to an appropriate size

FAQs

Please update your ComfyUI to the latest version (the latest commit or the latest desktop version). We may add more API support in the future, and the corresponding nodes will be updated, so please keep your ComfyUI up to date.
Please note that you need to distinguish between the nightly version and the release version. In some cases, the latest release version may not be updated in time compared to the nightly version. Since we are still iterating quickly, please ensure you are using the latest version when you cannot find the corresponding node.
API access requires that your current request is based on a secure network environment. The current requirements for API access are as follows:
  • The local network only allows access from 127.0.0.1 or localhost, which may mean that you cannot use the API Nodes in a ComfyUI service started with the --listen parameter in a LAN environment.
  • Able to access our API service normally (a proxy service may be required in some regions).
  • Your account does not have enough credits.
  • Currently, only 127.0.0.1 or localhost access is supported.
  • Ensure your account has enough credits.
API Nodes require credits for API calls to closed-source models, so they do not support free usage.
Please refer to the following documentation:
  1. Comfy Account: Find the User section in the settings menu to log in.
  2. Credits: After logging in, the settings interface will show the credits menu. You can purchase credits in SettingsCredits. We use a prepaid system, so there will be no unexpected charges.
  3. Complete the payment through Stripe.
  4. Check if the credits have been updated. If not, try restarting or refreshing the page.
Currently, we do not support refunds for credits. If you believe there is an error resulting in unused balance due to technical issues, please contact support.
Credits cannot go negative, so please ensure you have enough credits before making the corresponding API calls.
Please visit the Credits menu after logging in to check the corresponding credits.
Currently, the API Nodes are still in the testing phase and do not support this feature yet, but we have considered adding it.
No, your credits do not expire.
No, your credits cannot be transferred to other users and are limited to the currently logged-in account, but we do not restrict the number of devices that can log in.
We do not limit the number of devices that can log in; you can use your account anywhere you want.
Email a request to support@comfy.org and we will delete your information
I