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

"clamp_scalar_cpu" not implemented for 'Half' for SD1.5 models, and "got an unexpected keyword argument 'text_encoder_2' " for SDXL models. #6

Open
antoineprobst opened this issue Jan 3, 2024 · 0 comments

Comments

@antoineprobst
Copy link

antoineprobst commented Jan 3, 2024

Hello !

Thank you for making this ComfyUI module.

I would really like to use it, but I have the following errors when trying to :

When using a 1.5 model I have this error (happens when it's on the Sampler step) :

image

And when i'm using an SDXL model or Turbo, I have this error (happens on the "loading model" step) :

image

Btw, I also had the problem that the module wouldn't import because of an error with diffusers, it couldn't find LCMsomething in diffusers, I fixed it by running " pip install git+https://github.com/huggingface/diffusers "

Edit : For SDXL I have my answer I guess, it seems it does not support it yet : cumulo-autumn/StreamDiffusion#86
For the 1.5 models, there may be the start of an answer here : cumulo-autumn/StreamDiffusion#62
Edit 2 : Fixed the issue with 1.5 models by modifying the image_utils.py file, just like cvv-student did in the link above :

def denormalize(images: Union[torch.Tensor, np.ndarray]) -> torch.Tensor:
    """
    Denormalize an image array to [0,1].
    """
    if images.dtype==torch.float16 and images.device.type=="cpu": #added
        images = images.float() #added
    return (images / 2 + 0.5).clamp(0, 1)

Any idea how I could make this work ?
You could say the issue is solved, but a cleaner way to solve it would probably be a commit in the streamdiffusion original github to solve it for everyone directly.

Thanks in advance.

@antoineprobst antoineprobst changed the title "clamp_scalar_cpu" not implemented for 'Half' for SD1.5 models, and "got an unexpected keyword argument 'text_encoder_2' for SDXL models. "clamp_scalar_cpu" not implemented for 'Half' for SD1.5 models, and "got an unexpected keyword argument 'text_encoder_2' " for SDXL models. Jan 3, 2024
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