安装

1
git clone https://gitcode.com/comfyanonymous/ComfyUI.git

设置其中的torch==2.0.1

1
pip install -r requirement.txt

启动

设置sd模型路径

1
2
3
4
5
# comfyui项目目录下
cp extra_model_paths.yaml.example extra_model_paths.yaml
# 编辑extra_model_paths.yaml,修改
a111:
base_path: /root/stable-diffusion-webui/

设置启动脚本

1
2
3
4
5
6
7
8
netstat -nap|grep 8188|awk '{print $7}'|awk -F'/' '{print $1}'|xargs kill -9
echo "kill comfyui finish!"

conda init bash
conda activate comfyui
echo "nohup running comfyui!"
nohup python main.py --listen=0.0.0.0 &
echo "Please see nohup.out log!"

comfyui配置

  1. 和webui共享模型
    修改文件extra_model_paths.yaml(重命名extra_model_paths.yaml.example)
    把里面 base_path:的路径改成你需要共享的 webui 的安装地址。比如我的是:/root/stable-diffusion-webui/

comfyui插件

安装instantid节点到/root/ComfyUI/custom_nodes目录下

1
git clone https://github.com/cubiq/ComfyUI_InstantID.git
  • 下载 InstantID/ControlNetModel 中的 config.json 和 diffusion_pytorch_model.safetensors ,将模型地址填入 ID ControlNet Loader 节点中(例如:ComfyUI/custom_nodes/ComfyUI-InstantID/checkpoints/controlnet)
  • 下载 InstantID/ip-adapter 中的 ip-adapter.bin ,将其地址填入 Ipadapter_instantid Loader 节点中(例如:ComfyUI/custom_nodes/ComfyUI-InstantID/checkpoints)
  • 下载 DIAMONIK7777/antelopev2 中的所有模型,将其放入 ComfyUI//custom_nodes/ComfyUI-InstantID/models/antelopev2 中
  • 修改ComfyUI_InstantID仓库中的InstantID.py,将FaceAnalysis(name="antelopev2",XXX)中的模型名称修改为name="buffalo_l",并下载buffalo_l/root/ComfyUI/models/insightface/models/buffalo_l
  • 兼容性: CUDA11 支持默认安装的 onnxruntime-gpu(1.16.0),如果是 CUDA12 则需手动安装 onnxruntime-gpu==1.17.0 地址

comfyui文生图

comfyui图生图

参考