---
title: "Deploy Comfy UI (Updated)"
description: "Modular node-based AI image generation workspace for Stable Diffusion."
category: "Other"
url: https://railway.com/deploy/comfyui
---

# Deploy Comfy UI (Updated)

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

**[Deploy Comfy UI (Updated) on Railway](https://railway.com/template/comfyui)**

- **Category:** Other
- **Total deploys:** 3

## Template content

### comfyui

- **Source:** arloodots/comfyui
- **Public domain:** Yes

## Documentation

# 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

* [Official Documentation](https://github.com/comfyanonymous/ComfyUI)
* [GitHub Repository](https://github.com/arloodots/comfyui)

### 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:

```env
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:

```text
/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.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/comfyui
