Skip to content
代码片段 群组 项目
提交 3ddff339 编辑于 作者: comfyanonymous's avatar comfyanonymous
浏览文件

Add commented out command to install the preprocessor nodes to notebook.

上级 b9e3f522
No related branches found
No related tags found
无相关合并请求
%% Cell type:markdown id: tags:
Git clone the repo and install the requirements. (ignore the pip errors about protobuf)
%% Cell type:code id: tags:
```
!git clone https://github.com/comfyanonymous/ComfyUI
%cd ComfyUI
!pip install xformers -r requirements.txt
!sed -i 's/v1-inference.yaml/v1-inference_fp16.yaml/g' webshit/index.html
```
%% Cell type:markdown id: tags:
Download some models/checkpoints/vae (uncomment the wget commands for the ones you want)
Download some models/checkpoints/vae or custom comfyui nodes (uncomment the commands for the ones you want)
%% Cell type:code id: tags:
```
# Checkpoints
# SD1.5
!wget https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt -P ./models/checkpoints/
# SD2
#!wget https://huggingface.co/stabilityai/stable-diffusion-2-1-base/resolve/main/v2-1_512-ema-pruned.safetensors -P ./models/checkpoints/
#!wget https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.safetensors -P ./models/checkpoints/
# Some SD1.5 anime style
#!wget https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix2/AbyssOrangeMix2_hard.safetensors -P ./models/checkpoints/
#!wget https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix3/AOM3A1.safetensors -P ./models/checkpoints/
#!wget https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix3/AOM3A3.safetensors -P ./models/checkpoints/
#!wget https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/anything-v3-fp16-pruned.safetensors -P ./models/checkpoints/
# Waifu Diffusion 1.5 (anime style SD2.x 768-v)
#!wget https://huggingface.co/waifu-diffusion/wd-1-5-beta2/resolve/main/checkpoints/wd-1-5-beta2-fp16.safetensors -P ./models/checkpoints/
# VAE
!wget https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors -P ./models/vae/
#!wget https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/VAEs/orangemix.vae.pt -P ./models/vae/
# Loras
#!wget --content-disposition https://civitai.com/api/download/models/10350 -P ./models/loras/ #theovercomer8sContrastFix SD2.x 768-v
#!wget --content-disposition https://civitai.com/api/download/models/10638 -P ./models/loras/ #theovercomer8sContrastFix SD1.x
# T2I-Adapter
#!wget https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_depth_sd14v1.pth -P ./models/t2i_adapter/
#!wget https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_seg_sd14v1.pth -P ./models/t2i_adapter/
#!wget https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_sketch_sd14v1.pth -P ./models/t2i_adapter/
#!wget https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_keypose_sd14v1.pth -P ./models/t2i_adapter/
# ControlNet
#!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_depth-fp16.safetensors -P ./models/controlnet/
#!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_scribble-fp16.safetensors -P ./models/controlnet/
#!wget https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_openpose-fp16.safetensors -P ./models/controlnet/
# Controlnet Preprocessor nodes by Fannovel16
#!cd custom_nodes && git clone https://github.com/Fannovel16/comfy_controlnet_preprocessors; cd comfy_controlnet_preprocessors && python install.py
```
%% Cell type:markdown id: tags:
### Run ComfyUI with localtunnel
use the **fp16** model configs for more speed
%% Cell type:code id: tags:
```
!npm install -g localtunnel
import subprocess
import threading
import time
import socket
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)")
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=(8188,)).start()
!python main.py --dont-print-server
```
%% Cell type:markdown id: tags:
### Run ComfyUI with colab iframe (in case localtunnel doesn't work)
use the **fp16** model configs for more speed
You should see the ui appear in an iframe. If you get a 403 error, it's your firefox settings or an extension that's messing things up.
If you want to open it in another window use the link.
Note that some UI features like live image previews won't work because the colab iframe blocks websockets.
%% Cell type:code id: tags:
```
import threading
import time
import socket
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()
from google.colab import output
output.serve_kernel_port_as_iframe(port, height=1024)
print("to open it in a window you can open this link here:")
output.serve_kernel_port_as_window(port)
threading.Thread(target=iframe_thread, daemon=True, args=(8188,)).start()
!python main.py --dont-print-server
```
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册