Comfy-Org/ComfyUI · error · ValueError

no base path configured for category '{folder_name}'

Error message

no base path configured for category '{folder_name}'

What it means

Raised when the requested model category IS registered, but its configured base-path list is empty (bases == []), so there is no directory to write into. The folder name resolves via get_comfy_models_folders(), yet the corresponding entry carries zero usable paths — a server configuration gap rather than a bad request. ValueError propagates as an upload failure.

Source

Thrown at app/assets/services/path_utils.py:58

        raise ValueError("uploads require exactly one destination role: input, models, or output")

    root = destination_roles[0]
    if root == "models":
        model_type_tags = [t for t in tags if t.startswith("model_type:")]
        if len(model_type_tags) != 1:
            raise ValueError("models uploads require exactly one model_type:<folder_name> tag")
        folder_name = model_type_tags[0].split(":", 1)[1]
        if not folder_name:
            raise ValueError("models uploads require exactly one model_type:<folder_name> tag")
        model_folder_paths = {
            name: paths for name, paths, _exts in get_comfy_models_folders()
        }
        try:
            bases = model_folder_paths[folder_name]
        except KeyError:
            raise ValueError(f"unknown model category '{folder_name}'")
        if not bases:
            raise ValueError(f"no base path configured for category '{folder_name}'")
        base_dir = os.path.abspath(bases[0])
    elif root == "input":
        base_dir = os.path.abspath(folder_paths.get_input_directory())
    else:
        base_dir = os.path.abspath(folder_paths.get_output_directory())

    return base_dir, []


def validate_path_within_base(candidate: str, base: str) -> None:
    cand_abs = Path(os.path.abspath(candidate))
    base_abs = Path(os.path.abspath(base))
    if not cand_abs.is_relative_to(base_abs):
        raise ValueError("destination escapes base directory")


def _compute_relative_path(child: str, parent: str) -> str:
    rel = os.path.relpath(os.path.abspath(child), os.path.abspath(parent))

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Fix the server-side folder configuration: give the category a real, existing directory in extra_model_paths.yaml (or the relevant folder_paths registration) and restart the server.
  2. Verify the directory exists on disk and the server process can read/write it.
  3. As a workaround, upload into a category that does have a configured base, or use the 'input' role and move the file manually.
Defensive patterns

Strategy: fallback

Validate before calling

# server-side precheck before accepting model uploads
folders = {n: ps for n, ps, _ in get_comfy_models_folders()}
if not folders.get(category):
    raise ConfigurationError(f'category {category!r} has no base path; fix folder config')

Prevention

When it happens

Trigger: extra_model_paths.yaml (or folder_paths config) declares a model folder name but with an empty/invalid path list (directory doesn't exist, unreadable, or entry defined with no paths); an upload tagged model_type:<that-folder> then hits the `if not bases` branch.

Common situations: Fresh ComfyUI installs where a category exists by name but its directory hasn't been created/linked; misconfigured extra_model_paths.yaml with a stale or misspelled filesystem path; containers/volumes where the models mount is missing.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/aeb8663f17503055. Report an issue: GitHub.