Create intro.py
Browse files
intro.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from subprocess import getoutput
|
| 2 |
+
from diffusers import DiffusionPipeline
|
| 3 |
+
import ipywidgets as widgets
|
| 4 |
+
import sys
|
| 5 |
+
import fileinput
|
| 6 |
+
import os
|
| 7 |
+
import time
|
| 8 |
+
import diffusers
|
| 9 |
+
import requests
|
| 10 |
+
import transformers
|
| 11 |
+
from diffusers import DiffusionPipeline
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
os.chdir("/content/gdrive/MyDrive/")
|
| 15 |
+
if not os.path.exists("/content/gdrive/MyDrive/"):
|
| 16 |
+
!mkdir -p /content/gdrive/MyDrive/
|
| 17 |
+
with capture.capture_output() as cap:
|
| 18 |
+
def inf(msg, style, wdth): inf = widgets.Button(description=msg, disabled=True, button_style=style, layout=widgets.Layout(min_width=wdth));display(inf)
|
| 19 |
+
fgitclone = "git clone --depth 1"
|
| 20 |
+
%mkdir -p /content/gdrive/MyDrive/GenFiles/HeartOfPainting
|
| 21 |
+
%cd /content/
|
| 22 |
+
!wget -q -i https://huggingface.co/datasets/Cacau/RequestedFiles/resolve/main/requirements.txt
|
| 23 |
+
!dpkg -i *.deb
|
| 24 |
+
if not os.path.exists('/content/gdrive/MyDrive/GenFiles/HeartOfPainting'):
|
| 25 |
+
!tar -C / --zstd -xf sd.tar.zst
|
| 26 |
+
!tar -C / --zstd -xf A1111_dep.tar.zst
|
| 27 |
+
!rm *.deb | rm *.zst | rm *.txt
|
| 28 |
+
|
| 29 |
+
with capture.capture_output() as cap:
|
| 30 |
+
%cd /content/gdrive/MyDrive/GenFiles/HeartOfPainting
|
| 31 |
+
!git reset --hard
|
| 32 |
+
time.sleep(1)
|
| 33 |
+
!rm webui.sh
|
| 34 |
+
!git pull
|