OpenAI DALL·E 2 Node
Learn how to use the OpenAI DALL·E 2 API node to generate images in ComfyUI
OpenAI DALL·E 2 is part of the ComfyUI API Nodes series, allowing users to generate images through OpenAI’s DALL·E 2 model.
This node supports:
- Text-to-image generation
- Image editing functionality (inpainting through masks)
Node Overview
The OpenAI DALL·E 2 node generates images synchronously through OpenAI’s image generation API. It receives text prompts and returns images that match the description.
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.
If you find missing nodes when loading the workflow file below, it may be due to the following situations:
- You are not using the latest Development (Nightly) version of ComfyUI.
- You are using the Stable (Release) version or Desktop version of ComfyUI (which does not include the latest feature updates).
- You are using the latest Commit version of ComfyUI, but some nodes failed to import during startup.
Please make sure you have successfully updated ComfyUI to the latest Development (Nightly) version. See: How to Update ComfyUI section to learn how to update ComfyUI.
Parameter Description
Required Parameters
Parameter | Description |
---|---|
prompt | Text prompt describing the image content you want to generate |
Widget Parameters
Parameter | Description | Options/Range | Default Value |
---|---|---|---|
seed | Seed value for image generation (currently not implemented in the backend) | 0 to 2^31-1 | 0 |
size | Output image dimensions | ”256x256”, “512x512”, “1024x1024" | "1024x1024” |
n | Number of images to generate | 1 to 8 | 1 |
Optional Parameters
Parameter | Description | Options/Range | Default Value |
---|---|---|---|
image | Optional reference image for image editing | Any image input | None |
mask | Optional mask for local inpainting | Mask input | None |
Usage Method
Workflow Examples
This API node currently supports two workflows:
- Text to Image
- Inpainting
Image to Image workflow is not supported
Text to Image Example
The image below contains a simple text-to-image workflow. Please download the corresponding image and drag it into ComfyUI to load the workflow.
The corresponding example is very simple
You only need to load the OpenAI DALL·E 2
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.
Inpainting Workflow
DALL·E 2 supports image editing functionality, allowing you to use a mask to specify the area to be replaced. Below is a simple inpainting workflow example:
1. Workflow File Download
Download the image below and drag it into ComfyUI to load the corresponding workflow.
We will use the image below as input:
2. Workflow File Usage Instructions
Since this workflow is relatively simple, if you want to manually implement the corresponding workflow yourself, you can follow the steps below:
- Use the
Load Image
node to load the image - Right-click on the load image node and select
MaskEditor
- In the mask editor, use the brush to draw the area you want to redraw
- Connect the loaded image to the
image
input of the OpenAI DALL·E 2 node - Connect the mask to the
mask
input of the OpenAI DALL·E 2 node - Edit the prompt in the
prompt
node - Run the workflow
Notes
- If you want to use the image editing functionality, you must provide both an image and a mask (both are required)
- The mask and image must be the same size
- When inputting large images, the node will automatically resize the image to an appropriate size
- The URLs returned by the API are valid for a short period, please save the results promptly
- Each generation consumes credits, charged according to image size and quantity
FAQs
Why can't I find the API nodes?
Why can't I find the API nodes?
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.
Why can't I use / log in to the API Nodes?
Why can't I use / log in to the API Nodes?
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
orlocalhost
, 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.
Why can't I use API node even after logging in, or why does it keep asking me to log in while using?
Why can't I use API node even after logging in, or why does it keep asking me to log in while using?
- Currently, only
127.0.0.1
orlocalhost
access is supported. - Ensure your account has enough credits.
Can API Nodes be used for free?
Can API Nodes be used for free?
API Nodes require credits for API calls to closed-source models, so they do not support free usage.
How to purchase credits?
How to purchase credits?
Please refer to the following documentation:
- Comfy Account: Find the
User
section in the settings menu to log in. - Credits: After logging in, the settings interface will show the credits menu. You can purchase credits in
Settings
→Credits
. We use a prepaid system, so there will be no unexpected charges. - Complete the payment through Stripe.
- Check if the credits have been updated. If not, try restarting or refreshing the page.
Are unused credits refundable?
Are unused credits refundable?
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.
Can credits go negative?
Can credits go negative?
Credits cannot go negative, so please ensure you have enough credits before making the corresponding API calls.
Where can I check usage and expenses?
Where can I check usage and expenses?
Please visit the Credits menu after logging in to check the corresponding credits.
Is it possible to use my own API Key?
Is it possible to use my own API Key?
Currently, the API Nodes are still in the testing phase and do not support this feature yet, but we have considered adding it.
Do credits expire?
Do credits expire?
No, your credits do not expire.
Can credits be transferred or shared?
Can credits be transferred or shared?
Can I use the same account on different devices?
Can I use the same account on different devices?
We do not limit the number of devices that can log in; you can use your account anywhere you want.
How can I request for my account or information to be deleted??
How can I request for my account or information to be deleted??
Email a request to support@comfy.org and we will delete your information