Railway

Deploy Comfy UI (Updated)

Modular node-based AI image generation workspace for Stable Diffusion.

Deploy Comfy UI (Updated)

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

DependencyPurposeRequired
Railway VolumePersistent storage for downloaded AI models, checkpoints, and VAEsYes
Hugging Face APIOptional 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 TypeTarget Port
HTTP Proxy8188 / ${PORT}

Environment Variables

VariableRequiredDescription
PORTYesPort where ComfyUI listens. Defaults to 8188.
CLI_ARGSNoCLI arguments for ComfyUI. Defaults to --listen 0.0.0.0 --cpu.
HF_TOKENNoHugging 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.

  1. Open the Railway Service.
  2. Navigate to Settings -> Volumes.
  3. Click Add Volume.
  4. 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

  1. Go to the service settings in Railway.
  2. Under Networking, click Generate Domain.
  3. Open the generated URL in your browser to access the ComfyUI node interface.
  4. 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

More templates in this category

View Template
Rocky Linux
[Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
32
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51