> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-comfy-docs-comfyapi-search.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAIGPTImage1 - ComfyUI Built-in Node Documentation

> Generates images synchronously through OpenAI's GPT Image endpoint.

Generates images synchronously through OpenAI's GPT Image endpoint. It can create new images from a text prompt or edit existing images when an input image and optional mask are provided. The node supports the `gpt-image-1`, `gpt-image-1.5`, and `gpt-image-2` models and is marked as deprecated.

## Inputs

| Parameter       | Description                                                                                         | Data Type | Required | Range                                                                                                                                                        |
| --------------- | --------------------------------------------------------------------------------------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `prompt`        | Text prompt for GPT Image (default: "")                                                             | STRING    | Yes      | -                                                                                                                                                            |
| `seed`          | Random seed for generation; not implemented yet in backend (default: 0)                             | INT       | No       | 0 to 2147483647                                                                                                                                              |
| `quality`       | Image quality, affects cost and generation time (default: "low")                                    | COMBO     | No       | "low"<br />"medium"<br />"high"                                                                                                                              |
| `background`    | Return image with or without background (default: "auto")                                           | COMBO     | No       | "auto"<br />"opaque"<br />"transparent"                                                                                                                      |
| `size`          | Image size. Select "Custom" to use the custom width and height (GPT Image 2 only) (default: "auto") | COMBO     | No       | "auto"<br />"1024x1024"<br />"1024x1536"<br />"1536x1024"<br />"2048x2048"<br />"2048x1152"<br />"1152x2048"<br />"3840x2160"<br />"2160x3840"<br />"Custom" |
| `n`             | How many images to generate (default: 1)                                                            | INT       | No       | 1 to 8                                                                                                                                                       |
| `image`         | Optional reference image for image editing                                                          | IMAGE     | No       | -                                                                                                                                                            |
| `mask`          | Optional mask for inpainting (white areas will be replaced)                                         | MASK      | No       | -                                                                                                                                                            |
| `model`         | GPT Image model to use (default: "gpt-image-2")                                                     | COMBO     | No       | "gpt-image-1"<br />"gpt-image-1.5"<br />"gpt-image-2"                                                                                                        |
| `custom_width`  | Used only when `size` is "Custom". Must be a multiple of 16 (GPT Image 2 only) (default: 1024)      | INT       | No       | 1024 to 3840, step 16                                                                                                                                        |
| `custom_height` | Used only when `size` is "Custom". Must be a multiple of 16 (GPT Image 2 only) (default: 1024)      | INT       | No       | 1024 to 3840, step 16                                                                                                                                        |

**Parameter Constraints:**

* When `image` is provided, the node uses the image editing endpoint.
* `mask` can only be used when `image` is provided.
* When using `mask`, only single images are supported (batch size must be 1).
* `mask` and `image` must be the same size.
* Custom resolution (`size` = "Custom") is only supported by the `gpt-image-2` model.
* Custom width and height must be multiples of 16.
* The longest edge of a custom resolution must be 3840 or less.
* Custom resolution aspect ratio must not exceed 3:1.
* Custom resolution total pixels must be between 655,360 and 8,294,400.
* Transparent background is not supported for the `gpt-image-2` model.
* The `gpt-image-1` and `gpt-image-1.5` models only support the sizes `auto`, `1024x1024`, `1024x1536`, and `1536x1024`. Other sizes are only supported by the `gpt-image-2` model.

## Outputs

| Output Name | Description                                                                                                                                                     | Data Type |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `IMAGE`     | Generated or edited image(s). Multiple images are returned as a batch; if returned images have different dimensions, they are resized to match the first image. | IMAGE     |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/OpenAIGPTImage1/en.md)

***

**Source fingerprint (SHA-256):** `bf588bffced6e66536b4cb54655ef6ebb9cf988d9739e3c379a8ebda1486e20a`
