ComfyUI Node
GPT Image 2 Generator
A ComfyUI node in GPT Image 2 with 35 inputs and 2 outputs.
GPT Image 2 Generator
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
- image_9
- image_10
- image_11
- image_12
- image_13
- image_14
- image_15
- image_16
- IMAGE
- INFO_JSON
◄api_key►
◄base_urlhttp://38.145.218.40:12001►
◄model「CS」gpt-image-2►
◄promptA beautiful cat, high resolution, 4k►
◄negative_prompt►
◄resolution2K►
◄aspect_ratio1:1►
◄qualityhigh►
◄n1►
◄seed-1►
◄style_presetnone►
◄enhance_prompttrue►
◄safety_checktrue►
◄response_formatauto►
◄edit_modegenerate►
◄reference_strength0.70►
◄timeout900►
◄infinite_timeouttrue►
◄api_endpointauto►
CategoryGPT Image 2
Inputs (35)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | 必填,输入您的 OpenAI 格式 API Key | |
| base_url | STRING | http://38.145.218.40:12001 | 只填写服务地址即可,例如 http://38.145.218.40:12001;节点会根据 api_endpoint 自动拼接 /v1/images/generations、/v1/images/edits 或 /v1/responses;若你填完整接口也会兼容。 |
| model | STRING | 「CS」gpt-image-2 | 允许自由填写,如 gpt-image-2, openai/gpt-5.4-image-2, 「AZ」gpt-image-2 等 |
| prompt | STRING | A beautiful cat, high resolution, 4k | 正向提示词,必填 |
| negative_prompt | STRING | 负面提示词,可选 | |
| resolution | COMBO | 2K | 基准分辨率档。注意与比例【互斥】:1:1 只有 1K/2K(无 4K);16:9/9:16/4:3/3:4/21:9 只有 2K/4K(无 1K);3:1 只有 4K。auto = 让上游自选(需 aspect_ratio 也为 auto)。所有尺寸均为实测稳定档位,超出的组合会被拦截以避免 502。 |
| aspect_ratio | COMBO | 1:1 | 图像比例:1:1 3:2 2:3 16:9 9:16 4:3 3:4 21:9 1:3 3:1。auto = 按 image_1 输入图比例自动推断(需连接参考图)。 |
| quality | COMBO | high | Quality. auto omits this parameter for maximum compatibility. |
| n | INT | 11–10 | 生成数量,范围 1-10 |
| seed | INT | -1-1–18446744073709550000 | 随机种子,-1 表示随机 |
| style_preset | COMBO | none | 风格预设 |
| enhance_prompt | BOOLEAN | true | 增强提示词,开启后 OpenAI 自动优化提示词 |
| safety_check | BOOLEAN | true | 安全检查,拦截不合规内容 |
| response_format | COMBO | auto | auto = 未选择时优先显式请求 b64_json(避免依赖下载图床图片,减少失败面);也可强制选 url 或 b64_json。 |
| edit_mode | COMBO | generate | 编辑模式:纯生成 / 参考图生图 / 扩图 |
| reference_strength | FLOAT | 0.700–1 | 参考强度,范围 0.0-1.0,仅在 reference 等模式生效 |
| timeout | INT | 90030–7200 | 总超时时间(秒)。GPT-Image-2 在 4K/High 质量下生成常需 5-15 分钟,建议保持 600s 以上;如经常生成 4K 大图请调到 1800s 或更高。 |
| infinite_timeout | BOOLEAN | true | 无限总超时(推荐开启)。开启后底层 read_timeout 不再限制,专门用于规避反向代理 300s 默认超时导致的 502/连接断开;ComfyUI 中断按钮仍然可以随时停止任务。 |
| api_endpoint | COMBO | auto | auto: text uses /v1/images/generations; input images/reference uses /v1/images/edits; can force /v1/responses. |
| image_1opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_2opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_3opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_4opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_5opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_6opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_7opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_8opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_9opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_10opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_11opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_12opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_13opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_14opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_15opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 | |
| image_16opt | IMAGE | 最多支持16张参考图;auto 下会走 /v1/images/edits multipart,强制 generations 时才放入 JSON image 数组 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| INFO_JSON | STRING | — |