[Chinese below / 中文介绍在下方]
gpt-image-1-webui is a Gradio-based web UI for OpenAI gpt-image-1(which is the gpt-4o's web image generation technique) and compatible image generation/editing APIs. Users can generate or edit images with prompts via a simple web interface, with support for model selection, custom size/format/quality.
- Supports multiple image models (e.g. gpt-image-1, dall-e-3)
- Transparent/opaque background, PNG output
- Simple and user-friendly web UI
- Reads API_KEY and BASE_URL from config.yaml
- Prompt-based image editing
- Clone this repo:
git clone https://github.com/asasasasasbc/gpt-image-1-webui.git cd gpt-image-1-webui
- Install dependencies:
pip install -r requirements.txt
- Edit the
config.yaml
file in the root directory:API_KEY: "your OpenAI API key" BASE_URL: "" # If you are using API mirror or proxy, type BASE_URL: "https://YOUR_API_MIRROR_WEBSITE/v1"
python app.py
Then open http://127.0.0.1:7860 or your LAN-IP:7860 in your browser.
gpt-image-1-webui 是一个基于 Gradio 的 Web 可视化界面(类似于stable-diffusion-webui),支持 OpenAI最新的gpt-image-1 (即网页版Gpt-4o的文本图片生成) API 及兼容 API 的图片生成与编辑。用户可以通过 Web 页面输入提示词,一键生成或编辑图片。支持多模型选择、自定义图片大小、格式、质量等参数,并适配代理环境。
- 支持多种图片生成与编辑模型(如 gpt-image-1, dall-e-3 等)
- 支持透明/不透明背景,png图片输出
- 简洁的可视化界面,易于使用
- 支持 config.yaml 配置 API_KEY 和 BASE_URL
- 支持图片编辑(基于提示词)
- 克隆本仓库
git clone https://github.com/asasasasasbc/gpt-image-1-webui.git cd gpt-image-1-webui
- 安装依赖
pip install -r requirements.txt
- 配置
config.yaml
编辑仓库根目录config.yaml
,内容如下(用你的密钥和接口替换):API_KEY: "你的 OpenAI API 密钥" BASE_URL: "" # 若使用非官方或者代理API,可写为BASE_URL: "https://XXXXXXXXX/v1"
python app.py
运行后访问 http://127.0.0.1:7860 或局域网IP:7860
欢迎 PR 和建议!/ Pull requests and suggestions are welcome!