ubuntu 安装 ComfyUI

本页内容

ubuntu 安装 ComfyUI

背景

ComfyUI 是用于稳定扩散的基于节点的用户界面。ComfyUI 由 Comfyanonymous 于 2023 年 1 月创建,他创建了该工具来学习稳定扩散的工作原理。

效果

webui和ComfyUI之间的区别,相比较webUI,ComfyUI更工业化,更符合高级使用者的配置

安装

安装本体

下载软件

1mkdir ~/sd-web
2cd ~/sd-web
3git clone https://github.jobcher.com/gh/https://github.com/comfyanonymous/ComfyUI.git

环境依赖

1cd ~/sd-web/ComfyUI
2conda create -n ComfyUI python=3.10
3pip install -r requirements.txt -i https://pypi.douban.com/simple --trusted-host=pypi.douban.com

下载sd_xl_turbo模型

1aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.jobcher.com/https://huggingface.co/stabilityai/sdxl-turbo/resolve/main/sd_xl_turbo_1.0_fp16.safetensors -d ~/sd-web/ComfyUI/models/checkpoints -o sd_xl_turbo_1.0_fp16.safetensors

启动服务

1cd ~/sd-web/ComfyUI
2python main.py --listen --port 6006 --cuda-device 1

webUI共享模型

1cd 
2mv extra_model_paths.yaml..example extra_model_paths.yaml

编辑参数

1vim extra_model_paths.yaml

修改 base_path: path/to/stable-diffusion-webui/ 改为你的webui实际地址,例如: base_path: ~/sd-web/stable-diffusion-webui/

 1#config for a1111 ui
 2#all you have to do is change the base_path to where yours is installed
 3a111:
 4    base_path: path/to/stable-diffusion-webui/ ## 这里改为你实际的webui地址
 5
 6    checkpoints: models/Stable-diffusion
 7    configs: models/Stable-diffusion
 8    vae: models/VAE
 9    loras: |
10         models/Lora
11         models/LyCORIS         
12    upscale_models: |
13                  models/ESRGAN
14                  models/RealESRGAN
15                  models/SwinIR                  
16    embeddings: embeddings
17    hypernetworks: models/hypernetworks
18    controlnet: models/ControlNet

重启服务

1python main.py --listen --port 6006 --cuda-device 1