ComfyUI can be run as a headless server for production environments where the web interface is not needed. This guide covers the command-line options and configurations for running ComfyUI in headless mode.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Comfy-Org/ComfyUI/llms.txt
Use this file to discover all available pages before exploring further.
Basic Headless Setup
To run ComfyUI as a headless server:By default, ComfyUI only listens on
127.0.0.1 (localhost). Use --listen 0.0.0.0 to accept external connections.Essential Command-Line Options
Network Configuration
IP address to listen on. Use
0.0.0.0 for all IPv4 interfaces or 0.0.0.0,:: for both IPv4 and IPv6.Set the listen port.
Suppress server output logs.
Security Options
Path to TLS key file for HTTPS support.
Path to TLS certificate file for HTTPS support.
Enable CORS with optional origin. Use
* to allow all origins.Maximum upload size in MB.
Directory Configuration
Set the ComfyUI base directory for all subdirectories (models, custom_nodes, input, output, temp, user).
Set the output directory. Overrides
--base-directory.Set the input directory. Overrides
--base-directory.Set the temp directory. Overrides
--base-directory.Set the user directory. Overrides
--base-directory.Load additional model path configuration files.
GPU and Performance Options
VRAM Management
Reserve VRAM in GB for OS/other software.
GPU Selection
Set CUDA device ID. Other devices will be hidden.
Set default device ID while keeping other devices visible.
Precision Options
Attention Mechanisms
Caching Options
- Classic Cache
- LRU Cache
- RAM Pressure
- No Cache
Custom Nodes and Extensions
Disable loading all custom nodes.
Specify custom node folders to load even when
--disable-all-custom-nodes is enabled.Disable API nodes that communicate with external services.
Logging and Debugging
Set logging level: DEBUG, INFO, WARNING, ERROR, or CRITICAL.
Send process output to stdout instead of stderr.
Multi-User Mode
Enable per-user storage for multi-tenant environments.
Preview Options
Default preview method:
none, auto, latent2rgb, or taesd.Maximum preview size for sampler nodes.
Production Example
Here’s a complete example for a production headless server:production_server.sh
Platform-Specific Options
AMD GPUs (ROCm)
Intel GPUs
DirectML (Windows)
Memory Optimizations
Dynamic VRAM
Async Offload
Smart Memory
Pinned Memory
Next Steps
Python Integration
Learn how to integrate ComfyUI into Python applications
Docker Deployment
Deploy ComfyUI using containers