インストールコマンド
from pathlib import Path
import subprocess
import threading
import time
import socket
!pip install opencv-python==4.8.0.74
!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
!pip install -q xformers==0.0.20 triton==2.0.0 gradio_client==0.2.7 -U
!apt -y install -qq aria2
!pip install controlnet-aux==0.0.7 onnxruntime-gpu insightface
# 定数と設定
WORKSPACE = '/content/ComfyUI'
UPDATE_COMFY_UI = True
# ComfyUIのセットアップと更新
if not Path(WORKSPACE).exists():
%cd /content
print("-= Initial setup ComfyUI =-")
!git clone <https://github.com/comfyanonymous/ComfyUI>
else:
%cd $WORKSPACE
print("-= Updating ComfyUI =-")
!git pull
%cd $WORKSPACE/custom_nodes
!git clone <https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite>
!git clone <https://github.com/ssitu/ComfyUI_UltimateSDUpscale> --recursive
!git clone <https://github.com/TinyTerra/ComfyUI_tinyterraNodes>
!git clone <https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet>
!git clone <https://github.com/FizzleDorf/ComfyUI_FizzNodes>
!git clone <https://github.com/Stability-AI/stability-ComfyUI-nodes>
!git clone <https://github.com/RockOfFire/ComfyUI_Comfyroll_CustomNodes>
!git clone <https://github.com/ltdrdata/ComfyUI-Manager.git>
!git clone <https://github.com/mcmonkeyprojects/sd-dynamic-thresholding>
!git clone <https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes>
!git clone <https://github.com/theUpsider/ComfyUI-Logic>
!git clone <https://github.com/evanspearman/ComfyMath>
!git clone <https://github.com/cubiq/ComfyUI_essentials>
!git clone <https://github.com/ltdrdata/ComfyUI-Impact-Pack>
# ---------------- comfyui_controlnet_auxの設定開始 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone <https://github.com/Fannovel16/comfyui_controlnet_aux>
%cd /content/ComfyUI/custom_nodes/comfyui_controlnet_aux
!pip install -r requirements.txt
%cd /content/ComfyUI/custom_nodes
# ---------------- comfyui_controlnet_auxの設定開始 ---------------------
# ---------------- AnimateDiff-Evolvedの設定開始 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone <https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved>
# 備考: 今回のWorkflowで利用しないファイルをコメントアウト
# ComfyUI-AnimateDiff-Evolved/Checkpoint:($WORKSPACE/models/custom_nodes/ComfyUI-AnimateDiff-Evolved/models)
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v14.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/models -o mm_sd_v14.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v15.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/models -o mm_sd_v15.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v15_v2.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/models -o mm_sd_v15_v2.ckpt
!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 /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/models -o mm_sdxl_v10_beta.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v3_sd15_mm.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/models -o v3_sd15_mm.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/CiaraRowles/TemporalDiff/resolve/main/temporaldiff-v1-animatediff.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/models -o temporaldiff-v1-animatediff.ckpt
# ComfyUI-AnimateDiff-Evolved/MotionLoRA:($WORKSPACE/models/custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora)
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_PanLeft.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora -o v2_lora_PanLeft.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_PanRight.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora -o v2_lora_PanRight.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_RollingAnticlockwise.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora -o v2_lora_RollingAnticlockwise.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_RollingClockwise.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora -o v2_lora_RollingClockwise.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_TiltDown.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora -o v2_lora_TiltDown.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_TiltUp.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora -o v2_lora_TiltUp.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_ZoomIn.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora -o v2_lora_ZoomIn.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_ZoomOut.ckpt> -d /content/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/motion_lora -o v2_lora_ZoomOut.ckpt
# LoRA:($WORKSPACE/models/loras)
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v3_sd15_adapter.ckpt> -d /content/ComfyUI/models/loras -o v3_sd15_adapter.ckpt
# ControlNet:($WORKSPACE/models/controlnet)
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v3_sd15_sparsectrl_rgb.ckpt> -d /content/ComfyUI/models/controlnet -o v3_sd15_sparsectrl_rgb.ckpt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/guoyww/animatediff/resolve/main/v3_sd15_sparsectrl_scribble.ckpt> -d /content/ComfyUI/models/controlnet -o v3_sd15_sparsectrl_scribble.ckpt
# ---------------- AnimateDiff-Evolvedの設定終了 ---------------------
# ---------------- ComfyUI_IPAdapter_plusの設定開始 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone <https://github.com/cubiq/ComfyUI_IPAdapter_plus.git>
# ip-adapter(clip_vision) : $WORKSPACE/models/clip_vision
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/h94/IP-Adapter/resolve/main/models/image_encoder/model.safetensors> -d /content/ComfyUI/models/clip_vision -o ipadapter_model_sd15.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/image_encoder/model.safetensors> -d /content/ComfyUI/models/clip_vision -o ipadapter_model_sdxl.safetensors
# ip-adapter(main) : $WORKSPACE/models/ipadapter
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter_sd15.safetensors> -d /content/ComfyUI/models/ipadapter -o ip-adapter_sd15.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter_sd15_light.safetensors> -d /content/ComfyUI/models/ipadapter -o ip-adapter_sd15_light.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter-plus_sd15.safetensors> -d /content/ComfyUI/models/ipadapter -o ip-adapter-plus_sd15.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter-plus-face_sd15.safetensors> -d /content/ComfyUI/models/ipadapter -o ip-adapter-plus-face_sd15.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter-full-face_sd15.safetensors> -d /content/ComfyUI/models/ipadapter -o ip-adapter-full-face_sd15.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/h94/IP-Adapter/resolve/main/models/ip-adapter_sd15_vit-G.safetensors> -d /content/ComfyUI/models/ipadapter -o ip-adapter_sd15_vit-G.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_sdxl.safetensors> -d /content/ComfyUI/models/ipadapter -o ip-adapter_sdxl.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_sdxl_vit-h.safetensors> -d /content/ComfyUI/models/ipadapter -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 /content/ComfyUI/models/ipadapter -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 /content/ComfyUI/models/ipadapter -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_sd15.bin> -d /content/ComfyUI/models/ipadapter -o ip-adapter-faceid_sd15.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-plus_sd15.bin> -d /content/ComfyUI/models/ipadapter -o ip-adapter-faceid-plus_sd15.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_sd15.bin> -d /content/ComfyUI/models/ipadapter -o ip-adapter-faceid-plusv2_sd15.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.bin> -d /content/ComfyUI/models/ipadapter -o ip-adapter-faceid_sdxl.bin
# ip-adapter(loras) : $WORKSPACE/models/loras
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/h94/IP-Adapter-FaceID/resolve/main/ip-adapter-faceid_sd15_lora.safetensors> -d /content/ComfyUI/models/loras -o ip-adapter-faceid_sd15_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-plus_sd15_lora.safetensors> -d /content/ComfyUI/models/loras -o ip-adapter-faceid-plus_sd15_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_sd15_lora.safetensors> -d /content/ComfyUI/models/loras -o ip-adapter-faceid-plusv2_sd15_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_sdxl_lora.safetensors> -d /content/ComfyUI/models/loras -o ip-adapter-faceid_sdxl_lora.safetensors
# ---------------- ComfyUI_IPAdapter_plusの設定終了 ---------------------
# ---------------- komojini-comfyui-nodesの設定終了 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone <https://github.com/komojini/komojini-comfyui-nodes>
%cd komojini-comfyui-nodes
!pip install -r requirements.txt
%cd /content/ComfyUI/custom_nodes
# ---------------- komojini-comfyui-nodesの設定終了 ---------------------
# ---------------- comfyui-reactor-nodeの設定開始 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone <https://github.com/Gourieff/comfyui-reactor-node.git>
%cd /content/ComfyUI/custom_nodes/comfyui-reactor-node
!git checkout tags/v0.3.1
!git reset --hard tags/v0.3.1 #念のためhard reset
%cd /content/ComfyUI/custom_nodes
# onxxファイル(insightface) : $WORKSPACE/models/insightface
!wget <https://archive.creativaier.com/comfyui/scripts/setup_script>
!mv setup_script setup_script.py
!chmod +x setup_script.py
!python setup_script.py
!rm -rf setup_script.py
# ---------------- comfyui-reactor-nodeの設定終了 ---------------------
# onxxファイル(onnx): $WORKSPACE/models/onnx
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/yzd-v/DWPose/resolve/main/yolox_l.onnx> -d /content/ComfyUI/models/onnx -o yolox_l.onnx
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/yzd-v/DWPose/resolve/main/dw-ll_ucoco_384.onnx> -d /content/ComfyUI/models/onnx -o dw-ll_ucoco_384.onnx
# facerestore_models : $WORKSPACE/models/facerestore_models
!mkdir /content/ComfyUI/models/facerestore_models
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/GFPGANv1.4.pth> -d /content/ComfyUI/models/facerestore_models -o GFPGANv1.4.pth
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth> -d /content/ComfyUI/models/facerestore_models -o codeformer.pth
# アップスケーラー
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/embed/upscale/resolve/main/4x-UltraSharp.pth> -d /content/ComfyUI/models/upscale_models -o 4x-UltraSharp.pth
# ネガティブプロンプト
!git clone <https://huggingface.co/embed/negative> $WORKSPACE/models/embeddings/negative
!wget -c -P $WORKSPACE/models/embeddings/negative/
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://civitai.com/api/download/models/77169> -d /content/ComfyUI/models/embeddings/negative -o BadDream.pt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://civitai.com/api/download/models/77173> -d /content/ComfyUI/models/embeddings/negative -o UnrealisticDream.pt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://civitai.com/api/download/models/25820> -d /content/ComfyUI/models/embeddings/negative -o verybadimagenegative_v1.3.pt
# 依存関係のインストール
%cd $WORKSPACE
!pip install xformers!=0.0.18 -r requirements.txt
# VAEのダウンロード
!wget -c <https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors> -P ./models/vae/
!wget -c <https://huggingface.co/AIARTCHAN/aichan_blend/resolve/main/vae/BerrysMix.vae.safetensors> -P ./models/vae/
#checkpointをダウンロード
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://civitai.com/api/download/models/130072> -d /content/ComfyUI/models/checkpoints -o realisticVisionV51_v51VAE.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://civitai.com/api/download/models/143906> -d /content/ComfyUI/models/checkpoints -o EpicRealismNaturalSinRC1VAE.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://civitai.com/api/download/models/177164> -d /content/ComfyUI/models/checkpoints -o braBeautifulRealistic_v70.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://civitai.com/api/download/models/245598> -d /content/ComfyUI/models/checkpoints -o RealisticVisionV60_B1.safetensors
#ControlNetのダウンロード
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11e_sd15_ip2p_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11e_sd15_shuffle_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_canny_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15_canny_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11f1p_sd15_depth_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15_inpaint_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_lineart_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15_lineart_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15_mlsd_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15_normalbae_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_openpose_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15_openpose_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_scribble_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15_scribble_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_seg_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15_seg_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_softedge_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15_softedge_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11p_sd15s2_lineart_anime_fp16.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M <https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11u_sd15_tile_fp16.safetensors> -d /content/ComfyUI/models/controlnet -o control_v11u_sd15_tile_fp16.safetensors
# LoRAのダウンロード
!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 /content/ComfyUI/models/loras -o lcm-lora-sdv1-5_lora_weights.safetensors
# cloudflaredのダウンロードとインストール
!wget <https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb>
!dpkg -i cloudflared-linux-amd64.deb
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 cloudflared (if it gets stuck here cloudflared is having issues)\\n")
p = subprocess.Popen(["cloudflared", "tunnel", "--url", f"<http://127.0.0.1>:{port}"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for line in p.stderr:
l = line.decode()
if "trycloudflare.com " in l:
print("This is the URL to access ComfyUI:", l[l.find("http"):], end='')
# スレッドの開始
threading.Thread(target=iframe_thread, daemon=True, args=(8188,)).start()
# ComfyUIの実行
!python main.py --dont-print-server
利用ファイル
materials.zip