{"record":{"id":"1b5e1871f1dcf136","repo":"Comfy-Org/ComfyUI","slug":"model-in-folder-folder-name-with-filename-fi","errorCode":null,"errorMessage":"Model in folder '{folder_name}' with filename '{filename}' not found.","messagePattern":"Model in folder '(.+?)' with filename '(.+?)' not found\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"folder_paths.py","lineNumber":467,"sourceCode":"    folders = folder_names_and_paths[folder_name]\n    filename = os.path.relpath(os.path.join(\"/\", filename), \"/\")\n    for x in folders[0]:\n        full_path = os.path.join(x, filename)\n        if os.path.isfile(full_path):\n            return full_path\n        elif os.path.islink(full_path):\n            logging.warning(\"WARNING path {} exists but doesn't link anywhere, skipping.\".format(full_path))\n\n    return None\n\n\ndef get_full_path_or_raise(folder_name: str, filename: str) -> str:\n    \"\"\"\n    Get the full path of a file in a folder, has to be a file\n    \"\"\"\n    full_path = get_full_path(folder_name, filename)\n    if full_path is None:\n        raise FileNotFoundError(f\"Model in folder '{folder_name}' with filename '{filename}' not found.\")\n    return full_path\n\n\ndef get_filename_list_(folder_name: str) -> tuple[list[str], dict[str, float], float]:\n    folder_name = map_legacy(folder_name)\n    global folder_names_and_paths\n    output_list = set()\n    folders = folder_names_and_paths[folder_name]\n    output_folders = {}\n    for x in folders[0]:\n        files, folders_all = recursive_search(x, excluded_dir_names=[\".git\"])\n        output_list.update(filter_files_extensions(files, folders[1]))\n        output_folders = {**output_folders, **folders_all}\n\n    return sorted(list(output_list)), output_folders, time.perf_counter()\n\ndef cached_filename_list_(folder_name: str) -> tuple[list[str], dict[str, float], float] | None:\n    strong_cache = cache_helper.get(folder_name)","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/folder_paths.py#L449-L485","documentation":"get_full_path_or_raise looks up filename in the registered folder_name (models/checkpoints, models/upscale_models, etc.) via get_full_path and raises FileNotFoundError when the lookup returns None — the file is not present in any registered directory for that folder type, or its extension is filtered out by the folder's allowed extensions.","triggerScenarios":"Model file missing, renamed, or moved after the workflow was created; filename casing mismatch on case-sensitive filesystems; file present but with an extension not in the folder type's filter set; extra_path_config not loaded so the containing directory is not registered; model list cache stale.","commonSituations":"Sharing workflows between machines with different model layouts; downloading a model into the wrong subfolder; symlinks that point nowhere (logged and skipped); folder_names_and_paths registered with restricted extensions.","solutions":["Verify the file exists under a registered directory for that folder type (check extra_paths.yaml / model paths config)","Fix casing or filename to match exactly what the node requests","Restart/refresh so the folder registrations and model caches rescan, then re-select the model in the node"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import folder_paths\nif filename not in folder_paths.get_filename_list(folder_name):\n    raise SystemExit(f\"{filename} missing from {folder_name}; check paths and refresh\")","typeGuard":"def model_exists(folder_name: str, filename: str) -> bool:\n    return filename in folder_paths.get_filename_list(folder_name)","tryCatchPattern":"try:\n    path = folder_paths.get_full_path_or_raise(folder_name, filename)\nexcept FileNotFoundError:\n    # rescan/re-register folders, then retry selection once\n    raise","preventionTips":["Verify model files exist under registered paths before running shared workflows","Match filenames exactly, including case, on case-sensitive filesystems"],"tags":["model-loading","file-not-found","folder-paths"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}