Add ckpt_name output to checkpoint loader.
Please add ckpt_name output to checkpoint loader then we can use it in file name output, thanks.
Edit: If you go to add this in future please make it to report just file name without extension or any other info, thank you so much.
Seems like I asked for something similar in #150. After reviewing the code, I think that this is actually the wrong place to ask. This repo basically patches the upstream CheckpointLoaderSimple
I learned this by modifying this: https://github.com/comfyanonymous/ComfyUI/blob/master/nodes.py#L520
class CheckpointLoaderSimple:
@classmethod
def INPUT_TYPES(s):
return {"required": { "ckpt_name": (folder_paths.get_filename_list("checkpoints"), ),
}}
RETURN_TYPES = ("MODEL", "CLIP", "VAE", "CKPT_NAME")
FUNCTION = "load_checkpoint"
CATEGORY = "loaders"
def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True):
ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)
out = comfy.sd.load_checkpoint_guess_config(
ckpt_path,
output_vae=True,
output_clip=True,
embedding_directory=folder_paths.get_folder_paths("embeddings"))
return out[:3] + [ckpt_name]
This could be fixed on my end, however when I get time my aim is to remove my checkpoint/lora loader nodes and enable the features on the standard nodes via settings.
@pythongosssss I filed an upstream PR for this. Do you have the ability to approve/merge that?
No I dont, I think there could be a more general solution - maybe the ability to "convert" (not actually convert but add) widgets as outputs like you can with inputs
I like generalized approaches! Still need to balance short term/long term goals. For now, I'm just trying to get the checkpoint name out of the loader node so I can pass it to something else.