mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-19 14:40:04 +00:00
feat: add placeholder support for empty model dropdowns
Add get_model_placeholder() helper function to folder_paths.py that
generates user-friendly placeholder text for empty model dropdowns.
Update model loader nodes to include placeholder in INPUT_TYPES:
- CheckpointLoaderSimple
- unCLIPCheckpointLoader
- LoraLoader
- LoraLoaderModelOnly
- VAELoader
- ControlNetLoader
- DiffControlNetLoader
- UNETLoader
- CLIPLoader
- DualCLIPLoader
- CLIPVisionLoader
The placeholder text shows 'No models found in ComfyUI/models/{folder} folder . . .'
when the options list is empty, helping users understand where to place models.
Amp-Thread-ID: https://ampcode.com/threads/T-019c2bd5-472a-73a1-842b-4e05cba5d12c
This commit is contained in:
@@ -472,6 +472,18 @@ def get_save_image_path(filename_prefix: str, output_dir: str, image_width=0, im
|
||||
counter = 1
|
||||
return full_output_folder, filename, counter, subfolder, filename_prefix
|
||||
|
||||
def get_model_placeholder(folder_name: str) -> str:
|
||||
"""Generate placeholder text for empty model dropdowns.
|
||||
|
||||
Args:
|
||||
folder_name: The name of the model folder (e.g., "checkpoints", "loras").
|
||||
|
||||
Returns:
|
||||
A user-friendly placeholder string indicating where models should be placed.
|
||||
"""
|
||||
return f"No models found in ComfyUI/models/{folder_name} folder . . ."
|
||||
|
||||
|
||||
def get_input_subfolders() -> list[str]:
|
||||
"""Returns a list of all subfolder paths in the input directory, recursively.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user