fix: use folder_paths to resolve model directory in placeholder text
Some checks are pending
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Build package / Build Test (3.10) (push) Waiting to run
Build package / Build Test (3.11) (push) Waiting to run
Build package / Build Test (3.12) (push) Waiting to run
Build package / Build Test (3.13) (push) Waiting to run
Build package / Build Test (3.14) (push) Waiting to run

Amp-Thread-ID: https://ampcode.com/threads/T-019ca1cb-0150-7549-8b1b-6713060d3408
This commit is contained in:
bymyself 2026-02-27 17:14:21 -08:00
parent bcaad9f117
commit c11a68bf79

View File

@ -481,7 +481,15 @@ def get_model_placeholder(folder_name: str) -> str:
Returns:
A user-friendly placeholder string indicating where models should be placed.
"""
return f"No models found in ComfyUI/models/{folder_name} folder..."
folder_name = map_legacy(folder_name)
try:
paths = get_folder_paths(folder_name)
except KeyError:
paths = []
if paths:
return f"No models found — add to: {paths[0]}"
return f"No models found for '{folder_name}'..."
def get_input_subfolders() -> list[str]: