Unverified Commit 05be622b authored by Jonah's avatar Jonah Committed by GitHub
Browse files

Fix depth pipeline "input/weight type should be the same" error at fp16 (#8321)



Fix "input/weight type should be the same"
Co-authored-by: default avatarYiYi Xu <yixu310@gmail.com>
parent 352d96eb
......@@ -546,7 +546,7 @@ class StableDiffusionDepth2ImgPipeline(DiffusionPipeline, TextualInversionLoader
if depth_map is None:
pixel_values = self.feature_extractor(images=image, return_tensors="pt").pixel_values
pixel_values = pixel_values.to(device=device)
pixel_values = pixel_values.to(device=device, dtype=dtype)
# The DPT-Hybrid model uses batch-norm layers which are not compatible with fp16.
# So we use `torch.autocast` here for half precision inference.
if torch.backends.mps.is_available():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment