In this guide you will learn:
- →Set up a clean local development environment using standard repository paths
- →Build and bundle complex workflows for deployment
- →Deploy ComfyUI to cloud providers like RunPod, Modal, and Replicate
- →Integrate CI/CD pipelines with GitHub Actions for automated updates
- →Secure and monitor production-level AI endpoints
ComfyUI Deployment Guide: From Local to Production
Deploying ComfyUI isn't just about running a script—it's about building a robust, repeatable infrastructure for AI generation. Whether you're building a private creative studio or a public-facing API, this guide covers the engineering required to move from experimental workflows to production power.
:::stats :::stat 16GB+ | Recommended VRAM :::stat 18 min | Reading Time :::stat Docker | Scale Method :::stat Production | Readiness :::
#1 — Overview
ComfyUI is the most efficient interface for professional AI generation due to its stateless execution model. Unlike heavy UIs, ComfyUI can be run as a headless API, allowing you to trigger complex workflows (Image, Video, Audio) via JSON requests.
Benefits of Deployment
- →Scalability: Run multiple nodes to handle high batch volumes.
- →Portability: Move workflows between local machines and cloud GPUs in seconds.
- →Independence: Decouple the creative process (workflow building) from the inference process (scaling).
Hardware Partner
Running these workflows? ComputeAtlas.ai helps you find the right GPU
Optimization is only half the battle. Get precise VRAM benchmarks and hardware recommendations tailored for ComfyUI.
Check GPU Prices →#2 — Prerequisites
Before deploying, ensure your environment matches the production target:
- →Python 3.10.x: Essential for custom node compatibility.
- →NVIDIA GPU Drivers: Latest CUDA 12.1+ supported drivers.
- →Git: For version control and dependency management.
- →Repo Structure: We recommend the following standard layout (available in this repository):
#3 — Local Installation
Standardize your local setup to ensure "it just works" when moving to the cloud.
:::tip Use Symbolic Links
For large model files, use mklink (Windows) or ln -s (Linux) to point models/ to a shared drive. This prevents duplicating multi-GB checkpoints across your repo.
:::
#4 — Custom Node Installation
Most workflows require custom nodes. We recommend managing these specifically via the custom_nodes/ folder.
- →Manual Install: Clone the node repo directly into
custom_nodes/. - →Manager Install: Use the ComfyUI Manager (cloned into
custom_nodes/) for one-click updates.
#5 — Packaging Workflows
To deploy a workflow, you must export it as an API-formatted JSON.
- →In ComfyUI, enable "Dev mode" in settings.
- →Click "Save (API Format)".
- →Store this file in
/workflows/in your repository.
:::warning Regular Save vs API Format A standard "Save" includes UI metadata like node positions. The "API Format" removes this, making it significantly smaller and faster for headless execution. :::
#6 — Deployment Options
Local Server
Run with --listen to accept requests from your local network.
Cloud Deployment
- →Docker: Containerize the entire environment for Kubernetes or AWS.
- →RunPod / Lambda: Best for manual scaling and long-running GPU sessions.
- →Modal: Ideal for "serverless" deployments—pay only for the seconds you generate.
#7 — Running Production APIs
Once deployed, interact with ComfyUI via the /prompt endpoint. Your request body should contain the JSON from /workflows/.
:::note Securing Access Always run ComfyUI behind a reverse proxy (like Nginx) or a VPN. Do not expose port 8188 directly to the public internet. :::
#8 — CI/CD Integration
Use GitHub Actions to keep your production server synced with your repository.
Example Pipeline Logic:
- →Push new model to
models/or workflow toworkflows/. - →GitHub Action triggers a webhook.
- →Server executes a
git pulland restarts the ComfyUI service.
#9 — Monitoring & Logging
Production deployments require visibility into GPU usage and error rates.
- →NVIDIA SMI: Monitor VRAM usage (
nvidia-smi -l 1). - →Standard Logs: Capture
stdoutto a file in/scripts/logs/. - →Latency Tracking: Measure the time between
/promptsubmission and file output.
#10 — Troubleshooting
:::warning Avoid "OOM" Errors If your API returns a 500 error during generation, check the console for "Out of Memory". Reduce your resolution or use a lower-bit quantized model (GGUF). :::
Common Node Errors:
- →
ImportError: Ensure you've runpip install -r requirements.txtinside the specific custom node's folder. - →
Node not found: Verify the folder name incustom_nodes/matches exactly.
#11 — Next Steps
- →Add Models: Populate
/models/checkpoints/with FLUX or SDXL models. - →Share: Use
/scripts/export_env.shto share your exact environment with teammates. - →Scale: Integrate with our Hardware Estimator to find the best cloud GPU for your budget.
#References
- →Official ComfyUI Docs
- →BlackMORE Ops Setup Guide
- →DiffHub Installation
- →ComfyUI-Deploy Extension
- →RunPod Blog
Hardware Partner
Running these workflows? ComputeAtlas.ai helps you find the right GPU
Optimization is only half the battle. Get precise VRAM benchmarks and hardware recommendations tailored for ComfyUI.
Check GPU Prices →