comfyui_private-server
Share your local ComfyUI via a Cloudflare Quick Tunnel with an optional password gate
ComfyUI Private Server
Share your local ComfyUI with anyone, anywhere, using a free Cloudflare Quick Tunnel (*.trycloudflare.com), with an optional password gate enforced by a local reverse proxy.
⚠️ Security consent
Sharing creates a public URL that exposes your entire ComfyUI to anyone who has it including your workflows, models, and file access. Only share with people you trust, and set a password. The web UI shows this warning and requires an acknowledgement before the tunnel can be started.
Features
- One-click Start / Stop and copy URL
- Password protected: an 8-character password is always set, auto-generated when needed
- Server-side password protection
- File logging (
privateserver.log, auto-rotated) records service events and every request - Login rate limiting against repeated failed password attempts
- Auto-downloads the correct
cloudflaredbinary for your OS on first use - Clean shutdown: the tunnel stops when ComfyUI exits
Install
Option 1 - ComfyUI Manager (recommended)
- Open ComfyUI → Manager → Install Custom Nodes.
- Search for "ComfyUI Private Server", select it, and click Install.
- Restart ComfyUI.
Option 2 - Git clone (manual)
-
Clone this repository into your ComfyUI custom nodes folder:
cd ComfyUI/custom_nodes git clone https://github.com/tngklp/comfyui_private-server.git -
Restart ComfyUI. A "Private Server" button appears in the top bar menu.
-
The extension downloads
cloudflaredautomatically (first run only), this can take a moment.
Requires an internet connection and that ComfyUI is reachable at
127.0.0.1:8188(the default). ComfyUI already shipsaiohttp, which is the only runtime dependency.
Usage
- Click Private Server in ComfyUI's menu.
- Read and acknowledge the security warning.
- A random 8-character password is set by default. Type your own and click Save, or click Randomize for a fresh random one.
- Click Start. After a few seconds a
https://*.trycloudflare.comURL appears. - Stop when done. (Also stops automatically if ComfyUI exits.)
Visitors will be asked for a password and then land on your normal ComfyUI interface, with live queue updates over WebSocket.
Configuration
Environment variables (optional). Set them before launching ComfyUI.
| Variable | Default | Purpose |
|----------|---------|---------|
| PRIVATESERVER_TARGET_URL | http://127.0.0.1:8188 | Local ComfyUI address to forward to |
| PRIVATESERVER_PROXY_HOST | 127.0.0.1 | Proxy bind host (keep loopback) |
| PRIVATESERVER_PROXY_PORT | 8288 | Proxy bind port |
| PRIVATESERVER_PASSWORD | (auto) | Override password; if unset, a random 8-char one is generated & saved |
| PRIVATESERVER_AUTOSTART | 0 | Set 1 to auto-start the tunnel on boot |
| PRIVATESERVER_BINARY_DIR | <package>/bin | Where to cache the cloudflared binary |
The password can also be set at runtime from the UI/API; it is persisted to settings.json next to the package.
REST API
All under the ComfyUI origin (same host/port as the web UI), no auth:
| Method | Path | Description |
|--------|------|-------------|
| GET | /privateserver/status | {running,state,url,password_set,password,error,tunnel_log,…} |
| POST | /privateserver/start | Start proxy + tunnel (returns immediately; poll status) |
| POST | /privateserver/stop | Stop tunnel + proxy |
| POST | /privateserver/password | Body {"password": "…"} or {"randomize": true} to get a fresh random one |
Example:
curl http://127.0.0.1:8188/privateserver/status
curl -X POST http://127.0.0.1:8188/privateserver/start
Troubleshooting
- "Timed out waiting for cloudflared" / URL never appears: Check the
tunnel_login/privateserver/status; likely a firewall, proxy, or offline situation. Trycloudflareddownload again by deleting thebin/folder. - Port 8288 in use: Set
PRIVATESERVER_PROXY_PORTto a free port. - Binary download fails: Check internet access; you can also install
cloudflaredmanually and it will still be used if present on PATH (or place a binary at<package>/bin/cloudflared(.exe)).