π Tunnel Auto Reconnect
π Tunnel Auto Reconnect
- any_input
- status
- tunnel_url
- passthrough
This node opens a public tunnel to your local ComfyUI instance and babysits it - reconnecting when it drops. It's exactly the kind of thing you reach for when ComfyUI is running somewhere headless, most obviously Google Colab, and you need an actual URL to hit it from outside rather than a localhost address nothing else on the internet can see.
How it works. You pick a tunnel_type - pinggy (the default), ngrok, cloudflare, localtunnel, or custom if you want to hand it your own command - pointed at local_port, which defaults to 8188. That's not a random number; it's ComfyUI's own default listening port, so out of the box this node is built to tunnel your ComfyUI instance specifically. It polls the tunnel's health every check_interval seconds and, if the connection drops, retries up to max_retries times. That's the "auto reconnect" half of the name doing real work - free tiers of tunnel services are notorious for dying mid-session, especially over long Colab runs, and this node exists to paper over that.
Two of the inputs are the standard ComfyUI trick for a "side-effect" node. ComfyUI executes nodes based on what actually feeds into what - the data dependency graph - not top-to-bottom order on the canvas. A node like this one, whose real job is opening a network connection rather than transforming data, risks never being executed at all if nothing downstream consumes its output. The any_input/passthrough pair (both untyped, wildcard *) exists to let you route something through this node so it's forced into the execution order, without that something actually needing to relate to tunneling at all.
Inputs and outputs that matter. Required: enabled (a simple on/off switch), tunnel_type, local_port, check_interval (10β120s, step 5), max_retries (1β20). Optional: token (an auth token, needed by some providers and not others - ngrok wants one, pinggy and localtunnel often don't), custom_command (only relevant if tunnel_type is custom), and the any_input wildcard described above. Outputs: status, tunnel_url (the actual URL once the tunnel's up), and passthrough.
Installing it. Search comfyui-huyl2-nodes in ComfyUI Manager, or clone the pack directly:
cd ComfyUI/custom_nodes
git clone https://github.com/huyl3-cpu/comfyui-sortlist
Restart ComfyUI.
Troubleshooting, and one thing worth saying plainly. ComfyUI ships with no authentication on its API by default - anyone who can reach the port can queue jobs, and because custom nodes (this pack included) run as ordinary Python with full filesystem access, "anyone can reach the port" is a real attack surface, not a theoretical one. A tunnel node turns your local-only instance into something reachable from anywhere on the internet, not just your LAN. That's fine for a Colab session you're actively watching and closing in twenty minutes; it's a genuinely bad idea to leave running unattended on a machine with anything sensitive on it.
On the mundane side: if you pick ngrok and leave token blank, expect it to fail outright - ngrok stopped offering fully anonymous tunnels a while back, and that's the provider's policy, not a bug in this node. If status keeps flapping between connected and disconnected, it's worth checking whether Colab's own network is the flaky half before blaming the tunnel provider - check_interval and max_retries are your dials for riding that out, but they can't fix an underlying connection that's genuinely unstable.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | BOOLEAN | true | β |
| tunnel_type | COMBO | pinggy | 5 options: pinggy, ngrok, cloudflare, localtunnel, custom |
| local_port | INT | 81881024β65535 | β |
| check_interval | INT | 3010β120 | β |
| max_retries | INT | 51β20 | β |
| tokenopt | STRING | β | |
| custom_commandopt | STRING | β | |
| any_inputopt | * | β |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| status | STRING | β |
| tunnel_url | STRING | β |
| passthrough | * | β |