This project is a fork of comfyui-gpt-image by lceric, enhanced with full Azure OpenAI support.
comfyui-gpt-image ports the official ComfyUI GPT-API node, adding support for customizable api_base, auth_token, and model settings. This fork extends the original project with seamless Azure OpenAI integration.
- 🎸 Support config auth_token, base_url in ComfyUI Settings(^1.2.0),
- 🎸 Configure custom API endpoints (
api_base) - 🎸 Support for authentication tokens (
auth_token) - 🎸 Easily specify different GPT models (
model) - 🎸 Full Azure OpenAI support with automatic detection
- 🎸 Enhanced error handling for both OpenAI and Azure OpenAI
- 🎸 Seamless integration with ComfyUI
- Python 3.10+
- ComfyUI (latest version recommended)
有以下几种方式可以在ComfyUI中安装这个node:
- 在ComfyUI中打开Manager
- 搜索
comfyui-gpt-image或gpt-image - 点击安装
- 重启ComfyUI
将仓库克隆到ComfyUI的custom_nodes目录:
cd ComfyUI/custom_nodes
# 如果您使用的是这个Azure OpenAI增强版本
git clone https://github.com/cjj198909/comfyui-gpt-image-azure.git comfyui-gpt-image
# 或者使用原始版本
git clone https://github.com/lceric/comfyui-gpt-image.git- 从GitHub下载ZIP文件
- 解压到
ComfyUI/custom_nodes/comfyui-gpt-image目录 - 确保文件夹名称为
comfyui-gpt-image
cd ComfyUI/custom_nodes/comfyui-gpt-image
pip install -r requirements.txt重启ComfyUI后,新的GPT node将自动加载并可用。
📖 详细安装指南: 如果遇到安装问题,请查看 INSTALLATION.md 获取完整的安装指导和故障排除。
Here’s a quick look at the GPT-API node inside ComfyUI:
生成图片
编辑图片
After restarting ComfyUI:
- Locate the GPT-API node in the node list.
- Configure your
api_base,auth_token, andmodelparameters as needed. - Connect it to your workflow and start generating content with GPT!
For OpenAI official API, configure:
api_base:https://api.openai.com/v1/auth_token: Your OpenAI API key (sk-xxxx...)model:gpt-image-1or other supported models
For Azure OpenAI, configure:
api_base:https://your-resource-name.openai.azure.com/auth_token: Your Azure OpenAI API keymodel: Your deployment name (e.g.,gpt-image-1)
Important: For Azure OpenAI, the model parameter should be your deployment name, not the model name.
In v1.2.0, support configure api_base, auth_token in the comfyui settings, as shown below:
The configuration in the workflow node is used first. If it is empty, the ComfiyUI configuration is used.
| Parameter | Description |
|---|---|
| api_base | Base URL of your GPT API endpoint (OpenAI or Azure OpenAI). |
| auth_token | Authentication token for secured API access. |
| model | Model name (OpenAI) or deployment name (Azure OpenAI). |
-
找到节点: 在ComfyUI中右键空白区域,搜索 "GPT" 或 "OpenAI",找到 "Ports OpenAI GPT Image 1" 节点
-
添加节点: 双击将节点添加到工作流
-
基本配置:
prompt: "一只可爱的猫咪在花园里玩耍" api_base: "https://api.openai.com/v1/" (OpenAI) 或 "https://your-resource.openai.azure.com/" (Azure) auth_token: "你的API密钥" model: "gpt-image-1" (OpenAI) 或 "你的部署名称" (Azure) -
连接输出: 将节点的IMAGE输出连接到PreviewImage节点
-
运行: 点击Queue Prompt开始生成图像
💡 提示: 首次使用建议先在ComfyUI设置中配置API信息,这样就不需要在每个节点中重复输入。
Node not showing up? Make sure you installed all dependencies and restarted ComfyUI.
API errors?
- Double-check your api_base, auth_token, and model values.
- For Azure OpenAI, ensure your deployment name matches the model parameter.
- Verify your Azure OpenAI resource is properly configured and the model is deployed.
Azure OpenAI 404 errors?
- Check if your deployment name is correct (use deployment name, not model name).
- Ensure your Azure OpenAI resource URL is correct (should end with
.openai.azure.com/). - Verify the model is properly deployed in your Azure OpenAI resource.
OpenAI vs Azure OpenAI configuration:
- OpenAI:
api_baseshould behttps://api.openai.com/v1/ - Azure OpenAI:
api_baseshould behttps://your-resource-name.openai.azure.com/
This project is licensed under the MIT License.
This project is based on comfyui-gpt-image by lceric.
Original Project: lceric/comfyui-gpt-image
Enhancements in this fork:
- Full Azure OpenAI API support with automatic detection
- Enhanced error handling for both OpenAI and Azure OpenAI services
- Improved URL and authentication handling
- Comprehensive documentation for Azure OpenAI integration
ComfyUI - Powerful node-based UI for generative AI.
Thanks to the ComfyUI community for inspiration and support!


