ByteDance发布Sa2VA:首个图像视频统一理解模型
2025/10/17
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  菜单中找到

选择对应的菜单项,然后用记事本程序打开
Windows 系统下 查找 C:\Users\<你的用户名>\AppData\Roaming\ComfyUI 目录下的extra_model_paths.yaml 文件
建议复制一份备份然后对原始文件进行修改
对应原始文件内容示例如下:
# ComfyUI extra_model_paths.yaml for win32
comfyui_desktop:
  is_default: "true"
  checkpoints: models\checkpoints\
  classifiers: models\classifiers\
  clip: models\clip\
  clip_vision: models\clip_vision\
  configs: models\configs\
  controlnet: models\controlnet\
  diffusers: models\diffusers\
  diffusion_models: models\diffusion_models\
  embeddings: models\embeddings\
  gligen: models\gligen\
  hypernetworks: models\hypernetworks\
  loras: models\loras\
  photomaker: models\photomaker\
  style_models: models\style_models\
  unet: models\unet\
  upscale_models: models\upscale_models\
  vae: models\vae\
  vae_approx: models\vae_approx\
  animatediff_models: models\animatediff_models\
  animatediff_motion_lora: models\animatediff_motion_lora\
  animatediff_video_formats: models\animatediff_video_formats\
  ipadapter: models\ipadapter\
  liveportrait: models\liveportrait\
  insightface: models\insightface\
  layerstyle: models\layerstyle\
  LLM: models\LLM\
  Joy_caption: models\Joy_caption\
  sams: models\sams\
  blip: models\blip\
  CogVideo: models\CogVideo\
  xlabs: models\xlabs\
  instantid: models\instantid\
  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: models\checkpoints\
  classifiers: models\classifiers\
  clip: models\clip\
  clip_vision: models\clip_vision\
  configs: models\configs\
  controlnet: models\controlnet\
  diffusers: models\diffusers\
  diffusion_models: models\diffusion_models\
  embeddings: models\embeddings\
  gligen: models\gligen\
  hypernetworks: models\hypernetworks\
  loras: models\loras\
  photomaker: models\photomaker\
  style_models: models\style_models\
  unet: models\unet\
  upscale_models: models\upscale_models\
  vae: models\vae\
  vae_approx: models\vae_approx\
  animatediff_models: models\animatediff_models\
  animatediff_motion_lora: models\animatediff_motion_lora\
  animatediff_video_formats: models\animatediff_video_formats\
  ipadapter: models\ipadapter\
  liveportrait: models\liveportrait\
  insightface: models\insightface\
  layerstyle: models\layerstyle\
  LLM: models\LLM\
  Joy_caption: models\Joy_caption\
  sams: models\sams\
  blip: models\blip\
  CogVideo: models\CogVideo\
  xlabs: models\xlabs\
  instantid: models\instantid\
  custom_nodes: custom_nodes/
  download_model_base: models
  base_path: D:\ComfyUI
 
custom_models:
  base_path: E:\
  checkpoints: models\checkpoints\
  classifiers: models\classifiers\
  clip: models\clip\
  # ... 其他模型路径 ...
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 根目录所在路径,你可以把此处修改为你的 WebUI 或者自定义的模型文件夹位置所在的路径,记得在: 后需要有一个空格,修改完成后保存对应文件,重启ComfyUI即可。
- 你需要确保在
base_path:路径之下的文件路径是正确的 - 注意在不同系统比如Mac 或者 Linux 系统下,路径的格式可能有所不同
 - 如果假设WebUI安装路径为
D:\stable-diffusion-webui\则vae在上方配置文件设置下对应路径vae 模型文件路径最终会是应该为D:\stable-diffusion-webui\models\VAE,请检查对应文件夹其它类似checkpoints、loras,也请检查对应的配置。 
如果你重启以后发现你的checkpoints或者 VAE等没有顺利加载,请检查你的配置是否正确。
对于其它UI 你也可以参考上方配置文件进行修改,比如other_ui:等,你可以取消代码前的#注释来增加对应UI的设置,然后修改base_path:和对应各类绘图模型的路径即可