RuntimeError: expected m1 and m2 to have the same dtype, but got: c10::Half != float

#1
by vvv111 - opened

Using the example code I get RuntimeError: expected m1 and m2 to have the same dtype, but got: c10::Half != float

from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained("John6666/lustify-sdxl-nsfwsfw-endgamedmd2-sdxl")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]
Owner
β€’
edited Feb 26

The sample code by Hugging Face is automatically generated, so it can be used as a reference, but it often generates errors.πŸ˜… It probably needs to be done like this, for example.

from diffusers import DiffusionPipeline
import torch

pipe = DiffusionPipeline.from_pretrained("John6666/lustify-sdxl-nsfwsfw-endgamedmd2-sdxl", torch_dtype=torch.float16, device_map="auto")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]
image.save("generated_sample.png")

Thank you very much! I've never used diffusers before; I used to use ComfyUI. πŸ˜‚

vvv111 changed discussion status to closed

Sign up or log in to comment