Compare commits

..

4 Commits

Author SHA1 Message Date
bymyself
8ac3e420b6 merge: resolve conflict with master (add longcat_image to CLIPLoader types)
Merge origin/master into feat/model-placeholder.
Resolved conflict in nodes.py CLIPLoader.INPUT_TYPES:
- Kept placeholder support from feature branch
- Added 'longcat_image' type from master

Amp-Thread-ID: https://ampcode.com/threads/T-019ca3d1-90de-7013-b649-9e09659d9934
2026-02-28 02:38:37 -08:00
bymyself
c11a68bf79 fix: use folder_paths to resolve model directory in placeholder text
Amp-Thread-ID: https://ampcode.com/threads/T-019ca1cb-0150-7549-8b1b-6713060d3408
2026-02-27 17:14:21 -08:00
bymyself
bcaad9f117 fix: address code review feedback
- Fix StyleModelLoader and GLIGENLoader missing placeholders
- Fix function values called without node context
- Fix ellipsis formatting and Vue props destructuring

Amp-Thread-ID: https://ampcode.com/threads/T-019c2c7e-2ac1-7114-9147-b41e6334faa9
2026-02-27 17:13:07 -08:00
bymyself
6c8c6f2d52 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
2026-02-27 17:13:07 -08:00
6 changed files with 74 additions and 24 deletions

View File

@@ -162,7 +162,7 @@ class SaveAudio(IO.ComfyNode):
essentials_category="Audio",
inputs=[
IO.Audio.Input("audio"),
IO.String.Input("filename_prefix", default="audio/ComfyUI_%year%%month%%day%-%hour%%minute%%second%"),
IO.String.Input("filename_prefix", default="audio/ComfyUI"),
],
hidden=[IO.Hidden.prompt, IO.Hidden.extra_pnginfo],
is_output_node=True,
@@ -187,7 +187,7 @@ class SaveAudioMP3(IO.ComfyNode):
category="audio",
inputs=[
IO.Audio.Input("audio"),
IO.String.Input("filename_prefix", default="audio/ComfyUI_%year%%month%%day%-%hour%%minute%%second%"),
IO.String.Input("filename_prefix", default="audio/ComfyUI"),
IO.Combo.Input("quality", options=["V0", "128k", "320k"], default="V0"),
],
hidden=[IO.Hidden.prompt, IO.Hidden.extra_pnginfo],
@@ -215,7 +215,7 @@ class SaveAudioOpus(IO.ComfyNode):
category="audio",
inputs=[
IO.Audio.Input("audio"),
IO.String.Input("filename_prefix", default="audio/ComfyUI_%year%%month%%day%-%hour%%minute%%second%"),
IO.String.Input("filename_prefix", default="audio/ComfyUI"),
IO.Combo.Input("quality", options=["64k", "96k", "128k", "192k", "320k"], default="128k"),
],
hidden=[IO.Hidden.prompt, IO.Hidden.extra_pnginfo],

View File

@@ -637,7 +637,7 @@ class SaveGLB(IO.ComfyNode):
],
tooltip="Mesh or 3D file to save",
),
IO.String.Input("filename_prefix", default="mesh/ComfyUI_%year%%month%%day%-%hour%%minute%%second%"),
IO.String.Input("filename_prefix", default="mesh/ComfyUI"),
],
hidden=[IO.Hidden.prompt, IO.Hidden.extra_pnginfo]
)

View File

@@ -190,7 +190,7 @@ class SaveAnimatedWEBP(IO.ComfyNode):
category="image/animation",
inputs=[
IO.Image.Input("images"),
IO.String.Input("filename_prefix", default="ComfyUI_%year%%month%%day%-%hour%%minute%%second%"),
IO.String.Input("filename_prefix", default="ComfyUI"),
IO.Float.Input("fps", default=6.0, min=0.01, max=1000.0, step=0.01),
IO.Boolean.Input("lossless", default=True),
IO.Int.Input("quality", default=80, min=0, max=100),
@@ -227,7 +227,7 @@ class SaveAnimatedPNG(IO.ComfyNode):
category="image/animation",
inputs=[
IO.Image.Input("images"),
IO.String.Input("filename_prefix", default="ComfyUI_%year%%month%%day%-%hour%%minute%%second%"),
IO.String.Input("filename_prefix", default="ComfyUI"),
IO.Float.Input("fps", default=6.0, min=0.01, max=1000.0, step=0.01),
IO.Int.Input("compress_level", default=4, min=0, max=9, advanced=True),
],
@@ -489,7 +489,7 @@ class SaveSVGNode(IO.ComfyNode):
IO.SVG.Input("svg"),
IO.String.Input(
"filename_prefix",
default="svg/ComfyUI_%year%%month%%day%-%hour%%minute%%second%",
default="svg/ComfyUI",
tooltip="The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes.",
),
],

