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.
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.
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.
Confirm your GPU is visible to Docker
Requires the NVIDIA Container Toolkit installed on the host.
docker run --rm --gpus all nvidia/cuda:12.0-base nvidia-smi
Pull and run the ComfyUI container
This mounts persistent folders for models, output, and custom nodes so nothing is lost on container restart.
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
Open ComfyUI locally
Visit http://localhost:8188 on the machine running Docker. You should see the default node graph.
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.
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.
Install Localtonet on the machine running ComfyUI
Download from localtonet.com/download and authenticate with your AuthToken from Dashboard โ My Tokens.
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.
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.
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
| Feature | Cloud AI image tools | Self-hosted ComfyUI + Localtonet |
|---|---|---|
| Cost per image | Credits or subscription tiers | Electricity only, after the GPU |
| Prompt privacy | Processed on the provider's servers | Never leaves your machine |
| Model choice | Whatever the provider offers | Any open checkpoint, LoRA, or custom node |
| Generation speed | Shared queue, can throttle at peak times | Limited only by your own GPU |
| Setup effort | None, sign up and go | A 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
Troubleshooting Common Issues
| Symptom | Likely cause | Fix |
|---|---|---|
| Tunnel connects but the page will not load | ComfyUI is bound to 127.0.0.1 only | Confirm the container publishes 0.0.0.0:8188, or add --listen 0.0.0.0 for a manual install |
| "CUDA out of memory" errors | Model and workflow exceed available VRAM | Switch to an FP8 checkpoint, lower the batch size, or enable a low-VRAM mode in settings |
| Custom node fails to load after install | Missing Python dependency for that node | Reinstall the node's requirements through ComfyUI Manager, or check its GitHub issues for known conflicts |
| Generation works locally but times out remotely | Large image payloads over a slow connection | Reduce 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 โ