From 62c153979dcb7feac301f5142ec466d62cd69ac7 Mon Sep 17 00:00:00 2001 From: ZachNagengast Date: Thu, 5 Oct 2023 12:05:34 -0700 Subject: [PATCH] Cast safety_checker to float32 --- python_coreml_stable_diffusion/torch2coreml.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python_coreml_stable_diffusion/torch2coreml.py b/python_coreml_stable_diffusion/torch2coreml.py index 344d5354..770f52b6 100644 --- a/python_coreml_stable_diffusion/torch2coreml.py +++ b/python_coreml_stable_diffusion/torch2coreml.py @@ -926,6 +926,8 @@ def convert_safety_checker(pipe, args): ) return + pipe.safety_checker = pipe.safety_checker.to(torch.float32) + im_h = pipe.vae.config.sample_size im_w = pipe.vae.config.sample_size