Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🙏 Can't load Model without VAE and CLIP #47

Open
WanderFox opened this issue Sep 15, 2024 · 0 comments
Open

🙏 Can't load Model without VAE and CLIP #47

WanderFox opened this issue Sep 15, 2024 · 0 comments

Comments

@WanderFox
Copy link

In some cases we can use a model that doesn't contain VAE and CLIP. I propose to change code to this:

class CheckpointLoaderNF4:
    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "ckpt_name": (folder_paths.get_filename_list("checkpoints"), ),
                "only_model": ("BOOLEAN", {"default": False}),
            }
        }
    RETURN_TYPES = ("MODEL", "CLIP", "VAE")
    FUNCTION = "load_checkpoint"

    CATEGORY = "loaders"

    def load_checkpoint(self, ckpt_name, only_model):
        ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)

        if only_model:
            model = comfy.sd.load_diffusion_model(ckpt_path, model_options={"custom_operations": OPS})
            return (model,)
        else:
            out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"), model_options={"custom_operations": OPS})
            return out[:3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant