安装本体
秋叶整合包
-
https://pan.baidu.com/s/19aektdzDcnkLdQhEtDJTJA
- 提取码: aaki
- 解压密码:bilibili-秋葉aaaki
github原版
首页 https://github.com/comfyanonymous/ComfyUI
本质上是个python web应用,所以python web的套路这里都可以用
手动换源
0 1 2 |
python_embeded\Scripts\pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple python_embeded\Scripts\pip config unset global.index-url |
hf镜像配置
在main.py
的入口添加一行环境变量
0 1 |
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com' |
分离外部存储
虽然有些参数可以通过命令行参数传入,但这里选用最粗暴的方式注入配置 复制模板extra_model_paths.yaml.example
到文件/data/lib/comfyui-data/extra_model_paths.yaml
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
comfyui: base_path: d:/lib/comfyui-data/ # You can use is_default to mark that these folders should be listed first, and used as the default dirs for eg downloads #is_default: true checkpoints: models/checkpoints/ clip: models/clip/ clip_vision: models/clip_vision/ configs: models/configs/ controlnet: models/controlnet/ ipadapter: models/ipadapter/ diffusion_models: | models/diffusion_models models/unet embeddings: models/embeddings/ loras: models/loras/ upscale_models: models/upscale_models/ style_models: models/style_models/ vae: models/vae/ gligen: models/gligen |
main.py
0 1 2 3 4 5 6 7 8 9 10 |
external_dir='/data/lib/comfyui-data' external_config=f'{external_dir}/extra_model_paths.yaml' utils.extra_config.load_extra_path_config(external_config) user_dir=os.path.abspath(f'{external_dir}/user') input_dir=os.path.abspath(f'{external_dir}/input') output_dir=os.path.abspath(f'{external_dir}/output') folder_paths.set_user_directory(user_dir) folder_paths.set_input_directory(input_dir) folder_paths.set_output_directory(output_dir) folder_paths.set_temp_directory(output_dir) |
启动
0 1 |
./run_nvidia_gpu.bat |
访问http://127.0.0.1:8188/
安装插件
默认路径ComfyUI/custom_nodes
0 1 2 3 |
<span class="hljs-built_in">cd</span> ComfyUI/custom_nodes git <span class="hljs-built_in">clone</span> https://github.com/ltdrdata/ComfyUI-Manager.git |
可手动更新模型列表
0 1 2 3 |
https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json ComfyUI\custom_nodes\ComfyUI-Manager\model-list.json |
安装工作流
保存位置 ComfyUI\user\default\workflows
0 1 2 3 4 5 6 7 |
cd ComfyUI\user\default\workflows # ComfyUI官方示范 https://comfyanonymous.github.io/ComfyUI_examples/ git clone git@github.com:comfyanonymous/ComfyUI_examples.git # 别人的基础工作流示范1 https://github.com/cubiq/ComfyUI_Workflows git clone git@github.com:cubiq/ComfyUI_Workflows.git # 别人的基础工作流示范2 https://github.com/wyrde/wyrde-comfyui-workflows git clone git@github.com:wyrde/wyrde-comfyui-workflows.git |
工作流分享网站
Civitai也有不少工作流分享
安装模型
默认位置
- ComfyUI\models
- ComfyUI\models\checkpoints
- ComfyUI\models\vae
- ComfyUI\models\loras
手动下载
0 1 2 3 4 |
export HF_TOKEN=xxxxxxxx wget --header "Authorization: Bearer $HF_TOKEN" 'xxxxxxxxx' curl -L --header "Authorization: Bearer $HF_TOKEN" -o xxxxxxx.safetensors 'xxxxxxxx' |
- https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt
- https://huggingface.co/stabilityai/stable-diffusion-3.5-controlnets/resolve/main/sd3.5_large_controlnet_blur.safetensors
- https://huggingface.co/stabilityai/stable-diffusion-3.5-controlnets/resolve/main/sd3.5_large_controlnet_canny.safetensors
- https://huggingface.co/stabilityai/stable-diffusion-3.5-controlnets/resolve/main/sd3.5_large_controlnet_depth.safetensors
- anything-v5-PrtRE.safetensors
通过插件安装
ComfyUI-Manager 下载过程源码入口 custom_nodes\ComfyUI-Manager\glob\manager_server.py:1120
0 1 2 |
@routes.post("/model/install") async def install_model(request): |
默认用的
0 1 2 |
from torchvision.datasets.utils import download_url as torchvision_download_url return torchvision_download_url(model_url, model_dir, filename) |
查看产物
默认目录ComfyUI\output
操作技巧
- 双击空白区域可以搜索并添加新节点
- 点击
convert [parm name] to input
或convert [parm name] to widget
可以抽离可复用的参数
CONTRIBUTE
- 在网不好的情况下打印模型原始url方便人工处理 https://github.com/ltdrdata/ComfyUI-Manager/pull/1478
- TODO 自动修复丢失的模型 https://github.com/ltdrdata/ComfyUI-Manager/issues/719
- TODO 统一windows和linux的文件路径格式,windows上有的是/有的是\
- TODO 直接将workflow暴露出接口?待调研是否有人做过
- TODO 检测外部模型文件夹显示模型下载状态
- TODO 模型下载中允许继续搜索其他模型
CHANGELOG
- 20250128 继续测试一些demo
- 20250126 测试一些demo
- 20250125 研究原理,打印原始模型url方便手动下载
- 20240525 安装原版跑通demo
0 Comments