Deploy Comfy UI
Self-hosted node-based UI for Stable Diffusion image generation.
comfyui-railway
Just deployed
/root/ComfyUI/models
Deploy and Host ComfyUI on Railway
ComfyUI is a free, open-source node-based UI for Stable Diffusion image generation. It lets you build and run advanced AI image workflows using a visual graph editor, with support for ControlNet, LoRA, custom nodes, FLUX, and more — giving you full control over your image generation pipeline.
About Hosting ComfyUI
Hosting ComfyUI requires running its Python-based server alongside persistent storage for model checkpoints. Models for Stable Diffusion, FLUX, and LoRA typically range from 2–7 GB each and must be available on the filesystem at startup. Railway provisions a persistent volume for model storage and exposes ComfyUI's web interface over a public HTTPS URL automatically. No GPU is required to run ComfyUI on Railway — CPU mode is supported out of the box, though generation will be slower than on a GPU-enabled instance.
Common Use Cases
- Building and running advanced Stable Diffusion workflows with ControlNet, LoRA, and upscaling pipelines
- Hosting a shared AI image generation server for a team, community, or client project
- Automating image generation via ComfyUI's built-in REST API for integration with other apps and agents
Dependencies for ComfyUI Hosting
- Persistent Volume — required for storing model checkpoints, LoRA weights, ControlNet models, and generated outputs across restarts
- Stable Diffusion Checkpoints — model files (
.safetensorsor.ckpt) must be uploaded to the volume before generating images
Deployment Dependencies
- ComfyUI GitHub Repository
- ComfyUI Wiki & Documentation
- Stable Diffusion Models — Civitai
- FLUX Models — Hugging Face
- Railway Volumes Documentation
Implementation Details
ComfyUI is started with --listen 0.0.0.0 and --enable-cors-header to allow external access through Railway's proxy. CPU mode is enabled by default via --cpu. To use a GPU Railway instance, remove the --cpu flag from the service's CLI_ARGS variable.
After first deploy, upload models to the volume at /comfyui/models/checkpoints/ using Railway's volume browser or SSH. ComfyUI will detect them automatically on the next restart.
Why Deploy ComfyUI on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying ComfyUI on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
comfyui-railway
Amritasha/comfyui-railwayHF_TOKEN
