LoginSignup
1
2

コピペで始める ComfyUI 導入

Posted at

はじめに

当方、長らく Stable Diffusion Web UI のお世話になっていたのですが、 ComfyUI のビジュアルがイケ過ぎているので、唐突に乗り換えてみたい気持ちに駆られた昨今。
乗り換えに際して、環境構築した時の手順を此処に残しておきます。
これから導入しようとしている各位の参考になれば幸いです。

想定読者

  • ComfyUI を Linux に導入したい人
  • 未来の自分

環境変数とか

この後のコピペコードで参照するので、環境変数に便利な変数入れておく。
ComfyUI を導入したい作業ディレクトリに移動して、以下のコマンドを実行。

export WORK_ROOT=${PWD}

ComfyUI の導入

まずは本体を導入

cd ${WORK_ROOT}
git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
pip install xformers!=0.0.18 -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu118 --extra-index-url https://download.pytorch.org/whl/cu117
cd custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager
cd ComfyUI-Manager
pip install -r requirements.txt
pip install torchvision

モデルの導入

お好きなモデルを入れましょう。

Sudachi

2Dぽい絵を描こう

cd ${WORK_ROOT}
wget -c "https://civitai.com/api/download/models/92024?type=Model&format=SafeTensor&size=pruned&fp=fp16" -O ./ComfyUI/models/checkpoints/sudachi_v10.safetensors

Hassaku

アニメ絵を描こう

cd ${WORK_ROOT}
wget -c "https://civitai.com/api/download/models/106922?type=Model&format=SafeTensor&size=pruned&fp=fp16" -O ./ComfyUI/models/checkpoints/hassaku_v13.safetensors

VAE

cd ${WORK_ROOT}
wget -c https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors -P ./ComfyUI/models/vae/

ControlNet

構図を決めよう

cd ${WORK_ROOT}
wget -c https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11p_sd15_lineart.pth -P ./ComfyUI/models/controlnet/
wget -c https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11p_sd15_openpose.pth -P ./ComfyUI/models/controlnet/
wget -c https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11f1p_sd15_depth.pth -P ./ComfyUI/models/controlnet/

ESRGAN upscale model

良い感じにアップスケールしよう

cd ${WORK_ROOT}
wget -c https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-animevideov3.pth -P ./ComfyUI/models/upscale_models/
wget -c https://huggingface.co/ai-forever/Real-ESRGAN/resolve/main/RealESRGAN_x2.pth -P ./ComfyUI/models/upscale_models/

ComfyUI の起動

ComfyUI の起動方法

cd ${WORK_ROOT}
python ./ComfyUI/main.py

その他

AnimeDiff の準備

AnimateDiff for ComfyUI の導入

cd ${WORK_ROOT}/ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git

AnimeDiff 用モデルの導入

cd ${WORK_ROOT}/ComfyUI/custom_nodes/ComfyUI-AnimateDiff-Evolved/
wget -c https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v14.ckpt  -P ./models/

VideoHelperSuite の導入

cd ${WORK_ROOT}/ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git
cd ${WORK_ROOT}/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/
pip install opencv-python-headless
pip install -r requirements.txt

おわりに

ComfyUI、とっても便利。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2