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

# OpenAIGPTImage1 - ComfyUI Built-in Node Documentation

> 通过 OpenAI 的 GPT Image 端点同步生成图像。

通过 OpenAI 的 GPT Image 端点同步生成图像。此节点可以根据文本提示创建新图像，或在提供输入图像和可选遮罩时编辑现有图像。它支持 gpt-image-1、gpt-image-1.5 和 gpt-image-2 模型，并已被标记为已弃用。

## 输入

| 参数              | 描述                                                         | 数据类型   | 是否必填 | 范围                                                                                                                                                           |
| --------------- | ---------------------------------------------------------- | ------ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `提示词`           | 用于 GPT Image 的文本提示（默认：""）                                  | STRING | 是    | -                                                                                                                                                            |
| `种子`            | 用于生成的随机种子（默认：0）——尚未在后端实现                                   | INT    | 否    | 0 到 2147483647                                                                                                                                               |
| `质量`            | 图像质量，影响成本和生成时间（默认："low"）                                   | COMBO  | 否    | "low"<br />"medium"<br />"high"                                                                                                                              |
| `背景`            | 返回带背景或不带背景的图像（默认："auto"）                                   | COMBO  | 否    | "auto"<br />"opaque"<br />"transparent"                                                                                                                      |
| `尺寸`            | 图像尺寸。选择"Custom"以使用自定义宽度和高度（仅限 GPT Image 2）（默认："auto"）      | COMBO  | 否    | "auto"<br />"1024x1024"<br />"1024x1536"<br />"1536x1024"<br />"2048x2048"<br />"2048x1152"<br />"1152x2048"<br />"3840x2160"<br />"2160x3840"<br />"Custom" |
| `数量`            | 要生成的图像数量（默认：1）                                             | INT    | 否    | 1 到 8                                                                                                                                                        |
| `参考图像`          | 用于图像编辑的可选参考图像                                              | IMAGE  | 否    | -                                                                                                                                                            |
| `遮罩`            | 用于修复的可选遮罩（白色区域将被替换）                                        | MASK   | 否    | -                                                                                                                                                            |
| `模型`            | 要使用的 GPT Image 模型（默认："gpt-image-2"）                        | COMBO  | 否    | "gpt-image-1"<br />"gpt-image-1.5"<br />"gpt-image-2"                                                                                                        |
| `custom_width`  | 仅在 `size` 为"Custom"时使用。必须是 16 的倍数（仅限 GPT Image 2）（默认：1024） | INT    | 否    | 1024 到 3840，步长 16                                                                                                                                            |
| `custom_height` | 仅在 `size` 为"Custom"时使用。必须是 16 的倍数（仅限 GPT Image 2）（默认：1024） | INT    | 否    | 1024 到 3840，步长 16                                                                                                                                            |

**参数约束：**

* 当提供 `image` 时，节点会切换到图像编辑模式。
* `mask` 只能在提供 `image` 时使用。
* 使用 `mask` 时，仅支持单张图像（批次大小必须为 1）。
* `mask` 和 `image` 必须具有相同尺寸。
* 自定义分辨率（`size` = "Custom"）仅受 gpt-image-2 模型支持。
* 自定义宽度和高度必须是 16 的倍数。
* 自定义分辨率的宽高比不得超过 3:1。
* 自定义分辨率的总像素必须介于 655,360 和 8,294,400 之间。
* gpt-image-2 模型不支持透明背景。
* 大于 1536x1024 的尺寸（例如 2048x2048、3840x2160）仅受 gpt-image-2 模型支持。
* `gpt-image-1` 和 `gpt-image-1.5` 模型仅支持 `auto`、`1024x1024`、`1024x1536` 和 `1536x1024` 这些尺寸。

## 输出

| 输出名称    | 描述        | 数据类型  |
| ------- | --------- | ----- |
| `IMAGE` | 生成或编辑后的图像 | IMAGE |

> 本文档由 AI 生成。如果您发现任何错误或有改进建议，欢迎贡献！ [在 GitHub 上编辑](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/OpenAIGPTImage1/zh.md)

***

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