Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added images/desktop/extra_model_paths.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/zh/desktop/extra_model_paths.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 4 additions & 84 deletions installation/comfyui_portable_windows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sidebarTitle: "Portable(Windows)"
---

import FirstGeneration from "/snippets/install/first-generation.mdx"
import AddExternalModels from "/snippets/install/add-external-models.mdx"

**ComfyUI Portable** is a standalone packaged complete ComfyUI Windows version that has integrated an independent **Python (python_embeded)** required for ComfyUI to run. You only need to extract it to use it. Currently, the portable version supports running through **Nvidia GPU** or **CPU**.

Expand Down Expand Up @@ -48,6 +49,8 @@ At this point, your ComfyUI service has started. Normally, ComfyUI will automati

<Warning>During use, please do not close the corresponding command line window, otherwise ComfyUI will stop running</Warning>

<AddExternalModels/>

<FirstGeneration/>

## Additional ComfyUI Portable Instructions
Expand All @@ -64,91 +67,8 @@ ComfyUI_windows_portable
├── update_comfyui_and_python_dependencies.bat // Only use when you have issues with your runtime environment
└── update_comfyui_stable.bat // Update ComfyUI to the latest stable version
```
### 2. ComfyUI Model Sharing and Custom Model Directory Configuration

If you are also using [A1111](https://github.com/AUTOMATIC1111/stable-diffusion-webui) or want to customize your model storage location, you can modify the following file to complete the configuration
```
ComfyUI_windows_portable
└─ 📂ComfyUI
└── extra_model_paths.yaml.example // This file is the configuration template
```

Please copy and rename the `extra_model_paths.yaml.example` to `extra_model_paths.yaml`.

Below is the original configuration file content, which you can modify according to your needs

```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/
# # 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
```yaml
a111:
base_path: D:\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
```
This way, models under paths like `D:\stable-diffusion-webui\models\Stable-diffusion\` can be detected and used by ComfyUI. Similarly, you can add other custom model location configurations

### 3. Setting Up LAN Access for ComfyUI Portable
### 2. Setting Up LAN Access for ComfyUI Portable

If your ComfyUI is running on a local network and you want other devices to access ComfyUI, you can modify the `run_nvidia_gpu.bat` or `run_cpu.bat` file using Notepad to complete the configuration. This is mainly done by adding `--listen` to specify the listening address.
Below is an example of the `run_nvidia_gpu.bat` file command with the `--listen` parameter added
Expand Down
3 changes: 2 additions & 1 deletion installation/desktop/macos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import TroubleshootingGpt from "/snippets/install/troubleshooting-gpt.mdx"
import TroubleshootingFeedback from "/snippets/install/troubleshooting-feedback.mdx"
import ExternalModelsDesktop from "/snippets/install/external-models-desktop.mdx"
import DesktopVenv from "/snippets/install/desktop-venv.mdx"
import AddExternalModels from "/snippets/install/add-external-models.mdx"

**ComfyUI Desktop** is a standalone installation version that can be installed like regular software.
It supports quick installation and automatic configuration of the **Python environment and dependencies**, and supports one-click import of existing ComfyUI settings, models, workflows, and files.
Expand Down Expand Up @@ -127,7 +128,7 @@ Then find the **ComfyUI icon** in **Launchpad** and click it to enter ComfyUI in

<FirstGeneration/>
<UpdateComfyui/>
<ExternalModelsDesktop/>
<AddExternalModels/>
<DesktopVenv/>

## How to Uninstall ComfyUI Desktop
Expand Down
3 changes: 2 additions & 1 deletion installation/desktop/windows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import TroubleshootingGpt from "/snippets/install/troubleshooting-gpt.mdx"
import TroubleshootingFeedback from "/snippets/install/troubleshooting-feedback.mdx"
import ExternalModelsDesktop from "/snippets/install/external-models-desktop.mdx"
import DesktopVenv from "/snippets/install/desktop-venv.mdx"
import AddExternalModels from "/snippets/install/add-external-models.mdx"

**ComfyUI Desktop** is a standalone installation version that can be installed like regular software. It supports quick installation and automatic configuration of the **Python environment and dependencies**, and supports one-click import of existing ComfyUI settings, models, workflows, and files. You can quickly migrate from an existing [ComfyUI Portable version](/installation/comfyui_portable_windows) to the Desktop version.

Expand Down Expand Up @@ -118,7 +119,7 @@ Double-click the corresponding shortcut to enter ComfyUI initialization settings

<FirstGeneration/>
<UpdateComfyui/>
<ExternalModelsDesktop/>
<AddExternalModels/>
<DesktopVenv/>

## How to Uninstall ComfyUI Desktop
Expand Down
3 changes: 3 additions & 0 deletions installation/manual_install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Conda from "/snippets/conda.mdx";
import PipInstall from "/snippets/pip-install.mdx";
import InstallGpuDependencies from "/snippets/install-gpu-dependencies.mdx";
import RunComfy from "/snippets/run-comfy.mdx";
import AddExternalModels from "/snippets/install/add-external-models.mdx"

For the installation of ComfyUI, it is mainly divided into several steps:
1. Create a virtual environment(avoid polluting the system-level Python environment)
Expand Down Expand Up @@ -80,3 +81,5 @@ git clone [email protected]:comfyanonymous/ComfyUI.git
```
</Step>
</Steps>

