Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ninjaneural
GitHub Repository: ninjaneural/webui
Path: blob/master/sdxl/albedo_base_xl_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 **WebUI Version** TagVersion = 'v1.9.0' #@param ["v1.6.0", "v1.7.0", "v1.8.0", "v1.9.0", "v1.10.0", "forge"] #@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/lycoris : 라이코리스(LyCORIS)를 넣어주면 읽어올수 있어요 #@markdown * webui/embedding : 임베딩(Textual Inversion)를 넣어주면 읽어올수 있어요 #@markdown * webui/hyperwork : 하이퍼워크(Hyperworks)를 넣어주면 읽어올수 있어요 #@markdown * webui/wildcards : 와일드카드(Wildcards)를 넣어주면 읽어올수 있어요 #@markdown **초기모델(checkpoint) URL** Checkpoint_Url = 'https://huggingface.co/albedobond/albedobaseXL_v21/resolve/main/albedobaseXL_v21.safetensors?download=true' #@param {type:"string"} #@markdown **초기모델 파일명** Checkpoint_Filename = 'AlbedoBase_XL_v21.safetensors' #@param {type:"string"} #@markdown ----- #@markdown *추가익스텐션* #@markdown **ControlNet 기본 모델 다운로드** #@markdown > *openpose, lineart, softedge, depth, canny, tile, ip2p* ControlNet = True #@param {type:"boolean"} #@markdown **Sai 모델 다운로드** #@markdown > *canny, depth, recolor, sketch* ControlNet_SAI = False #@param {type:"boolean"} #@markdown **Kohya 모델 다운로드** #@markdown > *canny_anime, depth_anime, openpose_anime, scribble_anime* ControlNet_KOHYA = False #@param {type:"boolean"} #@markdown **T2I Adapter 모델 다운로드** #@markdown > *canny, openpose, sketch* ControlNet_T2I = False #@param {type:"boolean"} #@markdown **IP-Adapter 모델 다운로드** CotnrolNet_IPAdapter = False #@param {type:"boolean"} #@markdown **After Detailer(adetailer)를 사용하지 않으면 체크를 해제해주세요** ADetailer = True #@param {type:"boolean"} #@markdown **Dectect Detailer(ddetailer)를 사용하지 않으면 체크를 해제해주세요** DDetailer = False #@param {type:"boolean"} #@markdown **Segment Anything을 사용하지 않으면 체크를 해제해주세요** SegmentAnything = False #@param {type:"boolean"} #@markdown **AnimateDiff 사용 (WebUI 버전 v1.6.0만 지원)** AnimateDiff = False #@param {type:"boolean"} #@markdown **AnimateDiff 추가 모션 모델 (HumansMotion,3DMotion)** AnimateDiff_Extra = False #@param {type:"boolean"} #@markdown **mov2mov 사용** Mov2mov = False #@param {type:"boolean"} #@markdown **Deforum 사용** Deforum = False #@param {type:"boolean"} #@markdown **Reactor 사용** Reactor = False #@param {type:"boolean"} #@markdown **Temporal Kit 사용** TemporalKit = False #@param {type:"boolean"} #@markdown **TemporalNet Util 사용** TemporalNetUtil = False #@param {type:"boolean"} Workspace = 'ui' NotebookVersion = 'nightly' 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} {TagVersion} {ControlNet} {DDetailer} {ADetailer} {SegmentAnything} {Mov2mov} {AnimateDiff} {Deforum} {Reactor} # 구글드라이브 연결 !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} {NotebookVersion} # 커스터마이징 %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 %cd /content/{Workspace} # checkpoint select !sed -i -e 's/"sd_model_checkpoint": "",/"sd_model_checkpoint": "{Checkpoint_Filename}",/g' /content/{Workspace}/config.json # upscaler !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/embed/upscale/resolve/main/4x-UltraSharp.pth -d ./models/ESRGAN -o 4x-UltraSharp.pth # 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 ./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/32988?type=Model&format=SafeTensor&size=full&fp=fp16" -d ./models/Lora -o blindbox_V1Mix.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://huggingface.co/latent-consistency/lcm-lora-sdv1-5/resolve/main/pytorch_lora_weights.safetensors" -d ./models/Lora -o lcm-lora-sd15.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 ./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 ./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 ./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 ./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 ./embeddings/ -o bad_prompt_version2.pt !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M "https://civitai.com/api/download/models/5637?type=Model&format=PickleTensor&size=full&fp=fp16" -d ./embeddings/ -o ng_deepnegative_v1_75t.pt if ControlNet: ControlNet_Model_Path = "./extensions/controlnet/models" if TagVersion=="forge": ControlNet_Model_Path = "./models/ControlNet" !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/diffusers_xl_canny_mid.safetensors -d {ControlNet_Model_Path} -o diffusers_xl_canny_mid.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/diffusers_xl_depth_mid.safetensors -d {ControlNet_Model_Path} -o diffusers_xl_depth_mid.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/sargezt_xl_softedge.safetensors -d {ControlNet_Model_Path} -o sargezt_xl_softedge.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/thibaud_xl_openpose.safetensors -d {ControlNet_Model_Path} -o thibaud_xl_openpose.safetensors if ControlNet_SAI: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/sai_xl_canny_256lora.safetensors -d {ControlNet_Model_Path} -o sai_xl_canny_256lora.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/sai_xl_depth_256lora.safetensors -d {ControlNet_Model_Path} -o sai_xl_depth_256lora.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/sai_xl_recolor_256lora.safetensors -d {ControlNet_Model_Path} -o sai_xl_recolor_256lora.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/sai_xl_sketch_256lora.safetensors -d {ControlNet_Model_Path} -o sai_xl_sketch_256lora.safetensors if ControlNet_KOHYA: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/kohya_controllllite_xl_canny_anime.safetensors -d {ControlNet_Model_Path} -o kohya_controllllite_xl_canny_anime.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/kohya_controllllite_xl_depth_anime.safetensors -d {ControlNet_Model_Path} -o kohya_controllllite_xl_depth_anime.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/kohya_controllllite_xl_openpose_anime_v2.safetensors -d {ControlNet_Model_Path} -o kohya_controllllite_xl_openpose_anime_v2.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/kohya_controllllite_xl_scribble_anime.safetensors -d {ControlNet_Model_Path} -o kohya_controllllite_xl_scribble_anime.safetensors if ControlNet_T2I: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/t2i-adapter_xl_canny.safetensors -d {ControlNet_Model_Path} -o t2i-adapter_xl_canny.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/t2i-adapter_xl_openpose.safetensors -d {ControlNet_Model_Path} -o t2i-adapter_xl_openpose.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/t2i-adapter_xl_sketch.safetensors -d {ControlNet_Model_Path} -o t2i-adapter_xl_sketch.safetensors if CotnrolNet_IPAdapter: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter_sdxl_vit-h.safetensors -d {ControlNet_Model_Path} -o ip-adapter_sdxl_vit-h.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter-plus_sdxl_vit-h.safetensors -d {ControlNet_Model_Path} -o ip-adapter-plus_sdxl_vit-h.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter-plus-face_sdxl_vit-h.safetensors -d {ControlNet_Model_Path} -o ip-adapter-plus-face_sdxl_vit-h.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid_sdxl.bin -d {ControlNet_Model_Path} -o ip-adapter-faceid_sdxl.bin !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plusv2_sdxl.bin -d {ControlNet_Model_Path} -o ip-adapter-faceid-plusv2_sdxl.bin !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid_sdxl_lora.safetensors -d ./models/Lora -o ip-adapter-faceid_sdxl_lora.safetensors !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid-plusv2_sdxl_lora.safetensors -d ./models/Lora -o ip-adapter-plusv2_sdxl_lora.safetensors if AnimateDiff_Extra: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/guoyww/animatediff/resolve/main/mm_sdxl_v10_beta.ckpt -d ./extensions/animatediff/model -o mm_sdxl_v10_beta.ckpt !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/hotshotco/Hotshot-XL/resolve/main/hsxl_temporal_layers.safetensors -d ./extensions/animatediff/model -o hsxl_temporal_layers.safetensors if TemporalKit: !git clone https://github.com/CiaraStrawberry/TemporalKit ./extensions/TemporalKit !pip install scenedetect if TemporalNetUtil: !git clone https://github.com/ninjaneural/temporalnet_util ./extensions/temporalnet_util !pip install ffmpeg-python if ControlNet: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/CiaraRowles/TemporalNet/resolve/main/diff_control_sd15_temporalnet_fp16.safetensors -d {ControlNet_Model_Path} -o diff_control_sd15_temporalnet_fp16.safetensors 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 --enable-insecure-extension-access --theme dark --gradio-queue