|
import subprocess |
|
import logging |
|
import re |
|
|
|
|
|
logging.basicConfig(filename='logs_run.txt', level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') |
|
|
|
|
|
proc = subprocess.Popen(['python', '/content/ui/launch.py', '--listen', '--xformers', '--enable-insecure-extension-access', |
|
'--theme', 'dark', '--gradio-queue', '--no-download-sd-model', '--share'], |
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) |
|
|
|
|
|
while True: |
|
output = proc.stdout.readline().strip() |
|
if not output: |
|
break |
|
|
|
|
|
logging.info(output) |
|
|
|
|
|
match = re.search(r'Public WebUI Colab URL: (.+)', output) |
|
if match: |
|
url = match.group(1) |
|
print(url) |
|
|
|
|
|
proc.wait() |
|
|
|
|
|
logging.shutdown() |
|
|