A black image

#30
by PooriaT - opened

I attempted to run this model using the interface API (serverless). However, it's producing a black image. I even tested it by creating a space, but it failed to return the correct result and only displayed a black image.

What precision are you using, I've noticed float16 (instead of bfloat16) gives black images, it seems to be a vae issue, and it seems to be ignoring the automatic upcasting diffusers uses, it's set to upcast in the config,

I ended up replacing the vae.decode function to do upcast, anyone know if its the standard SDXL vae, so we could use madebyollin's fp16 fixed vae instead.

pipe.vae.to(torch.float32)
_vae_decode = pipe.vae.decode
def new_vae_decode(latents, *args, **kwargs):
    latents = latents.to(torch.float32)
    return _vae_decode(latents, *args, **kwargs)
pipe.vae.decode = new_vae_decode

@Vargol Thanks a lot for your response. Actually, I used the interface API and just called it without changing any default parameters. Now, I tested it and it works fine.
Which parameter can be passed via interface API?

Sign up or log in to comment