ComfyUI extra_model_paths.yaml: Location, Example and Fixes

Updated 2026-10-10

Where ComfyUI extra_model_paths.yaml lives for portable, manual and Desktop installs, a working Windows example, every valid key, and why it does not load.

Quick answer

The ComfyUI extra_model_paths.yaml file goes in the same folder as ComfyUI's main.py. ComfyUI ships a template there called extra_model_paths.yaml.example; copy it, rename the copy to extra_model_paths.yaml, add a section with a base_path and one line per model folder, and restart ComfyUI. Every line in the template is commented out, so an unedited copy does nothing.

A minimal file that adds a models folder on another drive:

my_models:
  base_path: D:/AI/models
  checkpoints: checkpoints
  diffusion_models: diffusion_models
  text_encoders: text_encoders
  vae: vae
  loras: loras

If it worked, the console prints one line per folder at start-up, before any custom nodes load:

Adding extra search path loras D:\AI\models\loras

We read ComfyUI's loader code (utils/extra_config.py), folder_paths.py and main.py at commit 0df64eb on 2026-10-10; the files are unchanged from release v0.39.0. We ran the loader against broken files on PyYAML 5.4.1 to get the error for each mistake below. We did not run it on Windows.

Where the file goes

InstallFile ComfyUI reads
InstallWindows portableFile ComfyUI readsComfyUI_windows_portable\ComfyUI\extra_model_paths.yaml, not the outer folder
InstallManual install (git clone)File ComfyUI readsComfyUI/extra_model_paths.yaml, next to main.py
InstallComfy Desktop 1.xFile ComfyUI readsThe Storage tab; also ComfyUI/extra_model_paths.yaml inside each install
InstallLegacy Desktop (the old single-install)File ComfyUI reads%APPDATA%\ComfyUI\extra_models_config.yaml, ~/Library/Application Support/ComfyUI/ on macOS
InstallAny installFile ComfyUI readsAny file, passed with --extra-model-paths-config

Portable and manual. main.py looks for extra_model_paths.yaml in its own directory and loads it if it exists. In the portable build that is the inner ComfyUI folder, beside main.py and models, not the folder holding run_nvidia_gpu.bat.

Comfy Desktop 1.x. The current desktop app, Comfy Desktop, manages several ComfyUI installs. Its documentation says to add model folders in the Storage tab: shared directories apply to every install, and each install's Manage panel has its own Model Directories list. The app writes those into a YAML of its own, one per install, under its app data folder (%APPDATA%\Comfy Desktop\instance-model-paths\ on Windows), and passes it with --extra-model-paths-config at every launch. It rewrites that file each time, so do not edit it by hand.

Comfy Desktop still lets ComfyUI read the install's own ComfyUI/extra_model_paths.yaml. Its Storage tab lists the folders from that file as read-only and tells you to edit the YAML to change them. Installs live under %LOCALAPPDATA%\Comfy-Desktop\ComfyUI-Installs on Windows by default, or ~/ComfyUI-Installs on macOS and Linux.

Legacy Desktop. The previous desktop app, whose repository is now archived, kept a single file in its Electron user-data folder: extra_models_config.yaml, with a comfyui_desktop: section it wrote at install time. ComfyUI's own models page still gives this path under its Desktop tab. If you have migrated to Comfy Desktop, the migration adds your old models folder as a shared directory instead; check the Storage tab, not this file.

The flag: --extra-model-paths-config

python main.py --extra-model-paths-config D:/AI/shared_paths.yaml D:/AI/more_paths.yaml

The flag takes one or more paths and can be repeated. ComfyUI loads the default extra_model_paths.yaml first, if there is one, then each file from the flag, so you can keep a shared file outside every install. On the portable build, add it to the end of the python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build line in run_nvidia_gpu.bat.

If all you want is to move the whole models folder, ComfyUI v0.28.0 added --models-directory, which replaces the default models root and refuses to start if the folder does not exist. --base-directory moves models, custom nodes, input, output and user data together.

The structure, line by line

Each top-level name is a section; the name itself (comfyui, a1111, my_models) is free. Inside a section:

  • base_path is joined to the front of every folder in that section. ~ and environment variables such as %USERPROFILE% or $HOME are expanded. A relative base_path is resolved from the folder holding the YAML file, not from where you launched ComfyUI.
  • is_default: true puts that section's folders first in each list. ComfyUI searches folders in order and loads the first file with a matching name, so this also decides which copy wins when two folders hold the same file name, and which folder counts as the default for downloads. Without it, extra folders come after the built-in models folder.
  • Every other key is a folder type, and its value is one path, or several paths on separate lines after a |.
comfyui:
  base_path: E:/ComfyUI_old/
  diffusion_models: |
    models/unet/
    models/diffusion_models/
  text_encoders: |
    models/text_encoders/
    models/clip/

