comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
52.22k stars 5.49k forks source link

Paperspace usage? #2778

Open jayceftg opened 7 months ago

jayceftg commented 7 months ago

This is not a comfyUI issue, but a paperspace one, but am here to check if there's any solutions.

So I have been using comfyUI on paperspace's free servers for a while with this notebook script: https://github.com/comfyanonymous/ComfyUI/blob/master/notebooks/comfyui_colab.ipynb

However, they informed me that using cloudflare or tunneling with comfyUI there could be bannable. They say that deployment on Gradio (like automatic1111's webui) is fine.

Is there some way to do such a deployment?

TheLastBen commented 7 months ago

There is a dedicated ComfyUI notebook for Paperspace https://github.com/TheLastBen/fast-stable-diffusion

jayceftg commented 6 months ago

There is a dedicated ComfyUI notebook for Paperspace https://github.com/TheLastBen/fast-stable-diffusion

Thanks very much, captain. It worked by creating a paperspacegradient.com official tunnel for the local port? Is it done automatically by Paperspace? I browsed through the notebook but not sure which part is related to the generation of this url?

TheLastBen commented 6 months ago

you run the cells down to "start comfyui" it will give you a link to the interface

jayceftg commented 6 months ago

you run the cells down to "start comfyui" it will give you a link to the interface

Thanks. Yes, I got the link. However, I didn't find which one of the args or something else was related to the link? Is it from ComfyUI's script or your script?

TheLastBen commented 6 months ago

I'm not sure what you mean

jayceftg commented 6 months ago

I'm not sure what you mean

Thanks. I was asking how a url like 'https://tensorboard-n5tozx0ylb.clg07azjl.paperspacegradient.com/' was generated for accessing ComfyUI on the local port?

From your code: Args="--listen --port 6006 --preview-method auto" on 'https://console.paperspace.com/github/TheLastBen/PPS?machine=Free-GPU&file=%2FPPS-ComfyUI.ipynb', you run ComfyUI on the local 6006 port, which could not be accessed remotely if not for you generating urls like 'https://tensorboard-n5tozx0ylb.clg07azjl.paperspacegradient.com/'.

This seems like a tunnelling service provided by paperspacegradient as it's in the url? But I didn't find info about this. Maybe that is related to the 'PAPERSPACE_FQDN' variable in 'https://huggingface.co/datasets/TheLastBen/PPS/raw/main/Scripts/mainppsComfy.py'?

Could you talk a bit about what sets up the tunnel?

TheLastBen commented 6 months ago

it is paperspace provided tunneling service

jayceftg commented 6 months ago

it is paperspace provided tunneling service

Hi, really appreciate all the previous help. However, I encounter something I couldn't solve. When using your script, it generates a url like https://tensorboard-nicxemghpy.clg07azjl.paperspacegradient.com/.

Using it (tensorboard-nicxemghpy.clg07azjl.paperspacegradient.com) with the official example API script https://github.com/comfyanonymous/ComfyUI/blob/master/script_examples/websockets_api_example.py gives an error:

Traceback (most recent call last): File "c:\Users\AdminJ\Desktop\proj6related\comfyapi\websockets_api_example.py", line 215, in ws.connect("ws://{}/ws?clientId={}".format(server_address, client_id)) File "C:\Program Files\Python310\lib\site-packages\websocket_core.py", line 266, in connect self.sock, addrs = connect( File "C:\Program Files\Python310\lib\site-packages\websocket_http.py", line 128, in connect hostname, port_from_url, resource, is_secure = parse_url(url) File "C:\Program Files\Python310\lib\site-packages\websocket_url.py", line 62, in parse_url raise ValueError("scheme %s is invalid" % scheme) ValueError: scheme https is invalid

So it seems although the official script is trying to use ws, the url is converted from ws:// to htts:// so the ws related code couldn't run. Have you encountered this before?

jayceftg commented 6 months ago

it is paperspace provided tunneling service

Probably it's related to tunnel restrictions or something. Tried the same offical ws script with Cloudflare tunnel it's 403 error. But 127.0.0.1:port would work.