Skip to content
Help ComfyUI Wiki remove ads Become a Patron

How to link Stable Diffusion Models Between ComfyUI and A1111 or Other Stable Diffusion AI image generator WebUI?

This guide will show you how to share drawing models between ComfyUI and other WebUI programs or how to configure custom model storage locations. We will cover two versions:

  • ComfyUI Desktop (Latest desktop version from Comfy.org)
  • ComfyUI Portable (The original portable version)

The configuration logic is basically the same for both Desktop and Portable versions, but there are differences in the original example file contents, which we will explain separately below.

πŸ’‘

Please remember to backup the file contents before making any modifications to prevent issues that could prevent the software from starting normally. The configurations need to be restarted to be correctly applied. If your modifications are incorrect, it may cause errors during restart and prevent the software from starting normally. If such errors occur, you can check the error log or restore the file to our backed-up version.

How to Configure Model Sharing Between ComfyUI Desktop and A1111

In ComfyUI Desktop version, you can find extra_model_paths.yaml after launching ComfyUI Desktop, under the menu Help -> Open Folder -> Open extra_model_paths.yaml extra-model-paths

Select the corresponding menu item and open it with a text editor.

Or find the extra_model_paths.yaml file in the C:\Users\Administrator\AppData\Roaming\ComfyUI directory

Since I don’t have a Mac computer, I cannot provide the Mac file path. You can add it in the comments.

The original file content is as follows:

# 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

How to Modify the Configuration

Below is the configuration explanation for the yaml file:

Model TypeConfig Key (Required, Unchangeable)Default Relative Path (Modifiable)
Default Config (Only One)is_defaulttrue/false
Checkpoint Modelscheckpointsmodels/checkpoints/
LoRA Modelslorasmodels/loras/
VAE Modelsvaemodels/vae/
Control Networkscontrolnetmodels/controlnet/
Text Encoderclipmodels/clip/
Image Encoderclip_visionmodels/clip_vision/
Upscale Modelsupscale_modelsmodels/upscale_models/
Embeddingsembeddingsmodels/embeddings/
Hypernetworkshypernetworksmodels/hypernetworks/
Style Modelsstyle_modelsmodels/style_models/
PhotoMakerphotomakermodels/photomaker/
IP Adapteripadaptermodels/ipadapter/
Animation Modelsanimatediff_modelsmodels/animatediff_models/
Animation LoRAanimatediff_motion_loramodels/animatediff_motion_lora/
Classifiersclassifiersmodels/classifiers/
Diffusersdiffusersmodels/diffusers/
Vision Modelsclip_visionmodels/clip_vision/
Custom Nodescustom_nodescustom_nodes/
Download Model Basedownload_model_basemodels/
Base Path (Required)base_pathD:/ComfyUI

Here is an example of a custom model configuration file:

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\
  # ... other model paths ...
a1111:
  base_path: D:\stable-diffusion-webui
  checkpoints: models/Stable-diffusion
  # ... other model paths ...
  • base_path is customizable in each configuration
  • Each configuration node name can be customized like custom_models or a1111, but cannot be duplicated, or it will cause an error
  • is_default specifies whether this configuration file is the default configuration file. There can only be one, if set to true, this configuration file will become the default configuration file
  • Key names must match the original configuration file, and folders should be your actual folders
  • Please note that the custom_nodes folder is used to store custom plugin paths, which was not in the original Portable version but is present in the desktop version. It’s best to keep it as default.

How to Configure Model Sharing Between ComfyUI Portable and A1111

In the corresponding ComfyUI Portable installation directory, you can find the extra_model_paths.yaml.example file at the following path:

ComfyUI_windows_portable
β”œβ”€β”€ComfyUI
β”‚  β”œβ”€β”€ extra_model_paths.yaml.example   // This is the configuration file                                    
β”‚  └──    ...other files omitted
└──       ...other files omitted

After finding the above file, rename extra_model_paths.yaml.example to extra_model_paths.yaml, and then edit it with a text editor.

The original file content is as follows:

#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

You can see that in the a111: settings section there is a base_path: used to specify the root directory path of WebUI. You can change this to the path where your WebUI or custom model folder is located. Remember to have a space after the :. After making the changes, save the corresponding file and restart ComfyUI.

  • You need to ensure that the file paths under the base_path: path are correct
  • Note that the path format may be different on different systems like Mac or Linux
  • For example, if the WebUI installation path is D:\stable-diffusion-webui\, then under the above configuration settings, the vae model file path would ultimately be D:\stable-diffusion-webui\models\VAE. Please check the corresponding folders for other items like checkpoints, loras, and verify their configurations.

If after restarting you find that your checkpoints or VAE etc., have not been loaded successfully, please check if your configuration is correct.

For other UIs, you can also modify the configuration file as shown above, such as other_ui: etc. You can uncomment the # in front of the code to add the settings for the corresponding UI, and then modify the base_path: and the paths for the corresponding drawing models.