<AddExternalModels/>
180 changes: 147 additions & 33 deletions snippets/install/add-external-models.mdx
Original file line number Diff line number Diff line change
@@ -1,46 +1,160 @@
### Adding External Model Paths
## Adding Extra Model Paths

If you downloaded a model but ComfyUI cannot find it, you may need to add an additional model search path to the yaml file.
If you want to manage your model files outside of `ComfyUI/models`, you may have the following reasons:

#### Example scenario
You need to add a motion LoRA and your model is located in `C:\Users\YourUsername\models\animatediff_motion_lora`.
- You have multiple ComfyUI instances and want them to share model files to save disk space
- You have different types of GUI programs (such as WebUI) and want them to use the same model files
- Model files cannot be recognized or found

#### Solution
1. Add the below configuration to the `extra_model_paths.yaml` file using the correct model type property name
2. Restart ComfyUI
We provide a way to add extra model search paths via the `extra_model_paths.yaml` configuration file

### Open Config File

<Tabs>
<Tab title="Portable/Manual Install">
For the ComfyUI version such as [portable](/installation/comfyui_portable_windows) and [manual](/installation/manual_install), you can find an example file named `extra_model_paths.yaml.example` in the root directory of ComfyUI:
```
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](https://github.com/comfyanonymous/ComfyUI/blob/master/extra_model_paths.yaml.example)

</Tab>
<Tab title="ComfyUI Desktop">
If you are using the [ComfyUI Desktop](/installation/desktop/windows) application, you can follow the image below to open the extra model config file:

![Open Config File](/images/desktop/extra_model_paths.jpg)

Or open it directly at:

<Tabs>
<Tab title="Windows">
```
C:\Users\YourUsername\AppData\Roaming\ComfyUI\extra_models_config.yaml
```
</Tab>
<Tab title="macOS">
```
~/Library/Application Support/ComfyUI/extra_models_config.yaml
```
</Tab>
</Tabs>

You should keep the file in the same directory, should not move these files to other places.
</Tab>
</Tabs>

If the file does not exist, you can create it yourself with any text editor.

### Example Structure

Suppose you want to add the following model paths to ComfyUI:

```yaml
my_custom_config:
loras: C:\Users\YourUsername\models\animatediff_motion_lora/
```
📁 your_path/
├── 📁models/
| ├── 📁 lora/
| │ └── xxxxx.safetensors
| ├── 📁 checkpoints/
| │ └── xxxxx.safetensors
| ├── 📁 vae/
| │ └── xxxxx.safetensors
| └── 📁 controlnet/
| └── xxxxx.safetensors
```

**Important:** Use the correct property names for different model types:
- `loras` - for LoRA models
- `checkpoints` - for checkpoint models
- `vae` - for VAE models
- `controlnet` - for ControlNet models
- `clip` - for CLIP models
- `upscale_models` - for upscaling models
- `embeddings` - for textual inversion embeddings
- `configs` - for configuration files
Then you can configure the `extra_model_paths.yaml` file like below to let ComfyUI recognize the model paths on your device:

For example, to add checkpoint models:
```yaml
```
my_custom_config:
checkpoints: C:\Users\YourUsername\models\checkpoints/
base_path: your_path
loras: models/loras/
checkpoints: models/checkpoints/
vae: models/vae/
controlnet: models/controlnet/
```
or

```
my_custom_config:
base_path: your_path/models/
loras: loras
checkpoints: checkpoints
vae: vae
controlnet: controlnet
```

Or you can refer to the default [extra_model_paths.yaml.example](https://github.com/comfyanonymous/ComfyUI/blob/master/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:

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

#### YAML config file location
For standard ComfyUI installations, create the `extra_model_paths.yaml` file directly in your ComfyUI folder (where `main.py` is located).

#### Desktop Application Instructions
If you're using the ComfyUI Desktop application, the config file has a different name and location:
#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/

- On Windows: `C:\Users\YourUsername\AppData\Roaming\ComfyUI\extra_models_config.yaml`
- You can quickly navigate to this by typing `%APPDATA%\ComfyUI` in File Explorer address bar
- On macOS: `~/Library/Application Support/ComfyUI/extra_models_config.yaml`
- Open Finder, press `Cmd+Shift+G` and enter `~/Library/Application Support/ComfyUI`
- On Linux: `~/.config/ComfyUI/extra_models_config.yaml`
- Open your file manager and navigate to the hidden folder `~/.config/ComfyUI`
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

If the file doesn't exist yet, you can create it yourself with any text editor.
#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
```yaml
a111:
base_path: D:\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
```
Loading