From d68cd0dcb17d9f962868ce665e9f68793493e910 Mon Sep 17 00:00:00 2001 From: ModeratePrawn Date: Thu, 1 Sep 2022 08:55:51 -0400 Subject: [PATCH] Add files via upload Fix img2img.py for cpu code. --- scripts/img2img.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/img2img.py b/scripts/img2img.py index 421e215..285fef7 100644 --- a/scripts/img2img.py +++ b/scripts/img2img.py @@ -40,7 +40,8 @@ def load_model_from_config(config, ckpt, verbose=False): print("unexpected keys:") print(u) - model.cuda() + if torch.cuda.is_available(): + model.cuda() model.eval() return model