[系列教程](/zh/tutorial "系列教程")[ComfyUI 基础入门教程](/zh/tutorial/basic "ComfyUI 基础入门教程")3.与WebUI共用模型设置

### [Qwen-Image-Layered 发布 - 支持图像分层编辑的生成模型](/zh/news/2025-12-19-qwen-image-layered-release)

2025/12/19

# ComfyUI 与其它 Stable diffusion AI绘图 WebUI 要如何共享绘图模型?自定义模型位置

💡

如果你目前仅使用 ComfyUI 那么你可以略过这一章节,不过通过本章你也可以了解如何自定义存储 ComfyUI 的模型文件位置

本文将指导你如何将 ComfyUI 与其它 WebUI 程序共享绘图模型或者如何使用设置自定义的模型存储位置的设置 本文将针对以下两个版本进行说明:

* ComfyUI Desktop 桌面版(Comfy.org 最新推出的桌面端)
* ComfyUI Portable 便携版(最早的 ComfyUI 便携版)

Desktop 桌面版和 Portable 便携版 的配置逻辑基本相同,但是原始提供的 example 文件内容有所差异,下面将分别进行说明

💡

请在修改对应的文件之前记得备份文件内容,防止因为修改错误导致的软件无法正常启动的问题,对应的配置都需要重启才能够正确应用,如果你的修改错误的,那很有可能会导致在重启的时候报错而导致软件无法正常启动,如果出现类似的错误,你可以查看一下错误日志或者恢复对应的这个文件到我们备份的这个版本

### ComfyUI Desktop 桌面版如何配置与 A1111 共享绘图模型

在 ComfyUI Desktop 桌面版中,`extra_model_paths.yaml` 你可以在启动 ComfyUI Desktop 桌面版后,`帮助 -> 打开文件夹 -> Open extra_model_paths.yaml ` 菜单中找到 ![extra-model-paths](images/ca609bcf17c964fcc5f2808c79951100.jpg)

选择对应的菜单项,然后用记事本程序打开

WindowsMac

**Windows 系统下** 查找 `C:Users<你的用户名>AppDataRoamingComfyUI` 目录下的`extra_model_paths.yaml` 文件

**Mac 系统下** 查找 `/Users/你的用户名/Library/Application Support/ComfyUI` 目录下的`extra_model_paths.yaml` 文件

建议复制一份备份然后对原始文件进行修改

对应原始文件内容示例如下:

# ComfyUI extra_model_paths.yaml for win32
comfyui_desktop:
is_default: "true"
checkpoints: modelscheckpoints
classifiers: modelsclassifiers
clip: modelsclip
clip_vision: modelsclip_vision
configs: modelsconfigs
controlnet: modelscontrolnet
diffusers: modelsdiffusers
diffusion_models: modelsdiffusion_models
embeddings: modelsembeddings
gligen: modelsgligen
hypernetworks: modelshypernetworks
loras: modelsloras
photomaker: modelsphotomaker
style_models: modelsstyle_models
unet: modelsunet
upscale_models: modelsupscale_models
vae: modelsvae
vae_approx: modelsvae_approx
animatediff_models: modelsanimatediff_models
animatediff_motion_lora: modelsanimatediff_motion_lora
animatediff_video_formats: modelsanimatediff_video_formats
ipadapter: modelsipadapter
liveportrait: modelsliveportrait
insightface: modelsinsightface
layerstyle: modelslayerstyle
LLM: modelsLLM
Joy_caption: modelsJoy_caption
sams: modelssams
blip: modelsblip
CogVideo: modelsCogVideo
xlabs: modelsxlabs
instantid: modelsinstantid
custom_nodes: custom_nodes/
download_model_base: models
base_path: D:ComfyUI

### 如何修改配置

下面是对于 yaml 文件的配置说明:

模型类型| 配置键名 (必须,不能修改)| 默认相对路径(可以修改)
---|---|---
是否默认配置 (只能有一个)| is_default| true/false
Checkpoint 模型| checkpoints| models/checkpoints/
LoRA 模型| loras| models/loras/
VAE 模型| vae| models/vae/
控制网络| controlnet| models/controlnet/
文本编码器| clip| models/clip/
图像编码器| clip_vision| models/clip_vision/
放大模型| upscale_models| models/upscale_models/
嵌入模型| embeddings| models/embeddings/
超网络| hypernetworks| models/hypernetworks/
风格模型| style_models| models/style_models/
照片制作器| photomaker| models/photomaker/
IP适配器| ipadapter| models/ipadapter/
动画模型| animatediff_models| models/animatediff_models/
动画LoRA| animatediff_motion_lora| models/animatediff_motion_lora/
分类器| classifiers| models/classifiers/
生成模型| diffusers| models/diffusers/
自定义节点| custom_nodes| custom_nodes/
下载模型基础| download_model_base| models/
基础路径(必须)| base_path| D:/ComfyUI

💡

请注意,对应的表格只是说明可能的模型类型保存文件夹位置,并不是所有的模型文件都要按这个表格的位置来进行保存,对于模型保存位置,你需要参考对应具体的教程或者自定义节点的说明。 因为不同自定义节点的作者可能会偏好使用不同的模型存放位置!

