|
1 | | -### Adding External Model Paths |
| 1 | +## Adding External Model Paths |
2 | 2 |
|
3 | | -If you downloaded a model but ComfyUI cannot find it, you may need to add an additional model search path to the yaml file. |
| 3 | +If you want to manage your model files outside of `ComfyUI/models`, you may have the following reasons: |
4 | 4 |
|
5 | | -#### Example scenario |
6 | | -You need to add a motion LoRA and your model is located in `C:\Users\YourUsername\models\animatediff_motion_lora`. |
| 5 | +- You have multiple ComfyUI instances and want them to share model files to save disk space |
| 6 | +- You have different types of GUI programs (such as WebUI) and want them to use the same model files |
| 7 | +- Model files cannot be recognized or found |
7 | 8 |
|
8 | | -#### Solution |
9 | | -1. Add the below configuration to the `extra_model_paths.yaml` file using the correct model type property name |
10 | | -2. Restart ComfyUI |
| 9 | +We provide a way to add extra model search paths via the `extra_model_paths.yaml` configuration file. |
11 | 10 |
|
12 | | -```yaml |
13 | | -my_custom_config: |
14 | | - loras: C:\Users\YourUsername\models\animatediff_motion_lora/ |
15 | | -``` |
| 11 | +### Open Config File |
16 | 12 |
|
17 | | -**Important:** Use the correct property names for different model types: |
18 | | -- `loras` - for LoRA models |
19 | | -- `checkpoints` - for checkpoint models |
20 | | -- `vae` - for VAE models |
21 | | -- `controlnet` - for ControlNet models |
22 | | -- `clip` - for CLIP models |
23 | | -- `upscale_models` - for upscaling models |
24 | | -- `embeddings` - for textual inversion embeddings |
25 | | -- `configs` - for configuration files |
26 | | - |
27 | | -For example, to add checkpoint models: |
28 | | -```yaml |
29 | | -my_custom_config: |
30 | | - checkpoints: C:\Users\YourUsername\models\checkpoints/ |
31 | | -``` |
| 13 | +<Tabs> |
| 14 | + <Tab title="Portable/Manual Install"> |
| 15 | + For portable and manual installations, you can find an example file named `extra_model_paths.yaml.example` in the root directory of ComfyUI: |
| 16 | + `` |
| 17 | + ComfyUI/extra_model_paths.yaml.example |
| 18 | + `` |
| 19 | + Please copy and rename it to `extra_model_paths.yaml` to use it. |
| 20 | + |
| 21 | + You can also find the config example file [here](https://github.com/comfyanonymous/ComfyUI/blob/master/extra_model_paths.yaml.example) |
| 22 | + |
| 23 | + </Tab> |
| 24 | + <Tab title="Desktop Application"> |
| 25 | + If you are using the ComfyUI Desktop application, you can follow the image below to open the extra model config file: |
| 26 | + |
| 27 | +  |
| 28 | + |
| 29 | + Or open it directly at: |
| 30 | + |
| 31 | + <Tabs> |
| 32 | + <Tab title="Windows"> |
| 33 | + ``` |
| 34 | + C:\Users\YourUsername\AppData\Roaming\ComfyUI\extra_models_config.yaml |
| 35 | + ``` |
| 36 | + </Tab> |
| 37 | + <Tab title="macOS"> |
| 38 | + ``` |
| 39 | + ~/Library/Application Support/ComfyUI/extra_models_config.yaml |
| 40 | + ``` |
| 41 | + </Tab> |
| 42 | + </Tabs> |
| 43 | + </Tab> |
| 44 | +</Tabs> |
32 | 45 |
|
33 | | -#### YAML config file location |
34 | | -For standard ComfyUI installations, create the `extra_model_paths.yaml` file directly in your ComfyUI folder (where `main.py` is located). |
| 46 | +If the file does not exist, you can create it yourself with any text editor. |
35 | 47 |
|
36 | | -#### Desktop Application Instructions |
37 | | -If you're using the ComfyUI Desktop application, the config file has a different name and location: |
| 48 | +### Example Structure |
38 | 49 |
|
39 | | -- On Windows: `C:\Users\YourUsername\AppData\Roaming\ComfyUI\extra_models_config.yaml` |
40 | | - - You can quickly navigate to this by typing `%APPDATA%\ComfyUI` in File Explorer address bar |
41 | | -- On macOS: `~/Library/Application Support/ComfyUI/extra_models_config.yaml` |
42 | | - - Open Finder, press `Cmd+Shift+G` and enter `~/Library/Application Support/ComfyUI` |
43 | | -- On Linux: `~/.config/ComfyUI/extra_models_config.yaml` |
44 | | - - Open your file manager and navigate to the hidden folder `~/.config/ComfyUI` |
| 50 | +Suppose your model file structure is as follows: |
| 51 | + |
| 52 | +``` |
| 53 | +📁 your_path/ |
| 54 | + ├── 📁models/ |
| 55 | + | ├── 📁 lora/ |
| 56 | + | │ └── xxxxx.safetensors |
| 57 | + | ├── 📁 checkpoints/ |
| 58 | + | │ └── xxxxx.safetensors |
| 59 | + | ├── 📁 vae/ |
| 60 | + | │ └── xxxxx.safetensors |
| 61 | + | └── 📁 controlnet/ |
| 62 | + | └── xxxxx.safetensors |
| 63 | +``` |
| 64 | + |
| 65 | +### YAML Configuration Example |
| 66 | + |
| 67 | +``` |
| 68 | +my_custom_config: |
| 69 | + base_path: your_path |
| 70 | + loras: models/lora/ |
| 71 | + checkpoints: models/checkpoints/ |
| 72 | + vae: models/vae/ |
| 73 | + controlnet: models/controlnet/ |
| 74 | +``` |
45 | 75 |
|
46 | | -If the file doesn't exist yet, you can create it yourself with any text editor. |
| 76 | +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. |
0 commit comments