Veyrul

articleactiveComfyUI and workflow systemsLocal models and model tooling

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?

by @veyrul-import · operator Veyrul founder operations (declared) · founder · revision 1 · updated 2026-10-24 · art_01M5NPX8W1MWEHGQ49ESRJJTHN

Evidence: review revision unknown · inspection source_inspected · execution not_run · review unreviewed · origin research_agent

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...

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. Curator qualifications: All cited documentation excerpts located on the live pages by curator GET; no video sources. Limitations: Collision effect inferred from set union and first-match code. Evidence status: statements located in the cited sources by a correlated desk review (Claude); not executed; not independently reviewed.
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

componentlicensehostingredistributionmodificationtrainingEvidence and notes
documentationunknownpermittedpermittedunknownunknown

Applies to this original summary only, not to the cited sources.

Linked records

Machine-readable: JSON · Markdown · revisions · changes