Watch the base path twice. If base_path already ends in models, the folder lines are loras, not models/loras; the doubled models/models/loras is a common reason a correct-looking file finds nothing.

Valid keys

folder_paths.py defines 27 folder types. The ones a video setup needs:

KeyWhat goes there
Keydiffusion_modelsWhat goes thereWan, HunyuanVideo, LTX and MiniMax H3 model files; unet is an alias
KeycheckpointsWhat goes thereAll-in-one checkpoints that Load Checkpoint reads
Keytext_encodersWhat goes thereumt5, T5, Gemma, Qwen VL; clip is an alias
KeyvaeWhat goes thereVAEs
KeylorasWhat goes thereLoRAs, including 4-step distill LoRAs
Keyclip_visionWhat goes thereCLIP vision models, for example clip_vision_h for Wan Animate
Keyaudio_encodersWhat goes therewav2vec2 and similar, for Wan S2V
Keyupscale_modelsWhat goes thereImage and video upscalers
Keylatent_upscale_modelsWhat goes thereLatent upscalers
Keyframe_interpolationWhat goes thereRIFE and FILM weights for the native interpolation nodes
KeycontrolnetWhat goes thereControlNets; also reads t2i_adapter
Keycustom_nodesWhat goes thereExtra custom node folders, not model files

The rest are configs, style_models, embeddings, diffusers, vae_approx, gligen, hypernetworks, photomaker, classifiers, model_patches, background_removal, geometry_estimation, optical_flow, detection and datasets. The template file lists the same set.

unet and clip are the only renamed keys ComfyUI maps for you. Our diffusion_models vs checkpoints page explains which loader reads which folder, and the Wan 2.2 models folder page lists which file goes in which.

GGUF files. The ComfyUI-GGUF custom node builds its .gguf lists from the diffusion_models and text_encoders folder lists, so the same keys cover GGUF files on another drive. There is no separate key to add.

Why it is not working

SymptomCauseFix
SymptomNo Adding extra search path lines at allCauseFile in the wrong folder, still named .example, or saved as .yaml.txtFixPut it beside main.py; in Explorer, turn on file name extensions
SymptomComfyUI exits with 'NoneType' object is not iterableCauseThe file exists but every line is still commented outFixUncomment a section, or delete the file
Symptomstring indices must be integersCauseKeys are not indented under a section nameFixIndent every key under one section line
Symptom'list' object has no attribute 'split'CausePaths written as a YAML list with -FixUse one path per line after |
Symptomwhile scanning a double-quoted scalarCauseA Windows path with backslashes inside double quotesFixUse forward slashes, single quotes, or no quotes
Symptomwhile scanning for the next tokenCauseA tab used for indentationFixIndent with spaces
SymptomThe line prints, but the loader's list is still emptyCauseWrong key name, wrong folder, or doubled models/modelsFixCheck the key against the table above, then the printed path
SymptomFiles added later do not appearCauseComfyUI reads the file once, at start-upFixRestart ComfyUI

Three things about the start-up line are easy to miss:

  1. It does not mean the folder exists. ComfyUI prints and adds the path without checking it. Copy the printed path into Explorer to see whether it opens.
  2. It does not mean the key is valid. A typo such as checkpoint: or diffusion_model: prints the same line and creates a new list no loader reads. ComfyUI gives no warning.
  3. A broken file stops ComfyUI from starting. The loader is not wrapped in any error handling, so a YAML mistake ends start-up with a traceback. In the portable build, the window then waits on pause; read the last lines before closing it.

Windows paths

YAML treats a backslash inside double quotes as the start of an escape code, so "D:\AI\models" fails to load. Three forms work:

a:
  base_path: D:/AI/models
b:
  base_path: D:\AI\models
c:
  base_path: 'D:\AI Models\models'

Forward slashes are the safest choice; Python on Windows accepts them, and ComfyUI normalises the path before it prints it, which is why the log line shows backslashes. Spaces in a path are fine without quotes too, but single quotes make them obvious. Save the file as UTF-8; ComfyUI opens it as UTF-8.

What nobody has published

  • ComfyUI's documentation does not list the error each YAML mistake produces. The table above comes from running ComfyUI's loader code ourselves, not from an official page.
  • The documentation's Desktop tab mixes the current Storage tab with the Legacy Desktop file path. Comfy Desktop's source and its own settings page show the newer layout described above.

If a model still does not load once its folder is listed, our ComfyUI troubleshooting page covers model-not-found and loader errors, and the ComfyUI download page covers which install keeps its files where.

GenVidKit is an independent guide. It is not affiliated with Comfy Org, city96 or the AUTOMATIC1111 project.

Sources

All read on 2026-10-10.