Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ninjaneural
GitHub Repository: ninjaneural/webui
Path: blob/master/deforum/abyss_orange_mix_2_webui_colab.ipynb
3275 views
Kernel: Python 3
#@markdown ## ๊ตฌ๊ธ€๋“œ๋ผ์ด๋ธŒ ์—ฐ๋™ #@markdown **์ƒ์„ฑํ•œ ์ด๋ฏธ์ง€๋ฅผ ๊ตฌ๊ธ€๋“œ๋ผ์ด๋ธŒ์— ์ž๋™์ €์žฅํ•˜๋ ค๋ฉด ์ฒดํฌํ•ด์ฃผ์„ธ์š”** Google_Drive = False #@param {type:"boolean"} #@markdown **์ดˆ๊ธฐ๋ชจ๋ธ(checkpoint)์„ ๊ตฌ๊ธ€๋“œ๋ผ์ด๋ธŒ์— ์ €์žฅํ•˜๋ ค๋ฉด ์ฒดํฌํ•ด์ฃผ์„ธ์š”** #@markdown <div><font color="red">๋ชจ๋ธ ํŒŒ์ผ์‚ฌ์ด์ฆˆ(2GB ~ 7GB)๊ฐ€ ํฌ๋‹ˆ ๊ตฌ๊ธ€๋“œ๋ผ์ด๋ธŒ ์šฉ๋Ÿ‰์„ ํ™•์ธํ•ด์ฃผ์„ธ์š”</div> #@markdown <div><font color="red">๋Œ€์‹  ํ•œ๋ฒˆ๋ฐ›์œผ๋ฉด ๋‹ค์Œ ์‹คํ–‰๋ถ€ํ„ฐ๋Š” ๋นจ๋ผ์ ธ์š”</div> Checkpoint_Google_Save = False #@param {type:"boolean"} #@markdown ----- #@markdown *ํ„ฐ๋„๋ง* #@markdown **Ngrok** Ngrok_Key = '' #@param {type:"string"} #@markdown **Localtunnel** Localtunnel = False #@param {type:"boolean"} #@markdown ----- #@markdown *์•„๋ž˜๋Š” ์„ค์ •ํ•  ํ•„์š” ์—†์–ด์š”* #@markdown **๊ตฌ๊ธ€๋“œ๋ผ์ด๋ธŒ์— ์—ฐ๊ฒฐ ํด๋”** Google_Drive_Dir = 'webui' #@param {type:"string"} #@markdown **ํด๋” ์„ค๋ช…** : ๋ฏธ๋ฆฌ ๋งŒ๋“œ์…”๋„ ๋˜๊ณ  ์—†์œผ๋ฉด ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•ด์š” #@markdown * webui/output : ์ƒ์„ฑ๋œ ์ด๋ฏธ์ง€๋“ค์ด ์ €์žฅ๋˜์š” #@markdown * webui/checkpoint : ๋ชจ๋ธ(checkpoint)๋ฅผ ๋„ฃ์–ด์ฃผ๋ฉด ์ฝ์–ด์˜ฌ์ˆ˜ ์žˆ์–ด์š” #@markdown * webui/lora : ๋กœ๋ผ(LoRA)๋ฅผ ๋„ฃ์–ด์ฃผ๋ฉด ์ฝ์–ด์˜ฌ์ˆ˜ ์žˆ์–ด์š” #@markdown * webui/embedding : ์ž„๋ฒ ๋”ฉ(Textual Inversion)๋ฅผ ๋„ฃ์–ด์ฃผ๋ฉด ์ฝ์–ด์˜ฌ์ˆ˜ ์žˆ์–ด์š” #@markdown * webui/hyperwork : ํ•˜์ดํผ์›Œํฌ(Hyperworks)๋ฅผ ๋„ฃ์–ด์ฃผ๋ฉด ์ฝ์–ด์˜ฌ์ˆ˜ ์žˆ์–ด์š” #@markdown * webui/wildcards : ์™€์ผ๋“œ์นด๋“œ(Wildcards)๋ฅผ ๋„ฃ์–ด์ฃผ๋ฉด ์ฝ์–ด์˜ฌ์ˆ˜ ์žˆ์–ด์š” #@markdown **์ดˆ๊ธฐ๋ชจ๋ธ(checkpoint) URL** Checkpoint_Url = 'https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix2/Pruned/AbyssOrangeMix2_hard_pruned_fp16_with_VAE.safetensors' #@param {type:"string"} #@markdown **์ดˆ๊ธฐ๋ชจ๋ธ ํŒŒ์ผ๋ช…** Checkpoint_Filename = 'AbyssOrangeMix2_hard_pruned_fp16_with_VAE.safetensors' #@param {type:"string"} #@markdown ----- #@markdown *์ถ”๊ฐ€์ต์Šคํ…์…˜* #@markdown **ControlNet์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š์œผ๋ฉด ์ฒดํฌ๋ฅผ ํ•ด์ œํ•ด์ฃผ์„ธ์š”** ControlNet = True #@param {type:"boolean"} Workspace = 'ui' NotebookVersion = 'deforum' if Google_Drive: from google.colab import drive drive.mount('/content/drive') Checkpoint_SavePath = f'/content/{Workspace}/models/Stable-diffusion' if Google_Drive and Checkpoint_Google_Save: Checkpoint_SavePath = f'/content/{Workspace}/models/Stable-diffusion/google' !apt -y install -qq aria2 %cd /content !wget https://raw.githubusercontent.com/neuralninja22/colab/master/misc/install_{NotebookVersion}.sh -O /content/install.sh !bash /content/install.sh {Workspace} {ControlNet} # ๊ตฌ๊ธ€๋“œ๋ผ์ด๋ธŒ ์—ฐ๊ฒฐ !wget https://raw.githubusercontent.com/neuralninja22/colab/master/misc/link_google_drive.sh -O /content/link_google_drive.sh !bash /content/link_google_drive.sh {Workspace} {Google_Drive} {Google_Drive_Dir} # ์ปค์Šคํ„ฐ๋งˆ์ด์ง• %cd /content/{Workspace} !bash /content/drive/MyDrive/{Google_Drive_Dir}/{NotebookVersion}/install.sh {Workspace} if Google_Drive: !cp -f /content/drive/MyDrive/{Google_Drive_Dir}/{NotebookVersion}/config.json /content/{Workspace}/config.json !cp -f /content/drive/MyDrive/{Google_Drive_Dir}/{NotebookVersion}/ui-config.json /content/{Workspace}/ui-config.json !cp -f /content/drive/MyDrive/{Google_Drive_Dir}/{NotebookVersion}/styles.csv /content/{Workspace}/styles.csv # checkpoint select !sed -i -e 's/"sd_model_checkpoint": "",/"sd_model_checkpoint": "{Checkpoint_Filename}",/g' /content/{Workspace}/config.json # checkpoint !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "{Checkpoint_Url}" -d {Checkpoint_SavePath} -o {Checkpoint_Filename} # vae !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt -d {Checkpoint_SavePath} -o vae-ft-mse-840000-ema-pruned.vae.pt !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/vae/kl-f8-anime2.ckpt -d /content/{Workspace}/models/VAE -o kl-f8-anime2.ckpt # lora !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/62833?type=Model&format=SafeTensor" -d /content/{Workspace}/models/Lora -o add_detail.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/63006?type=Model&format=SafeTensor" -d /content/{Workspace}/models/Lora -o LowRA.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/32988?type=Model&format=SafeTensor&size=full&fp=fp16" -d /content/{Workspace}/models/Lora -o blindbox_V1Mix.safetensors # embeddings !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/datasets/gsdf/EasyNegative/resolve/main/EasyNegative.pt -d /content/{Workspace}/embeddings -o EasyNegative.pt !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/AsciiP/badhandv4/resolve/main/badhandv4.pt -d /content/{Workspace}/embeddings -o badhandv4.pt !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/yesyeahvh/bad-hands-5/resolve/main/bad-hands-5.pt -d /content/{Workspace}/embeddings -o bad-hands-5.pt !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/60938?type=Negative&format=Other" -d /content/{Workspace}/embeddings/ -o negative_hand.pt !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/60095?type=Negative&format=Other" -d /content/{Workspace}/embeddings/ -o bad_prompt_version2.pt if Localtunnel: !npm install -g localtunnel import subprocess import threading import time import socket import urllib.request def iframe_thread(port): while True: time.sleep(0.5) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) result = sock.connect_ex(('127.0.0.1', port)) if result == 0: break sock.close() print("\nComfyUI finished loading, trying to launch localtunnel (if it gets stuck here localtunnel is having issues)\n") print("The password/enpoint ip for localtunnel is:", urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip("\n")) p = subprocess.Popen(["lt", "--port", "{}".format(port)], stdout=subprocess.PIPE) for line in p.stdout: print(line.decode(), end='') threading.Thread(target=iframe_thread, daemon=True, args=(7860,)).start() if Ngrok_Key: !python launch.py --xformers --no-half-vae --theme dark --ngrok {Ngrok_Key} else: !python launch.py --share --xformers --no-half-vae --theme dark --gradio-queue