No description
- Python 50.6%
- Vue 32.9%
- JavaScript 9.2%
- HTML 4.6%
- CSS 1.5%
- Other 1.2%
- Flatten multi-select download ZIP: output files at root level without
per-task folders, with #{completed_index} collision disambiguation
- Add batch re-execute button for selected completed/failed tasks via
/api/tasks/batch-add endpoint; extract shared buildRequeuePayload utility
- Add task list sorting by input image filename with persist-to-localStorage
el-select dropdown (default / asc / desc, natural order)
- Refactor rerunTask to use shared utility, add 34 frontend tests
|
||
|---|---|---|
| .claude | ||
| backend | ||
| frontend | ||
| tests | ||
| .gitignore | ||
| README.md | ||
| requirements.txt | ||
| run.bat | ||
| run.sh | ||
ComfyUI 自动化工具
一个带有 WebUI 界面的 ComfyUI 任务自动化工具,支持任务排队、自动重试和结果预览。
功能特性
- API 文件管理 - 上传和管理 ComfyUI API JSON 文件
- 图片导入 - 可视化选择 LoadImage 节点并导入图片
- 任务队列 - 支持多个任务排队,自动依次执行
- 自动重试 - 检测到纯黑图片或任务失败时自动重试(最多3次)
- 结果预览 - 支持预览和下载生成的图片
- ComfyUI 状态 - 实时显示 ComfyUI 队列状态
快速开始
环境要求
- Python 3.10+
- Node.js 18+
- ComfyUI(需要运行在 http://127.0.0.1:8188)
安装
1. 安装 Python
- 下载 Python 3.10+:https://www.python.org/downloads/
- 安装时勾选 "Add Python to PATH"
- 安装完成后打开终端验证:
python --version
2. 安装 Node.js
- 下载 Node.js 18+:https://nodejs.org/
- 安装完成后打开终端验证:
node --version
3. 安装项目依赖
# 进入项目目录(请替换为实际路径)
cd D:\Program-Files\auto-comfyui
# 安装后端依赖
pip install -r requirements.txt
# 安装前端依赖
cd frontend
npm install
也可以跳过手动安装,启动脚本会在依赖缺失时自动安装。
启动
统一启动脚本会同时启动后端和前端:
Linux / macOS
chmod +x run.sh
./run.sh
Windows
双击 run.bat,或在项目根目录执行:
.\run.bat
打开浏览器访问 http://localhost:3000
手动启动(备用)
注意:后端必须从项目根目录启动,不能在 backend 文件夹内启动。
打开 两个 终端窗口:
终端 1 - 启动后端(端口 8000):
cd D:\Program-Files\auto-comfyui
python -m uvicorn backend.main:app --host 0.0.0.0 --port 8000
终端 2 - 启动前端(端口 3000):
cd D:\Program-Files\auto-comfyui\frontend
npm run dev
打开浏览器访问 http://localhost:3000
使用流程
- 上传 API 文件 - 在首页上传 ComfyUI 导出的 API JSON 文件
- 选择节点 - 系统会自动选择"添加模特"节点(或其他指定节点)
- 导入图片 - 上传需要使用的图片
- 添加到队列 - 点击添加到任务队列
- 执行任务 - 切换到任务队列页面,点击"开始执行"
项目结构
auto-comfyui/
├── backend/
│ ├── main.py # FastAPI 后端入口
│ ├── parser.py # API 文件解析器
│ ├── comfy_client.py # ComfyUI API 客户端
│ ├── scheduler.py # 任务调度器
│ ├── image_checker.py # 图片检测器(纯黑图片识别)
│ └── models.py # 数据模型
├── frontend/
│ └── src/
│ ├── views/ # 页面组件
│ └── router/ # 路由配置
├── data/ # 数据存储目录
│ ├── api_files/ # 上传的 API 文件
│ ├── input_images/ # 上传的输入图片
│ └── output/ # 输出图片
└── requirements.txt # Python 依赖
配置
修改 ComfyUI 地址
在首页可以修改 ComfyUI 的连接地址(默认 http://127.0.0.1:8188)
修改端口
- 后端:修改 backend/main.py 中的端口或启动命令
- 前端:修改 frontend/vite.config.js 中的端口
注意事项
- 确保 ComfyUI 已启动并可访问
- 上传的 API 文件中的 LoadImage 节点图片路径需要正确
- 任务执行过程中请勿关闭 ComfyUI
技术栈
- 后端:FastAPI + Python
- 前端:Vue 3 + Element Plus
- 图片检测:Pillow + NumPy
License
MIT