From d2cec0d4159a2faefd503ce75f299f2324631a73 Mon Sep 17 00:00:00 2001 From: Qing Date: Wed, 4 Jan 2023 21:27:37 +0800 Subject: [PATCH] fix sd --no-half --- lama_cleaner/model/sd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lama_cleaner/model/sd.py b/lama_cleaner/model/sd.py index 56817eb..2734908 100644 --- a/lama_cleaner/model/sd.py +++ b/lama_cleaner/model/sd.py @@ -40,7 +40,7 @@ class SD(InpaintModel): )) use_gpu = device == torch.device('cuda') and torch.cuda.is_available() - torch_dtype = torch.float16 if use_gpu else torch.float32 + torch_dtype = torch.float16 if use_gpu and fp16 else torch.float32 self.model = StableDiffusionInpaintPipeline.from_pretrained( self.model_id_or_path, revision="fp16" if use_gpu and fp16 else "main",