如果下面是我提供的自定义的模型配置文件示例

comfyui_desktop:
is_default: "true"
checkpoints: modelscheckpoints
classifiers: modelsclassifiers
clip: modelsclip
clip_vision: modelsclip_vision
configs: modelsconfigs
controlnet: modelscontrolnet
diffusers: modelsdiffusers
diffusion_models: modelsdiffusion_models
embeddings: modelsembeddings
gligen: modelsgligen
hypernetworks: modelshypernetworks
loras: modelsloras
photomaker: modelsphotomaker
style_models: modelsstyle_models
unet: modelsunet
upscale_models: modelsupscale_models
vae: modelsvae
vae_approx: modelsvae_approx
animatediff_models: modelsanimatediff_models
animatediff_motion_lora: modelsanimatediff_motion_lora
animatediff_video_formats: modelsanimatediff_video_formats
ipadapter: modelsipadapter
liveportrait: modelsliveportrait
insightface: modelsinsightface
layerstyle: modelslayerstyle
LLM: modelsLLM
Joy_caption: modelsJoy_caption
sams: modelssams
blip: modelsblip
CogVideo: modelsCogVideo
xlabs: modelsxlabs
instantid: modelsinstantid
custom_nodes: custom_nodes/
download_model_base: models
base_path: D:ComfyUI

custom_models:
base_path: E:
checkpoints: modelscheckpoints
classifiers: modelsclassifiers
clip: modelsclip
# ... 其他模型路径 ...
a1111:
base_path: D:stable-diffusion-webui
checkpoints: models/Stable-diffusion
# ... 其他模型路径 ...

* `base_path` 这个是在每个配置里面都是有新增自定义的
* 每个配置节点的名称你可以自定义比如`custom_models` 或者`a1111` 等等,但是不能重复,否则会报错
* `is_default` 这个是用来指定这个配置文件是否是默认的配置文件,只能有一个,如果设置为`true`,那么这个配置文件就会成为默认的配置文件,否则就会成为非默认的配置文件
* 键名需要与原始的配置文件一致,文件夹为你实际的文件夹
* 请注意`custom_nodes` 这个文件夹是用来存放自定义的插件的路径的这是在原本Portable 便携版中没有的,在桌面版中是有的,最好保持默认

## ComfyUI Portable 便携版如何配置与 A1111 共享绘图模型

在对应`ComfyUI Portable`的安装目录里都可以找到`extra_model_paths.yaml.example` 这个文件,路径如下

ComfyUI_windows_portable
├──ComfyUI
│ ├── extra_model_paths.yaml.example // 此文件为配置文件
│ └── ...省略其它文件
└── ...省略其它文件

找到以上文件后修改文件名`extra_model_paths.yaml.example` 为`extra_model_paths.yaml`,然后用记事本软件进行编辑

对应原始文件内容如下:

#Rename this to extra_model_paths.yaml and ComfyUI will load it

#config for a1111 ui
#all you have to do is change the base_path to where yours is installed
a111:
base_path: path/to/stable-diffusion-webui/

checkpoints: models/Stable-diffusion
configs: models/Stable-diffusion
vae: models/VAE
loras: |
models/Lora
models/LyCORIS
upscale_models: |
models/ESRGAN
models/RealESRGAN
models/SwinIR
embeddings: embeddings
hypernetworks: models/hypernetworks
controlnet: models/ControlNet

#config for comfyui
#your base path should be either an existing comfy install or a central folder where you store all of your models, loras, etc.

#comfyui:
# base_path: path/to/comfyui/
# checkpoints: models/checkpoints/
# clip: models/clip/
# clip_vision: models/clip_vision/
# configs: models/configs/
# controlnet: models/controlnet/
# embeddings: models/embeddings/
# loras: models/loras/
# upscale_models: models/upscale_models/
# vae: models/vae/

#other_ui:
# base_path: path/to/ui
# checkpoints: models/checkpoints
# gligen: models/gligen
# custom_nodes: path/custom_nodes

你可以看到在`a111:`的设置部分有 `base_path:` 用来指定 [WebUI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) 根目录所在路径,你可以把此处修改为你的 [WebUI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) 或者自定义的模型文件夹位置所在的路径,记得在`:` 后需要有一个空格,修改完成后保存对应文件,重启**ComfyUI** 即可。

* 你需要确保在`base_path:`路径之下的文件路径是正确的
* 注意在不同系统比如Mac 或者 Linux 系统下,路径的格式可能有所不同
* 如果假设**WebUI** 安装路径为`D:stable-diffusion-webui`则`vae` 在上方配置文件设置下对应路径vae 模型文件路径最终会是应该为`D:stable-diffusion-webuimodelsVAE`,请检查对应文件夹其它类似`checkpoints`、`loras`,也请检查对应的配置。

如果你重启以后发现你的`checkpoints`或者 `VAE`等没有顺利加载,请检查你的配置是否正确。

对于其它UI 你也可以参考上方配置文件进行修改,比如`other_ui:`等,你可以取消代码前的`#`注释来增加对应UI的设置,然后修改`base_path:`和对应各类绘图模型的路径即可

主题授权提示:请在后台主题设置-主题授权-激活主题的正版授权,授权购买:RiTheme官网

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。