Independent virtual environments are necessary because ComfyUI’s dependencies may conflict with other dependencies on the system, and it can also avoid polluting the system-level Python environment.
Install Miniconda. This will help you install the correct versions of Python and other libraries needed by ComfyUI.Create an environment with Conda.
Use the command line to enter the installation path of ComfyUI, then pull the latest code.
Copy
Ask AI
cd <installation path>/ComfyUIgit pull
2
install the dependencies
Use the command line to enter the installation path of ComfyUI, then install the dependencies.
You need to ensure that the current Python environment is the ComfyUI virtual environment, otherwise the dependencies will be installed to the system-level Python environment, polluting the system-level Python environment.
For the ComfyUI version such as portable and manual, you can find an example file named extra_model_paths.yaml.example in the root directory of ComfyUI:
Copy
Ask AI
ComfyUI/extra_model_paths.yaml.example
Copy and rename it to extra_model_paths.yaml for use. Keep it in ComfyUI’s root directory at ComfyUI/extra_model_paths.yaml.
You can also find the config example file here
If the file does not exist, you can create it yourself with any text editor.
For the desktop version, please add the configuration to the existing configuration path without overwriting the path configuration generated during installation. Please back up the corresponding file before modification, so that you can restore it when you make a mistake.
Or you can refer to the default extra_model_paths.yaml.example for more configuration options. After saving, you need to restart ComfyUI for the changes to take effect.Below is the original config example:
Copy
Ask AI
#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 installeda111: 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/# # 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/# diffusion_models: |# models/diffusion_models# models/unet# 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
For example, if your WebUI is located at D:\stable-diffusion-webui\, you can modify the corresponding configuration to
Besides adding external models, you can also add custom nodes paths that are not in the default path of ComfyUI
Please note that this will not change the default installation path of custom nodes, but will add an extra path search when starting ComfyUI. You still need to complete the installation of custom node dependencies in the corresponding environment to ensure the integrity of the running environment.
Below is a simple configuration example (MacOS), please modify it according to your actual situation and add it to the corresponding configuration file, save it and restart ComfyUI for the changes to take effect: