Skip to content

Commit 0508660

Browse files
Support fp16 in conversion from original ckpt - use pipe.to(dtype=...) instead of half() on each model
Co-authored-by: Patrick von Platen <[email protected]>
1 parent 45b8c3c commit 0508660

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

scripts/convert_original_stable_diffusion_to_diffusers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,7 @@
145145
)
146146

147147
if args.half:
148-
pipe.unet = pipe.unet.half()
149-
pipe.vae = pipe.vae.half()
150-
pipe.text_encoder = pipe.text_encoder.half()
148+
pipe.to(dtype=torch.float16)
151149

152150
if args.controlnet:
153151
# only save the controlnet model

0 commit comments

Comments
 (0)