This source did not publish a separate summary. Review SKILL.md before using the skill.
SKILL.md
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.
GET /workflows → list all workflows
POST /workflows → register new workflow
GET /workflows/:id → workflow details + input schema
PUT /workflows/:id → update workflow
DELETE /workflows/:id → remove workflow
Jobs
POST /jobs → create job (returns jobId immediately)
GET /jobs/:jobId → status + progress + outputs
GET /jobs/:jobId/logs → sanitized execution logs
POST /jobs/:jobId/cancel → request cancellation
GET /jobs → list jobs (filters: status, workflowId, after, before, limit)
Outputs
GET /outputs/:jobId → list output files + metadata
GET /outputs/:jobId/:file → download/stream file
Input Validation: Zod schemas on every endpoint; max size/batch enforced
Comfyui Integration
The gateway communicates with ComfyUI via its native HTTP API:
ComfyUI Endpoint
Gateway Usage
POST /prompt
Submit rendered workflow
GET /history/{id}
Poll job completion
GET /view?filename=...
Download generated images
GET /object_info
Discover available nodes/models
WS /ws?clientId=...
Real-time progress (optional)
The client auto-detects ComfyUI version and adapts:
Tries WebSocket first for progress, falls back to polling
Handles both /history response formats
Detects OOM errors and classifies them with recommendations
Cache Strategy
Cache key = SHA-256 of workflowId + sorted(inputs) + sorted(params) + checkpoint.
On cache hit, the gateway returns a "virtual" job with pre-existing outputs — no GPU
computation needed. Cache is stored alongside job data in the DB with configurable TTL.
Error Classification
Error Code
Meaning
Retry?
COMFYUI_UNREACHABLE
Cannot connect to ComfyUI
Yes (with backoff)
COMFYUI_OOM
Out of memory on GPU
No (reduce dimensions)
COMFYUI_TIMEOUT
Execution exceeded timeout
Maybe (increase timeout)
COMFYUI_NODE_ERROR
Node execution failed
No (check workflow)
VALIDATION_ERROR
Invalid inputs
No (fix request)
WORKFLOW_NOT_FOUND
Unknown workflowId
No (register workflow)
RATE_LIMITED
Too many requests
Yes (wait)
AUTH_FAILED
Invalid/missing credentials
No (fix auth)
CACHE_HIT
(Not an error) Served from cache
N/A
Bundled Workflows
Three production-ready workflow templates are included: