TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.53k stars 1.31k forks source link

Feature - tunnel option instead of gradio interface. #57

Closed MrAshRhodes closed 2 years ago

MrAshRhodes commented 2 years ago

Hi,

Gradio.app links sometimes time out and is a bit of a pain. You could add something for ngrok to be used instead

#@title Install ngrok python library
!pip install pyngrok
from pyngrok import ngrok
  # Terminate open tunnels if exist
  ngrok.kill()

  # Setting the authtoken (optional)
  # Get your authtoken from https://dashboard.ngrok.com/auth
  NGROK_AUTH_TOKEN = "2FImIgwy6llwFKC25hW3ZRUCXXH_4gaGZ7sMsR7Tu6E6tDwXE"
  ngrok.set_auth_token(NGROK_AUTH_TOKEN)

  # Open an HTTPs tunnel on port 7860 for http://localhost:7860
  public_url = ngrok.connect(7860, proto="http", options={"bind_tls": True})
  !echo "----------------------------------------"
  !echo "use once web server has initiated"
  !echo "----------------------------------------"
  print("Tracking URL:", public_url)
  !echo "----------------------------------------"
  !python webui.py --precision autocast

I also know that in some place ngrok is blocked by firewalls (offices, colleges etc) so there's a few others. I use bore.

#@title Install Bore Tunnel
!wget https://github.com/ekzhang/bore/releases/download/v0.4.0/bore-v0.4.0-x86_64-unknown-linux-musl.tar.gz
!tar -xf bore-v0.4.0-x86_64-unknown-linux-musl.tar.gz
!rm -f bore-v0.4.0-x86_64-unknown-linux-musl.tar.gz
!cp bore /usr/bin/bore
!rm -rf bore

I guess you could store the binary in gdrive and cp from there.

There's also some others i use, localtunnel, loophole. but you get the idea.

TheLastBen commented 2 years ago

Yes I will add that as an additional option,

TheLastBen commented 2 years ago

Feature added