diffuzers
diffuzers copied to clipboard
colab issue
import subprocess import os; os.makedirs("images", exist_ok=True) import time import streamlit as st
Run the diffuzers app
diffuzers_process = subprocess.Popen(["diffuzers", "app", "--host", "localhost", "--port", "8001", "--device", "cuda","--output","/content/images"], stdout=subprocess.PIPE)
time.sleep(30)
Run localtunnel to expose the app to the public
lt_process = subprocess.Popen(["lt", "--port", "8001","--subdomain","myapp"], stdout=subprocess.PIPE) #lt_process = subprocess.Popen(["ngrok", "http", "8501"], stdout=subprocess.PIPE)
Wait for the localtunnel URL to be generated
lt_url = None while lt_url is None: line = lt_process.stdout.readline() if "https" in line.decode("utf-8"): lt_url = line.decode("utf-8").strip()
Print the localtunnel URL
print("LocalTunnel URL:", lt_url)
Wait for user input to stop the processes
input("Press enter to stop the processes...")
Terminate the processes
lt_process.terminate() diffuzers_process.terminate()
i want to use without ngork key or anything else so wrote this, this does not work sometime says connection error and when it does works and i reload the model or page, session state error comes, https://docs.streamlit.io/library/api-reference/session-state