Phase 6: ComfyUI — Workflow Engine · 60 min · Python · Docker · RunPod Serverless
ComfyUI Production Deployment
Docker, RunPod Serverless, worker pools, GPU routing, S3 uploads — ComfyUI in production is a distributed system.
Hiring signal: ComfyUI production deployment (Docker, RunPod Serverless, worker pools, GPU routing) is the most advanced ComfyUI skill — it separates infrastructure engineers from workflow designers.
What you will learn
- Package ComfyUI + models + custom nodes into a reproducible Docker image
- Deploy ComfyUI Docker image to RunPod Serverless as a serverless endpoint
- Manage worker pools: Redis/SQS queues, concurrent job handling, GPU pool routing
- Implement warm pools and output management: upload to S3, return URLs
The Problem
A team runs ComfyUI on a local GPU. It works for development, but production needs:
- Scalability: handle 100 concurrent generation requests
- Reliability: auto-restart on crash, health checks
- Cost efficiency: scale to zero when idle, spin up on demand
- Output management: upload to S3, return URLs (not local file paths)
- Model management: pre-load models in Docker image for fast cold starts
ComfyUI production deployment is the most advanced ComfyUI skill — it separates infrastructure engineers from workflow designers.
What you'll build
Package ComfyUI + models + custom nodes into a Docker image. Deploy to RunPod Serverless as a serverless endpoint. Manage worker pools with Redis queues. Implement warm pools and S3 output management.
Docker Packaging
Dockerfile
FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
# Install ComfyUI
WORKDIR /app
RUN git clone https://github.com/comfyanonymous/ComfyUI.git
WORKDIR /app/ComfyUI
RUN pip install -r requirements.txt
# Copy models (pre-loaded for fast cold start)
COPY models/ /app/ComfyUI/models/
# Copy custom nodes (pinned by hash)
COPY custom_nodes/ /app/ComfyUI/custom_nodes/
# Copy handler
COPY handler.py /app/ComfyUI/handler.py
EXPOSE 8188
CMD ["python", "main.py", "--listen", "0.0.0.0", "--port", "8188"]
Model Management
# Pre-load models in Docker for fast cold starts
# models/
# ├── checkpoints/
# │ ├── sd_xl_base_1.0.safetensors # 6.9 GB
# │ └── sd_xl_refiner_1.0.safetensors # 6.9 GB
# ├── loras/
# │ ├── add_detail.safetensors
# │ └── film_grain.safetensors
# └── vae/
# └── sdxl_vae.safetensors
# Docker image size: ~20-40 GB (models included)
# Cold start: ~10s (models pre-loaded)
# Without pre-loading: ~60s (download from HuggingFace)
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers RunPod Serverless Deployment, Worker Pool Architecture, GPU Routing, Warm Pools, S3 Output Management, Key Takeaways, What's Next — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy