11 min read

Self-Host ComfyUI: Run Stable Diffusion From Anywhere (2026)

Install ComfyUI with Docker, generate your first image, and access it securely from any device with a Localtonet tunnel. No cloud fees, no port forwarding

ComfyUI ยท Stable Diffusion ยท Self-Host ยท Remote Access ยท 2026

Cloud image generators charge per image, cap your monthly credits, and keep a copy of every prompt you type. ComfyUI, the node-based interface with over 122,000 GitHub stars, runs Stable Diffusion, SDXL, and Flux entirely on your own GPU, with no subscription and no usage limit beyond your hardware. The catch: ComfyUI was built to run on your local network, not to be reached from your phone on the road. This guide covers installing ComfyUI with Docker, generating your first image, and making it securely reachable from anywhere with a Localtonet tunnel.

SD 1.5, SDXL, SD3, and Flux support No subscription, no per-image cost Remote access via Localtonet, no port forwarding

Why Self-Host Your Own Image Generator

Every prompt you type into a cloud AI image tool passes through someone else's server. Every image you generate counts against a monthly credit limit, and every subscription tier draws a line between what you can and cannot do. None of that is a technical limitation, it is a business model.

ComfyUI removes all three constraints at once: your prompts never leave your machine, your only limit is how long you are willing to wait for your GPU to render, and there is no bill at the end of the month.

The only thing standing between you and a private, unlimited image generator is a GPU and about twenty minutes of setup.

What Is ComfyUI?

ComfyUI is an open-source, node-based interface for running diffusion models. Instead of a single text box, you build a visual graph: a checkpoint loader feeds a CLIP text encoder, which feeds a KSampler, which feeds a VAE decoder, which saves your image. Every stage is a node you can inspect, swap, or rewire, which is why ComfyUI is the interface of choice for anyone doing more than typing a prompt and clicking generate.

๐Ÿงฉ Node-based workflows Every step of generation is a visible, rewireable node. Save entire pipelines as JSON files and share them exactly as built.
๐Ÿ–ผ๏ธ Runs every major model Stable Diffusion 1.5, SDXL, SD3, and Flux, plus the major open video diffusion models, all supported.
๐Ÿ”Œ Massive custom node ecosystem ComfyUI Manager installs community nodes for ControlNet, LoRA stacking, upscaling, face tools, and animation from inside the UI.
โšก Efficient VRAM management ComfyUI is known for running larger models on the same hardware compared to other interfaces, which matters most on consumer GPUs.
Check your VRAM before you install

SD 1.5 runs comfortably on 8GB of VRAM or less. SDXL wants 12GB minimum, an RTX 3060 12GB or RTX 4060 Ti 16GB is a reasonable starting point. Flux is the heaviest of the three, 24GB is the comfortable range, which points toward an RTX 4090 or better. You can run all three on less VRAM using FP8 checkpoints and low-VRAM modes, just expect slower generation.

Install ComfyUI With Docker

ComfyUI does not ship an official Docker image, the project's own documentation points to community-maintained images instead. yanwk/comfyui-boot is one of the more actively maintained ones and is a reasonable starting point.

1

Confirm your GPU is visible to Docker

Requires the NVIDIA Container Toolkit installed on the host.

Terminal
docker run --rm --gpus all nvidia/cuda:12.0-base nvidia-smi
2

Pull and run the ComfyUI container

This mounts persistent folders for models, output, and custom nodes so nothing is lost on container restart.

Terminal
docker pull yanwk/comfyui-boot:cu126-slim
docker run -d --gpus all -p 8188:8188 \
  -v comfyui_models:/root/comfy/ComfyUI/models \
  -v comfyui_output:/root/comfy/ComfyUI/output \
  -v comfyui_custom_nodes:/root/comfy/ComfyUI/custom_nodes \
  --name comfyui --restart unless-stopped \
  yanwk/comfyui-boot:cu126-slim
3

Open ComfyUI locally

Visit http://localhost:8188 on the machine running Docker. You should see the default node graph.

4

Download a checkpoint model

Install ComfyUI Manager from inside the UI, then use it to pull a checkpoint from Hugging Face or CivitAI directly into the models folder. Start with an SDXL base checkpoint if your VRAM allows it.

5

Run the default workflow

Load the default text-to-image graph, type a prompt into the CLIP Text Encode node, and press Queue Prompt. Your first image lands in the output folder.

Remote Access With Localtonet

By default the container above already binds to 0.0.0.0 inside Docker, which is what makes port 8188 reachable outside the container in the first place. If you installed ComfyUI manually instead of with Docker, add --listen 0.0.0.0 to your launch command, ComfyUI binds to 127.0.0.1 only by default, which blocks every connection that is not from the same machine.

1

Install Localtonet on the machine running ComfyUI

Download from localtonet.com/download and authenticate with your AuthToken from Dashboard โ†’ My Tokens.

2

Create an HTTP tunnel

Go to localtonet.com/tunnel/http. Set the local IP to 127.0.0.1 and the port to 8188. Click Create, then Start.

3

Open the public URL from any device

The dashboard shows a public HTTPS address. Open it from your phone, a laptop at work, or anywhere else, ComfyUI loads exactly as it does locally.

โš ๏ธ Most tutorials skip this step: ComfyUI has no login screen

ComfyUI ships with no built-in authentication. Anyone who guesses or finds your tunnel URL can queue prompts on your GPU, and custom nodes can execute arbitrary Python, so an untrusted visitor is a real risk, not a theoretical one. Turn on basic authentication for the tunnel before you share the URL with anyone or leave it running unattended: in the Localtonet dashboard, open the tunnel's settings and enable Basic Auth with a username and password. Every visitor is prompted for credentials before the request ever reaches ComfyUI.

๐Ÿ”’ Security Beyond the Login Prompt

๐Ÿ”‘ Basic Auth is your first line of defense

With Basic Auth enabled on the tunnel, credential checking happens before traffic reaches your machine. This is the single highest-impact step covered in this guide.

๐Ÿงฉ Review custom nodes before installing them

ComfyUI Manager makes installing community nodes a one-click action, and most nodes are safe, but a node is Python code with full access to the machine it runs on. Stick to nodes with an active repository and a real user base before installing one on a machine you also use for anything else.

๐ŸŒ Consider a dedicated custom domain

If you plan to use ComfyUI remotely on an ongoing basis rather than for a one-off session, map a custom domain to the tunnel instead of sharing the default subdomain. It is easier to revoke access to a domain you control than to rotate a shared link.

Keep It Running Permanently

A container with --restart unless-stopped already survives a Docker restart. To survive a full machine reboot, the Localtonet client itself also needs to start automatically. Run localtonet --install-service --start-service once, and both ComfyUI's container and its public tunnel come back on their own after every reboot, no manual intervention required.

Self-Hosted ComfyUI vs. Cloud Image Generators

FeatureCloud AI image toolsSelf-hosted ComfyUI + Localtonet
Cost per imageCredits or subscription tiersElectricity only, after the GPU
Prompt privacyProcessed on the provider's serversNever leaves your machine
Model choiceWhatever the provider offersAny open checkpoint, LoRA, or custom node
Generation speedShared queue, can throttle at peak timesLimited only by your own GPU
Setup effortNone, sign up and goA GPU and about twenty minutes

The honest trade-off: cloud tools win on convenience, there is nothing to install and nothing to maintain, and if you only generate a handful of images a month the free tier of a cloud tool may genuinely be cheaper than running a GPU. Self-hosted ComfyUI wins the moment you generate regularly or care about where your prompts end up, at that point the twenty minutes of setup pays for itself quickly.

๐Ÿ›  Tips for Getting the Most Out of ComfyUI

๐Ÿ’พ Save every workflow you like A workflow is just a JSON file. Export the ones that produce good results so you can reload them instantly later.
๐Ÿง  Enable Force High VRAM if you have the headroom Keeps model weights loaded between runs instead of reloading them each time, which speeds up repeated generations.
๐Ÿ“ฑ Try a mobile-friendly frontend ComfyUI's default graph view is built for a mouse and a large screen. A lighter mobile frontend makes queuing a saved workflow from your phone far more practical.
๐ŸŽฏ Organize checkpoints by use case Separate folders for SDXL base models, Flux models, and style-specific LoRAs cut down on scrolling when switching workflows.

Troubleshooting Common Issues

SymptomLikely causeFix
Tunnel connects but the page will not loadComfyUI is bound to 127.0.0.1 onlyConfirm the container publishes 0.0.0.0:8188, or add --listen 0.0.0.0 for a manual install
"CUDA out of memory" errorsModel and workflow exceed available VRAMSwitch to an FP8 checkpoint, lower the batch size, or enable a low-VRAM mode in settings
Custom node fails to load after installMissing Python dependency for that nodeReinstall the node's requirements through ComfyUI Manager, or check its GitHub issues for known conflicts
Generation works locally but times out remotelyLarge image payloads over a slow connectionReduce output resolution for remote sessions, or be patient, Localtonet does not cap upload size

Frequently Asked Questions

Do I need an NVIDIA GPU to run ComfyUI?

NVIDIA GPUs have the widest support and the most mature tooling. AMD and Apple Silicon are also usable through community-maintained builds, but expect more setup friction and generally slower generation than an equivalent NVIDIA card.

Is ComfyUI free?

Yes. ComfyUI itself is open source under the GPLv3 license. Your only real cost is the electricity your GPU uses while generating, and whatever hardware you already own or choose to buy.

Can I access ComfyUI from my phone?

Yes, once it is reachable through a Localtonet HTTP tunnel, any device with a browser can open it. The default node graph is built for a large screen, so consider a mobile-friendly ComfyUI frontend for a smoother phone experience.

Why does ComfyUI need Basic Auth if Localtonet URLs are already private HTTPS links?

An HTTPS link is encrypted in transit, but a URL can still be shared, logged, or guessed. Basic Auth adds a second, independent check so that having the link alone is not enough to reach ComfyUI.

Does my computer need to stay on for remote access to work?

Yes. The tunnel stays connected only as long as the Localtonet client and the ComfyUI container are running on that machine. Running both as background services means they come back automatically after a reboot.

What is the difference between SD 1.5, SDXL, and Flux?

They are different base models with different hardware needs. SD 1.5 is the lightest and runs on 8GB of VRAM or less. SDXL produces higher-resolution, more detailed output and wants 12GB minimum. Flux, from Black Forest Labs, is the newest and most demanding, 24GB is the comfortable range.

Can I run ComfyUI without Docker?

Yes. Clone the ComfyUI repository from GitHub, install its Python requirements, and run main.py directly. Docker is simply the more reproducible path, since models, custom nodes, and dependencies stay isolated from the rest of your system.

Will exposing ComfyUI through a tunnel slow down generation?

No. Generation happens entirely on your GPU. The tunnel only affects how quickly the interface loads and how quickly the finished image transfers back to your device, not the render time itself.

Ready to Run Your Own Private Image Generator?

Install ComfyUI, generate your first image locally, then create a Localtonet HTTP tunnel to reach it from anywhere. Free to start, no credit card required.

Get Started Free โ†’

Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.

support