google colab ローカルランタイムでcomfyui champを動かしたいです
google colab ローカルランタイムでcomfyui champを動かしたいです
例)
https://internet.watch.impress.co.jp/docs/column/shimizu/1531958.html
こちらのページでgoogle colab ローカルランタイムに接続することに成功したのですが
https://amused-egret-94a.notion.site/Champ-ComfyUI-db79f47313214cba932de69ff6d3b120
こちらのインストールコマンドでcomfyui champを実行すると
外部サイトにアクセスする際にエラーが起きてしまいます。
pythonなどの言語知識は一切わかりません。
外部アクセスが必要な場合は以下
app.launch(server_name="0.0.0.0", share=True)
こちらをどこかに記述すれば解決できそうな気がしてるのですが
なにぶん無知なので知識が豊富なかたご教授いただけないでしょうか?
よろしくお願いいたします。
Hugging FaceのURIに接続でていなようなエラーメッセージが出ています。
発生している問題・エラー
出ているエラーメッセージを入力
例)
NameError (uninitialized constant World)
または、問題・エラーが起きている画像をここにドラッグアンドドロップ
該当するソースコード
ソースコードを入力
!apt -y install -qq aria2
!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
!pip install torchsde onnxruntime-gpu insightface segment_anything watchdog omegaconf piexif
%cd /content
!git clone https://github.com/comfyanonymous/ComfyUI.git
%cd /content/ComfyUI
!git reset --hard 130646453891bea5e86c93b689fe2daf93cae35c
!pip install -r requirements.txt
import requests
import os
指定されたURLからファイルをダウンロードする関数
def download_file(url, filename):
# ファイルをダウンロードするためのリクエストを送る
r = requests.get(url)
# ステータスコードが200(成功)の場合、ファイルを保存
if r.status_code == 200:
# ファイルを保存するディレクトリが存在しない場合、ディレクトリを作成
os.makedirs(os.path.dirname(filename), exist_ok=True)
# ファイルを書き込みモードで開き、ダウンロードした内容を保存
with open(filename, 'wb') as f:
f.write(r.content)
print(f"ファイルがダウンロードされ、{filename}に保存されました。")
else:
print(f"ファイルのダウンロードに失敗しました。ステータスコード: {r.status_code}")
実行
download_file("https://archive.creativaier.com/comfyui/63_champ/main.py.txt", "/content/ComfyUI/main.py")
ComfyUI Managerのインストール
%cd /content/ComfyUI/custom_nodes
!git clone https://github.com/ltdrdata/ComfyUI-Manager.git
!git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite
---------------- ComfyUI-KJNodesの設定開始 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone https://github.com/kijai/ComfyUI-KJNodes
!pip install -r /content/ComfyUI/custom_nodes/ComfyUI-KJNodes/requirements.txt
---------------- ComfyUI-KJNodesの設定終了 ---------------------
---------------- ComfyUI-champWrapperの設定開始 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone https://github.com/kijai/ComfyUI-champWrapper
%cd ComfyUI-champWrapper
!pip install -r requirements.txt
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/denoising_unet.pth -d /content/ComfyUI/custom_nodes/ComfyUI-champWrapper/checkpoints -o denoising_unet.pth
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/guidance_encoder_depth.pth -d /content/ComfyUI/custom_nodes/ComfyUI-champWrapper/checkpoints -o guidance_encoder_depth.pth
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/guidance_encoder_dwpose.pth -d /content/ComfyUI/custom_nodes/ComfyUI-champWrapper/checkpoints -o guidance_encoder_dwpose.pth
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/guidance_encoder_normal.pth -d /content/ComfyUI/custom_nodes/ComfyUI-champWrapper/checkpoints -o guidance_encoder_normal.pth
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/guidance_encoder_semantic_map.pth -d /content/ComfyUI/custom_nodes/ComfyUI-champWrapper/checkpoints -o guidance_encoder_semantic_map.pth
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/motion_module.pth -d /content/ComfyUI/custom_nodes/ComfyUI-champWrapper/checkpoints -o motion_module.pth
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/champ/reference_unet.pth -d /content/ComfyUI/custom_nodes/ComfyUI-champWrapper/checkpoints -o reference_unet.pth
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/raw/main/image_encoder/config.json -d /content/ComfyUI/custom_nodes/ComfyUI-champWrapper/checkpoints/image_encoder -o config.json
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/champ/resolve/main/image_encoder/pytorch_model.bin -d /content/ComfyUI/custom_nodes/ComfyUI-champWrapper/checkpoints/image_encoder -o pytorch_model.bin
---------------- ComfyUI-champWrapperの設定開始 ---------------------
---------------- ComfyUI-KJNodesの設定開始 ---------------------
!git clone https://github.com/kijai/ComfyUI-KJNodes
!pip install -r /content/ComfyUI/custom_nodes/ComfyUI-KJNodes/requirements.txt
---------------- ComfyUI-KJNodesの設定終了 ---------------------
---------------- ComfyUI-Inference-Core-Nodesの設定開始 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes
%cd ComfyUI-Inference-Core-Nodes
!python install.py
---------------- ComfyUI-Inference-Core-Nodesの設定開始 ---------------------
---------------- comfyui_controlnet_auxの設定開始 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone https://github.com/Fannovel16/comfyui_controlnet_aux.git
!git checkout f8d081cde307c4d4ee9c8ba8e990df491aa3c6db
!pip install -r /content/ComfyUI/custom_nodes/comfyui_controlnet_aux/requirements.txt
ControlNetのモデルは別途インストール
---------------- comfyui_controlnet_auxの設定完了 ---------------------
---------------- ComfyUI-Video-Mattingの設定開始 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone https://github.com/Fannovel16/ComfyUI-Video-Matting
%cd ComfyUI-Video-Matting
!pip install -r requirements.txt
%cd /content/ComfyUI/custom_nodes
---------------- ComfyUI-Video-Mattingの設定完了 ---------------------
---------------- rgthree-comfyの設定完了 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone https://github.com/rgthree/rgthree-comfy
%cd rgthree-comfy
!pip install -r requirements.txt
%cd /content/ComfyUI/custom_nodes
---------------- rgthree-comfyの設定完了 ---------------------
---------------- ComfyUI_essentialsの設定完了 ---------------------
%cd /content/ComfyUI/custom_nodes
!git clone https://github.com/cubiq/ComfyUI_essentials
%cd ComfyUI_essentials
!pip install -r requirements.txt
%cd /content/ComfyUI/custom_nodes
---------------- ComfyUI_essentialsの設定完了 ---------------------
Checkpointをダウンロード
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors -d /content/ComfyUI/models/checkpoints -o v1-5-pruned-emaonly.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/90072 -d /content/ComfyUI/models/checkpoints -o photon_v1.safetensors
VAEをダウンロード
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors -d /content/ComfyUI/models/vae -o vae-ft-mse-840000-ema-pruned.safetensors
Negative Promptをダウンロード
!git clone https://huggingface.co/embed/negative /content/ComfyUI/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 -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 -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 -o verybadimagenegative_v1.3.pt
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
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/OedoSoldier/detail-tweaker-lora/resolve/main/add_detail.safetensors -d /content/ComfyUI/models/loras -o add_detail.safetensors
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/32215 -d /content/ComfyUI/models/loras -o AsianCuteFace.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
Upscalerをダウンロード
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/uwg/upscaler/resolve/main/ESRGAN/4x-UltraSharp.pth -d /content/ComfyUI/models/upscale_models -o 4x-UltraSharp.pth
!wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
!dpkg -i cloudflared-linux-amd64.deb
import subprocess
import threading
import time
import socket
import subprocess
import os
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='')
%cd /content/ComfyUI
スレッドの開始
threading.Thread(target=iframe_thread, daemon=True, args=(8188,)).start()
ComfyUIの実行
!python main.py --dont-print-server
例)
def greet
puts Hello World
end
自分で試したこと
ここに問題・エラーに対して試したことを記載してください。