How does extra_model_paths.yaml actually resolve a model filename when the same name exists in two folders, and how do I make a shared model store the default?
Problem. Shared model stores across installs or containers; workflows store bare filenames. Conditions. ComfyUI v0.42.5. Method. Config is YAML parsed with yaml.safe_load; each top-level section may set base_path (expanded with ~ and env vars; relative paths resolve against the YAML file's directory), is_default and then folder_name: path entries, multi-line strings listing several paths. folder_paths.add_model_folder_path appends each path (or inserts at index 0 when is_default is true, moving an existing entry to the front). get_full_path iterates the folder list in order and returns the first existing file; the dropdown list (get_filename_list_) is a sorted union of relative file names across all roots filtered by extension. main.py auto-loads extra_model_paths.yaml next to main.py if present and also accepts one or more --extra-model-paths-config files; custom_nodes is also a configurable key, which means custom code can be loaded from a shared folder. The shipped example covers...
Structured fields
{
"citations": [
{
"url": "https://raw.githubusercontent.com/comfyanonymous/ComfyUI/483dae4326356b81de05d27aca3f433dd323cc25/utils/extra_config.py",
"note": "load_extra_path_config; get_full_path; header comment"
},
{
"url": "https://raw.githubusercontent.com/comfyanonymous/ComfyUI/483dae4326356b81de05d27aca3f433dd323cc25/folder_paths.py",
"note": "load_extra_path_config; get_full_path; header comment"
},
{
"url": "https://raw.githubusercontent.com/comfyanonymous/ComfyUI/483dae4326356b81de05d27aca3f433dd323cc25/extra_model_paths.yaml.example",
"note": "load_extra_path_config; get_full_path; header comment"
}
]
}Evidence claims
- [sourced_fact] Problem. Shared model stores across installs or containers; workflows store bare filenames. Conditions. ComfyUI v0.42.5. Method. Config is YAML parsed with yaml.safe_load; each top-level section may set base_path (expanded with ~ and env vars; relative paths resolve against the YAML file's directory), is_default and then folder_name: path entries, multi-line strings listing several paths. folder_paths.add_model_folder_path appends each path (or inserts at index 0 when is_default is true, moving an existing entry to the front). get_full_path iterates the folder list in order and returns the first existing file; the dropdown list (get_filename_list_) is a sorted union of relative file names across all roots filtered by extension. main.py auto-loads extra_model_paths.yaml next to main.py if present and also accepts one or more --extra-model-paths-config files; custom_nodes is also a configurable key, which means custom code can be loaded from a shared folder. The shipped example covers comfyui and a1111 layouts and newer folders (e.g. text_encoders, diffusion_models, latent_upscale_models). Failure modes. Identical filenames in two roots collapse into one dropdown entry and the first root wins silently, so a provenance record of just the name is ambiguous; non-existent symlinks are skipped with a warning. Limitations. Resolution read from source (inference for the ambiguity consequence). Version and date. v0.42.5. · locator: load_extra_path_config; get_full_path; header comment source
Rights
| component | license | hosting | redistribution | modification | training | Evidence and notes |
|---|---|---|---|---|---|---|
| documentation | unknown | permitted | permitted | unknown | unknown | Applies to this original summary only, not to the cited sources. |
Linked records
- cites → https://raw.githubusercontent.com/comfyanonymous/ComfyUI/483dae4326356b81de05d27aca3f433dd323cc25/extra_model_paths.yaml.example
- cites → https://raw.githubusercontent.com/comfyanonymous/ComfyUI/483dae4326356b81de05d27aca3f433dd323cc25/folder_paths.py
- cites → https://raw.githubusercontent.com/comfyanonymous/ComfyUI/483dae4326356b81de05d27aca3f433dd323cc25/utils/extra_config.py