comfyui-gateway
Lets your agent control ComfyUI via an API. It manages workflows, queues, and delivers images, making visual task automation easier.
What it does
This service acts as a gatekeeper for ComfyUI, a program that creates images from text. It organizes image creation tasks, ensures ComfyUI isn't overloaded, and allows other programs to communicate with it securely.
When to use it
- ✓When you want a program to create many images automatically.
- ✓When you need to organize and prioritize image creation.
- ✓When you want ComfyUI to notify other programs when it finishes creating an image.
Example of what to ask your AI
“Create 10 images of a cat using the 'cute_cat' model and notify me when done.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It receives requests to create images, puts them in a queue to avoid overloading ComfyUI, and then sends them to ComfyUI for processing. It can also store the created images and notify other programs.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill comfyui-gatewayOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/comfyui-gateway/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
ComfyUI Gateway
Overview
REST API gateway for ComfyUI servers. Workflow management, job queuing, webhooks, caching, auth, rate limiting, and image delivery (URL + base64).
When to Use This Skill
- When the user mentions "comfyui" or related topics
- When the user mentions "comfy ui" or related topics
- When the user mentions "stable diffusion api gateway" or related topics
- When the user mentions "gateway comfyui" or related topics
- When the user mentions "api gateway imagens" or related topics
- When the user mentions "queue imagens" or related topics
Do Not Use This Skill When
- The task is unrelated to comfyui gateway
- A simpler, more specific tool can handle the request
- The user needs general-purpose assistance without domain expertise
How It Works
A production-grade REST API gateway that transforms any ComfyUI server into a universal, secure, and scalable service. Supports workflow templates with placeholders, job queuing with priorities, webhook callbacks, result caching, and multiple storage backends.
Architecture Overview
┌─────────────┐ ┌──────────────────────────────────┐ ┌──────────┐
│ Clients │────▶│ ComfyUI Gateway │────▶│ ComfyUI │
│ (curl, n8n, │ │ │ │ Server │
│ Claude, │ │ ┌─────────┐ ┌──────────────┐ │ │ (local/ │
│ Lovable, │ │ │ Fastify │ │ BullMQ Queue │ │ │ remote) │
│ Supabase) │ │ │ API │──│ (or in-mem) │ │ └──────────┘
│ │◀────│ └─────────┘ └──────────────┘ │
│ │ │ ┌─────────┐ ┌──────────────┐ │ ┌──────────┐
│ │ │ │ Auth + │ │ Storage │ │────▶│ S3/MinIO │
│ │ │ │ RateL. │ │ (local/S3) │ │ │(optional)│
│ │ │ └─────────┘ └──────────────┘ │ └──────────┘
└─────────────┘ └──────────────────────────────────┘
Components
| Component | Purpose | File(s) |
|---|---|---|
| API Gateway | REST endpoints, validation, CORS | src/api/ |
| Worker | Processes jobs, talks to ComfyUI | src/worker/ |
| ComfyUI Client | HTTP + WebSocket to ComfyUI | src/comfyui/ |
| Workflow Manager | Template storage, placeholder rendering | src/workflows/ |
| Storage Provider | Local disk + S3-compatible | src/storage/ |
| Cache | Hash-based deduplication | src/cache/ |
| Notifier | Webhook with HMAC signing | src/notifications/ |
| Auth | API key + JWT + rate limiting | src/auth/ |
| DB | SQLite (better-sqlite3) or Postgres | src/db/ |
| CLI | Init, add-workflow, run, worker | src/cli/ |
Quick Start
## 1. Install
cd comfyui-gateway
npm install
## 2. Configure
cp .env.example .env
## 3. Initialize
npx tsx src/cli/index.ts init
## 4. Add A Workflow
npx tsx src/cli/index.ts add-workflow ./workflows/sdxl_realism_v1.json \
--id sdxl_realism_v1 --schema ./workflows/sdxl_realism_v1.schema.json
## 5. Start (Api + Worker In One Process)
npm run dev
## Or Separately:
npm run start:api # API only
npm run start:worker # Worker only
Environment Variables
All configuration is via .env — nothing is hardcoded:
| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
API server port |
HOST |
0.0.0.0 |
API bind address |
COMFYUI_URL |
http://127.0.0.1:8188 |
ComfyUI server URL |
COMFYUI_TIMEOUT_MS |
300000 |
Max wait for ComfyUI (5min) |
API_KEYS |
"" |
Comma-separated API keys (key:role) |
JWT_SECRET |
"" |
JWT signing secret (empty = JWT disabled) |
REDIS_URL |
"" |
Redis URL (empty = in-memory queue) |
DATABASE_URL |
./data/gateway.db |
SQLite path or Postgres URL |
STORAGE_PROVIDER |
local |
local or s3 |
STORAGE_LOCAL_PATH |
./data/outputs |
Local output directory |
S3_ENDPOINT |
"" |
S3/MinIO endpoint |
S3_BUCKET |
"" |
S3 bucket name |
S3_ACCESS_KEY |
"" |
S3 access key |
S3_SECRET_KEY |
"" |
S3 secret key |
S3_REGION |
us-east-1 |
S3 region |
WEBHOOK_SECRET |
"" |
HMAC signing secret for webhooks |
WEBHOOK_ALLOWED_DOMAINS |
* |
Comma-separated allowed callback domains |
MAX_CONCURRENCY |
1 |
Parallel jobs per GPU |
MAX_IMAGE_SIZE |
2048 |
Maximum dimension (width or height) |
MAX_BATCH_SIZE |
4 |
Maximum batch size |
CACHE_ENABLED |
true |
Enable result caching |
…
FAQ
What is ComfyUI?
It's a program that uses artificial intelligence to create images from text descriptions.
What is this 'gateway' for?
It helps manage and organize image creation requests, making the process more efficient and secure for those using ComfyUI through other programs.
Can I use this to create any type of image?
Yes, as long as ComfyUI is configured with the necessary models and tools for the type of image you want.
Details
Original description by the author
REST API gateway for ComfyUI servers. Workflow management, job queuing, webhooks, caching, auth, rate limiting, and image delivery (URL + base64).
Popularity
- GitHub stars
- 48k
- Ranking position
- #2596
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
api-connector-builder
Has your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
affaan-m/ECC
api-design
Helps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
affaan-m/ECC
backend-patterns
Helps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.
affaan-m/ECC