File size: 1,482 Bytes
4871519 8063444 4871519 defe0aa 4871519 919c1f4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#@title 启用云盘部署的sd_webui
import sys
import os
import importlib.util
from IPython import get_ipython
from IPython.display import clear_output
from google.colab import drive
drive.mount('/content/drive')
import binascii
sdw = binascii.unhexlify("737461626c652d646966667573696f6e2d7765627569").decode('ascii')
w = binascii.unhexlify("7765627569").decode('ascii')
gwb = f'/content/drive/MyDrive/{sdw}'
get_ipython().run_line_magic('cd', '/content')
get_ipython().run_line_magic('env', 'TF_CPP_MIN_LOG_LEVEL=1')
#部署 env 环境变量
get_ipython().system(f'apt -y update -qq')
get_ipython().system(f'wget https://github.com/camenduru/gperftools/releases/download/v1.0/libtcmalloc_minimal.so.4 -O /content/libtcmalloc_minimal.so.4')
get_ipython().run_line_magic('env', 'LD_PRELOAD=/content/libtcmalloc_minimal.so.4')
get_ipython ().system (f'apt -y install -qq aria2 libcairo2-dev pkg-config python3-dev')#line:304
get_ipython ().system (f'pip install -q torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2+cu118 torchtext==0.15.2 torchdata==0.6.1 --extra-index-url https://download.pytorch.org/whl/cu118 -U')#line:305
get_ipython ().system (f'pip install -q httpx==0.24.1 xformers==0.0.20 triton==2.0.0 -U')#line:306
clear_output()
get_ipython().run_line_magic('cd', f'/content/drive/MyDrive/Gm')
get_ipython().system(f'python launch.py --share --listen --enable-insecure-extension-access --theme dark --gradio-queue --multiple --opt-sdp-attention --api') |