View File

@@ -21,7 +21,7 @@ class SaveWEBM(io.ComfyNode):
is_experimental=True,
inputs=[
io.Image.Input("images"),
io.String.Input("filename_prefix", default="ComfyUI_%year%%month%%day%-%hour%%minute%%second%"),
io.String.Input("filename_prefix", default="ComfyUI"),
io.Combo.Input("codec", options=["vp9", "av1"]),
io.Float.Input("fps", default=24.0, min=0.01, max=1000.0, step=0.01),
io.Float.Input("crf", default=32.0, min=0, max=63.0, step=1, tooltip="Higher crf means lower quality with a smaller file size, lower crf means higher quality higher filesize."),
@@ -77,7 +77,7 @@ class SaveVideo(io.ComfyNode):
description="Saves the input images to your ComfyUI output directory.",
inputs=[
io.Video.Input("video", tooltip="The video to save."),
io.String.Input("filename_prefix", default="video/ComfyUI_%year%%month%%day%-%hour%%minute%%second%", tooltip="The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes."),
io.String.Input("filename_prefix", default="video/ComfyUI", tooltip="The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes."),
io.Combo.Input("format", options=Types.VideoContainer.as_input(), default="auto", tooltip="The format to save the video as."),
io.Combo.Input("codec", options=Types.VideoCodec.as_input(), default="auto", tooltip="The codec to use for the video."),
],

View File

@@ -472,6 +472,26 @@ 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.
"""
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]:
"""Returns a list of all subfolder paths in the input directory, recursively.

View File

@@ -589,7 +589,10 @@ class CheckpointLoaderSimple:
def INPUT_TYPES(s):
return {
"required": {
"ckpt_name": (folder_paths.get_filename_list("checkpoints"), {"tooltip": "The name of the checkpoint (model) to load."}),
"ckpt_name": (folder_paths.get_filename_list("checkpoints"), {
"tooltip": "The name of the checkpoint (model) to load.",
"placeholder": folder_paths.get_model_placeholder("checkpoints")
}),
}
}
RETURN_TYPES = ("MODEL", "CLIP", "VAE")
@@ -639,7 +642,9 @@ class DiffusersLoader:
class unCLIPCheckpointLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "ckpt_name": (folder_paths.get_filename_list("checkpoints"), ),
return {"required": { "ckpt_name": (folder_paths.get_filename_list("checkpoints"), {
"placeholder": folder_paths.get_model_placeholder("checkpoints")
}),
}}
RETURN_TYPES = ("MODEL", "CLIP", "VAE", "CLIP_VISION")
FUNCTION = "load_checkpoint"
@@ -679,7 +684,10 @@ class LoraLoader:
"required": {
"model": ("MODEL", {"tooltip": "The diffusion model the LoRA will be applied to."}),
"clip": ("CLIP", {"tooltip": "The CLIP model the LoRA will be applied to."}),
"lora_name": (folder_paths.get_filename_list("loras"), {"tooltip": "The name of the LoRA."}),
"lora_name": (folder_paths.get_filename_list("loras"), {
"tooltip": "The name of the LoRA.",
"placeholder": folder_paths.get_model_placeholder("loras")
}),
"strength_model": ("FLOAT", {"default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01, "tooltip": "How strongly to modify the diffusion model. This value can be negative."}),
"strength_clip": ("FLOAT", {"default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01, "tooltip": "How strongly to modify the CLIP model. This value can be negative."}),
}
@@ -716,7 +724,9 @@ class LoraLoaderModelOnly(LoraLoader):
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"lora_name": (folder_paths.get_filename_list("loras"), ),
"lora_name": (folder_paths.get_filename_list("loras"), {
"placeholder": folder_paths.get_model_placeholder("loras")
}),
"strength_model": ("FLOAT", {"default": 1.0, "min": -100.0, "max": 100.0, "step": 0.01}),
}}
RETURN_TYPES = ("MODEL",)
@@ -806,7 +816,9 @@ class VAELoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "vae_name": (s.vae_list(s), )}}
return {"required": { "vae_name": (s.vae_list(s), {
"placeholder": folder_paths.get_model_placeholder("vae")
})}}
RETURN_TYPES = ("VAE",)
FUNCTION = "load_vae"
@@ -833,7 +845,9 @@ class VAELoader:
class ControlNetLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "control_net_name": (folder_paths.get_filename_list("controlnet"), )}}
return {"required": { "control_net_name": (folder_paths.get_filename_list("controlnet"), {
"placeholder": folder_paths.get_model_placeholder("controlnet")
})}}
RETURN_TYPES = ("CONTROL_NET",)
FUNCTION = "load_controlnet"
@@ -852,7 +866,9 @@ class DiffControlNetLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"control_net_name": (folder_paths.get_filename_list("controlnet"), )}}
"control_net_name": (folder_paths.get_filename_list("controlnet"), {
"placeholder": folder_paths.get_model_placeholder("controlnet")
})}}
RETURN_TYPES = ("CONTROL_NET",)
FUNCTION = "load_controlnet"
@@ -950,7 +966,9 @@ class ControlNetApplyAdvanced:
class UNETLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "unet_name": (folder_paths.get_filename_list("diffusion_models"), ),
return {"required": { "unet_name": (folder_paths.get_filename_list("diffusion_models"), {
"placeholder": folder_paths.get_model_placeholder("diffusion_models")
}),
"weight_dtype": (["default", "fp8_e4m3fn", "fp8_e4m3fn_fast", "fp8_e5m2"],)
}}
RETURN_TYPES = ("MODEL",)
@@ -975,7 +993,9 @@ class UNETLoader:
class CLIPLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "clip_name": (folder_paths.get_filename_list("text_encoders"), ),
return {"required": { "clip_name": (folder_paths.get_filename_list("text_encoders"), {
"placeholder": folder_paths.get_model_placeholder("text_encoders")
}),
"type": (["stable_diffusion", "stable_cascade", "sd3", "stable_audio", "mochi", "ltxv", "pixart", "cosmos", "lumina2", "wan", "hidream", "chroma", "ace", "omnigen2", "qwen_image", "hunyuan_image", "flux2", "ovis", "longcat_image"], ),
},
"optional": {
@@ -1002,8 +1022,12 @@ class CLIPLoader:
class DualCLIPLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "clip_name1": (folder_paths.get_filename_list("text_encoders"), ),
"clip_name2": (folder_paths.get_filename_list("text_encoders"), ),
return {"required": { "clip_name1": (folder_paths.get_filename_list("text_encoders"), {
"placeholder": folder_paths.get_model_placeholder("text_encoders")
}),
"clip_name2": (folder_paths.get_filename_list("text_encoders"), {
"placeholder": folder_paths.get_model_placeholder("text_encoders")
}),
"type": (["sdxl", "sd3", "flux", "hunyuan_video", "hidream", "hunyuan_image", "hunyuan_video_15", "kandinsky5", "kandinsky5_image", "ltxv", "newbie", "ace"], ),
},
"optional": {
@@ -1032,7 +1056,9 @@ class DualCLIPLoader:
class CLIPVisionLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "clip_name": (folder_paths.get_filename_list("clip_vision"), ),
return {"required": { "clip_name": (folder_paths.get_filename_list("clip_vision"), {
"placeholder": folder_paths.get_model_placeholder("clip_vision")
}),
}}
RETURN_TYPES = ("CLIP_VISION",)
FUNCTION = "load_clip"
@@ -1068,7 +1094,9 @@ class CLIPVisionEncode:
class StyleModelLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "style_model_name": (folder_paths.get_filename_list("style_models"), )}}
return {"required": { "style_model_name": (folder_paths.get_filename_list("style_models"), {
"placeholder": folder_paths.get_model_placeholder("style_models")
})}}
RETURN_TYPES = ("STYLE_MODEL",)
FUNCTION = "load_style_model"
@@ -1167,7 +1195,9 @@ class unCLIPConditioning:
class GLIGENLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "gligen_name": (folder_paths.get_filename_list("gligen"), )}}
return {"required": { "gligen_name": (folder_paths.get_filename_list("gligen"), {
"placeholder": folder_paths.get_model_placeholder("gligen")
})}}
RETURN_TYPES = ("GLIGEN",)
FUNCTION = "load_gligen"
@@ -1638,7 +1668,7 @@ class SaveImage:
return {
"required": {
"images": ("IMAGE", {"tooltip": "The images to save."}),
"filename_prefix": ("STRING", {"default": "ComfyUI_%year%%month%%day%-%hour%%minute%%second%", "tooltip": "The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes."})
"filename_prefix": ("STRING", {"default": "ComfyUI", "tooltip": "The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes."})
},
"hidden": {
"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"