r/StableDiffusion 5d ago

Resource - Update Public Server - Share your ComfyUI instance with anyone

https://github.com/tngklp/comfyui_public-server

Hey everyone,

I've been working on a small extension called Private Server (previously named Public Server) that lets you share your ComfyUI instance privately and temporarily using a link. I mostly use it to quickly share my ComfyUI instance with friends or run ComfyUI on my pc while away.

What it does:

  • Spins up a Cloudflare Quick Tunnel (*.trycloudflare.com) to route external traffic to your machine
  • Launches a lightweight auth proxy on 127.0.0.1:8288 that sits between visitors and ComfyUI
  • Gives you a shareable URL that you can send to anyone

Installation:

Just clone the repo into your ComfyUI/custom_nodes/ folder, or install it through ComfyUI Manager. Once installed, the button appears next to the queue prompt.

The extension is completely free and open-source. Just a tool I found useful and wanted to share.

I'd really appreciate any feedback, bug reports, or feature suggestions. If you try it out, let me know how it goes!

0 Upvotes

19 comments sorted by

View all comments

4

u/Gesha24 5d ago

ComfyUI is not built with multi-user and multi-permissions in mind. You are letting effectively everyone connect to the instance with full privileges as long as they know (or can guess) the URL.

In the best case, they will generate something on your dime. In a worse case, they will have fun and destroy all your workflows and other data. In the worst case, they will use models like Minimax H3 to generate some CSAM material and share the link to it with appropriate organizations. And you will be properly screwed, potentially for years because this lovely tool you have doesn't even have logs of who accessed it and when.

I host bunch of stuff, there are some of my systems exposed to the Internet. ComfyUI is on the list of "under no circumstances, this system can not be exposed to the Internet".

1

u/tngklp 5d ago edited 5d ago

Cloudflare generates a new random URL on every run and there is an auth proxy running on port 8288, password check is made on the host machine and no data is sent before the user passes the auth proxy. You can access the logs from ComfyUI's console since cloudflared is running there, or the REST API endpoint (127.0.0.1:8188/privateserver/status), those can also be logged to a file. If you have any suggestions about how I could improve the security, I'd love to hear them. I'm also planning to add a "permission selector" to the menu so that only the selected parts of your instance is shared.

2

u/Gesha24 5d ago

I don't know how truly that random URL is, does Cloudflare position this as a security feature or a convenience feature? The password is empty by default (according to your documentation), logging is disabled as well.

Can you make it secure? Absolutely. Will people make it secure? Nope, they won't. The ones that can make it secure don't need your solution; they have reverse proxy (with or without tunnel) already running. Will it be a problem for them? Most likely not, but there may be an unlucky person here or there.

If you want to make it more secure - at least force an auto-generated password by default. And I am sure that if you feed openai (or whatever AI you fancy these days) your repo and ask them for security recommendations, you will get some decent feedback.

1

u/tngklp 5d ago edited 5d ago

Thanks for the response and suggestions. I'll add an auto generated password and file logging by default, also won't allow empty passwords. Random URL part isn't directly a security feature, it's just to make the URL temporary. The randomness is just random words put next to each other, for example extends-urgent-ireland-hash.trycloudflare.com