Extensions/ComfyUI Public Server
ComfyUI Extension

ComfyUI Public Server

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

By tngklp·Created a day ago·Updated a day ago· 0
tngklp/comfyui_public-server
Nodes
On cloudLocal install
Stars0
Updateda day ago
Readme

ComfyUI Public Server

<p align="center"> <img alt="License" src="https://img.shields.io/github/license/tngklp/comfyui_public-server"> <img alt="Tunnel" src="https://img.shields.io/badge/Tunnel-Cloudflare_Quick_Tunnel-blue"> </p>

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.

Visitor  ──►  https://*.trycloudflare.com  ──►  127.0.0.1:8288   ──►  127.0.0.1:8188
                      cloudflared                   auth proxy              ComfyUI
  • cloudflared creates the tunnel to Cloudflare's edge and forwards traffic to your local proxy.
  • auth proxy (runs locally, on 127.0.0.1:8288) shows visitors a simple password login page before anything reaches ComfyUI. No password configured ⇒ open.
  • ComfyUI never binds publicly. Your normal local :8188 access is unchanged and password-free.

⚠️ 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
  • Optional user-set password (empty ⇒ no password / open tunnel)
  • Server-side password protection
  • Auto-downloads the correct cloudflared binary for your OS on first use
  • Clean shutdown: the tunnel stops when ComfyUI exits

Install

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

    cd ComfyUI/custom_nodes
    git clone https://github.com/tngklp/comfyui_public-server.git
    
  2. Restart ComfyUI. A "Public 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 Public Server in ComfyUI's menu.
  2. Read and acknowledge the security warning.
  3. Optionally enter a password and click Save password.
  4. Click Start. After a few seconds a https://….trycloudflare.com URL appears — click Copy URL and send it to someone.
  5. Stop when done. (Also stops automatically if ComfyUI exits.)

Visitors will be asked for the password (if set) 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 | |----------|---------|---------| | PUBLICSERVER_TARGET_URL | http://127.0.0.1:8188 | Local ComfyUI address to forward to | | PUBLICSERVER_PROXY_HOST | 127.0.0.1 | Proxy bind host (keep loopback) | | PUBLICSERVER_PROXY_PORT | 8288 | Proxy bind port | | PUBLICSERVER_PASSWORD | (none) | Default password (overrides saved one) | | PUBLICSERVER_AUTOSTART | 0 | Set 1 to auto-start the tunnel on boot | | PUBLICSERVER_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 | /publicserver/status | {running,state,url,password_set,password,error,tunnel_log,…} | | POST | /publicserver/start | Start proxy + tunnel (returns immediately; poll status) | | POST | /publicserver/stop | Stop tunnel + proxy | | POST | /publicserver/password | Body {"password": "…"} (empty clears) |

Example:

curl http://127.0.0.1:8188/publicserver/status
curl -X POST http://127.0.0.1:8188/publicserver/start

TryCloudflare caveats

  • The URL is random and changes every time you start.
  • Capped at ~200 concurrent in-flight requests, no SLA/uptime guarantee.
  • If you have a config.yaml in your default cloudflared directory, quick tunnels can be blocked. This extension sidesteps that by pointing cloudflared at its own empty config.

Troubleshooting

  • "Timed out waiting for cloudflared" / URL never appears: Check the tunnel_log in /publicserver/status; likely a firewall, proxy, or offline situation. Try cloudflared download again by deleting the bin/ folder.
  • Port 8288 in use: Set PUBLICSERVER_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)).