Comfy-Org/ComfyUI · error · ValueError

Path is not within input, output, temp, or configured model

Error message

Path is not within input, output, temp, or configured model bases: {path}

What it means

Raised by get_backend_system_tags_from_path when no trusted backend system tag can be derived from the path. That function emits 'models', 'model_type:<folder>', 'input', 'output', 'temp' based on which known root contains the file; if the path is under none of them, the tag set is empty and it refuses with this ValueError rather than returning untagged (and thus untrusted-classifiable) data.

Source

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

    model_types: list[str] = []
    under_models_base = False
    for folder_name, bases, extensions in get_comfy_models_folders():
        for base in bases:
            if fp_path.is_relative_to(os.path.abspath(base)):
                under_models_base = True
                # Empty set accepts any extension, matching
                # folder_paths.filter_files_extensions semantics.
                if not extensions or ext in extensions:
                    model_types.append(folder_name)
                break

    if under_models_base:
        _add("models")
    for folder_name in model_types:
        _add(f"model_type:{folder_name}")

    if not tags:
        raise ValueError(
            f"Path is not within input, output, temp, or configured model bases: {path}"
        )
    return tags


def get_known_subfolder_tags(subfolder: str | None) -> list[str]:
    """Return tags for known UI/input subfolder names."""
    if subfolder in _KNOWN_SUBFOLDER_TAGS:
        return [subfolder]
    return []


def get_known_input_subfolder_tags_from_path(path: str) -> list[str]:
    """Return known input-layout tags for files in canonical input subfolders.

    These are compatibility tags for current UI-origin input directories such as
    ``pasted`` and ``webcam``. They are intentionally narrow: only files directly
    inside a known top-level input directory receive the matching tag.

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Ensure the file physically resides under input/, output/, the managed temp dir, or a configured models folder before deriving system tags.
  2. Re-align folder configuration with actual on-disk locations if files legitimately live elsewhere.
  3. Pre-check containment with the same roots the server uses (or the classification API) before calling tag derivation.

Example fix

# before
tags = get_backend_system_tags_from_path('/var/data/model.safetensors')

# after
if not path_within_known_roots(p):
    p = move_into_models_dir(p)
tags = get_backend_system_tags_from_path(str(p))
Defensive patterns

Strategy: validation

Validate before calling

known = collect_known_roots()  # input, output, temp, model bases
if not within_any_root(path, known):
    path = relocate_into_known_root(path)  # or reject before tagging

Type guard

def will_derive_system_tags(path: str, roots) -> bool:
    return within_any_root(path, roots)

Try / catch

try:
    tags = get_backend_system_tags_from_path(path)
except ValueError:
    tags = []  # caller decides: move the file or skip

Prevention

When it happens

Trigger: Passing a path outside every known root (e.g. '/tmp/other/file.png' outside the managed temp dir, or a user home path) to system-tag derivation — typically while building tags for an asset reference from a file location.

Common situations: Importing/indexing files from arbitrary disk locations; a moved or reconfigured models directory; temp files written to a directory other than the server-managed temp root; symlinks whose resolution escapes the base.

Related errors


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