Extensions/comfyui_private-server
ComfyUI Extension

comfyui_private-server

Share your local ComfyUI via a Cloudflare Quick Tunnel with an optional password gate

By tngklp·Created about 15 hours ago·Updated about 14 hours ago· 0
tngklp/comfyui_private-server
Nodes
On cloudLocal install
Stars0
Updatedabout 14 hours ago
Readme

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 cloudflared binary for your OS on first use
  • Clean shutdown: the tunnel stops when ComfyUI exits

Install

Option 1 - ComfyUI Manager (recommended)

  1. Open ComfyUI → ManagerInstall Custom Nodes.
  2. Search for "ComfyUI Private Server", select it, and click Install.
  3. Restart ComfyUI.

Option 2 - Git clone (manual)

  1. Clone this repository into your ComfyUI custom nodes folder:

    cd ComfyUI/custom_nodes
    git clone https://github.com/tngklp/comfyui_private-server.git
    
  2. Restart ComfyUI. A "Private Server" button appears in the top bar menu.

  3. The extension downloads cloudflared automatically (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 ships aiohttp, which is the only runtime dependency.

Usage

  1. Click Private Server in ComfyUI's menu.
  2. Read and acknowledge the security warning.
  3. A random 8-character password is set by default. Type your own and click Save, or click Randomize for a fresh random one.
  4. Click Start. After a few seconds a https://*.trycloudflare.com URL appears.
  5. 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_log in /privateserver/status; likely a firewall, proxy, or offline situation. Try cloudflared download again by deleting the bin/ folder.
  • Port 8288 in use: Set PRIVATESERVER_PROXY_PORT to a free port.
  • Binary download fails: Check internet access; you can also install cloudflared manually and it will still be used if present on PATH (or place a binary at <package>/bin/cloudflared(.exe)).