Deploy Comfy UI (Updated)
Modular node-based AI image generation workspace for Stable Diffusion.
comfyui
Just deployed
/root/ComfyUI/
Deploy and Host ComfyUI on Railway
ComfyUI is a powerful, node-based graphical user interface for Stable Diffusion and other AI diffusion models. It enables users to construct complex AI image generation workflows visually using a graph-based interface. Designed for artists, developers, and AI enthusiasts, ComfyUI offers granular control over latent space operations, prompt conditioning, and model execution.
About Hosting ComfyUI
Hosting ComfyUI on Railway provisions a dedicated cloud environment to run image generation workflows without relying on local hardware resources. Railway automatically builds the container image using the provided Dockerfile and handles the underlying infrastructure, networking, and security.
Persistent storage is backed by a Railway Volume mounted to store models, checkpoints, and embeddings safely across container restarts. Public HTTP networking is exposed with automatic SSL certificates, allowing secure access to the web interface from anywhere. The deployment can run in CPU mode by default or scale up to dedicated GPU instances on Railway for accelerated model inference.
Common Use Cases
- AI Image Generation and Prototyping
- Custom Stable Diffusion Workflow Automation
- Model Fine-Tuning and Latent Space Experimentation
Dependencies for ComfyUI Hosting
| Dependency | Purpose | Required |
|---|---|---|
| Railway Volume | Persistent storage for downloaded AI models, checkpoints, and VAEs | Yes |
| Hugging Face API | Optional access token to download gated models (such as FLUX) | Optional |
Deployment Dependencies
Implementation Details
Docker
Railway automatically builds the application container using the repository's Dockerfile.
Public Networking
| Proxy Type | Target Port |
|---|---|
| HTTP Proxy | 8188 / ${PORT} |
Environment Variables
| Variable | Required | Description |
|---|---|---|
PORT | Yes | Port where ComfyUI listens. Defaults to 8188. |
CLI_ARGS | No | CLI arguments for ComfyUI. Defaults to --listen 0.0.0.0 --cpu. |
HF_TOKEN | No | Hugging Face token for downloading gated models. Obtain from Hugging Face Settings. |
Raw Editor format:
PORT=8188
CLI_ARGS=--listen 0.0.0.0 --cpu
HF_TOKEN=
Persistent Storage
Persistent storage is required so downloaded models and workflows are not lost when the container restarts or redeploys.
- Open the Railway Service.
- Navigate to Settings -> Volumes.
- Click Add Volume.
- Set the Mount Path to:
/root/ComfyUI/models
Database
No external database service is required for ComfyUI.
Build & Start
Railway automatically builds from the provided Dockerfile. No custom build or start commands are required.
Accessing the Application
- Go to the service settings in Railway.
- Under Networking, click Generate Domain.
- Open the generated URL in your browser to access the ComfyUI node interface.
- No initial admin setup or login credentials are required by default.
Why Deploy ComfyUI on Railway?
Railway provides a simple, scalable, and reliable cloud platform for deploying modern web applications. With automatic builds, seamless variable management, built-in persistent storage, and auto-provisioned SSL, Railway eliminates the operational overhead of server management so you can focus on building and running your workflows.
Template Content
comfyui
arloodots/comfyuiHF_TOKEN
Access huggingface generation models
