diffusers
diffusers copied to clipboard
Fix bug in half precision for DPMSolverMultistepScheduler
The following code fails for the new DPMSolverMultistepScheduler when used in half precision due to torch.quantile() expecting inputs to be in full precision. This slight patch fixes this bug and allows for the following use case:
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", custom_pipeline="stable_diffusion_mega",
scheduler=DPMSolverMultistepScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule='scaled_linear'),
torch_dtype=torch.float16, revision="fp16", safety_checker=None, use_auth_token=True).to('cuda')
pipe.text2img('a picture of a stealth fighter', num_images_per_prompt=10, num_inference_steps=50, output_type='numpy')
The documentation is not available anymore as the PR was closed or merged.
Added a test!
Thanks a lot @rtaori !