diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-06-01 18:35:14 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-06-01 18:35:14 +0000 |
commit | b6af0a3809ea869fb180633f9affcae4b199ffcf (patch) | |
tree | ac47f34ac97c08e8f83fb2c90f6977459121e6b5 /modules/shared.py | |
parent | 20ae71faa8ef035c31aa3a410b707d792c8203a3 (diff) | |
parent | 8c3e64f4f6d67076031132b1628daba66dfa1121 (diff) | |
download | stable-diffusion-webui-gfx803-b6af0a3809ea869fb180633f9affcae4b199ffcf.tar.gz stable-diffusion-webui-gfx803-b6af0a3809ea869fb180633f9affcae4b199ffcf.tar.bz2 stable-diffusion-webui-gfx803-b6af0a3809ea869fb180633f9affcae4b199ffcf.zip |
Merge branch 'release_candidate'
Diffstat (limited to 'modules/shared.py')
-rw-r--r-- | modules/shared.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/shared.py b/modules/shared.py index 3099d1d2..271a062d 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -6,6 +6,7 @@ import threading import time
import gradio as gr
+import torch
import tqdm
import modules.interrogate
@@ -76,6 +77,9 @@ cmd_opts.disable_extension_access = (cmd_opts.share or cmd_opts.listen or cmd_op devices.device, devices.device_interrogate, devices.device_gfpgan, devices.device_esrgan, devices.device_codeformer = \
(devices.cpu if any(y in cmd_opts.use_cpu for y in [x, 'all']) else devices.get_optimal_device() for x in ['sd', 'interrogate', 'gfpgan', 'esrgan', 'codeformer'])
+devices.dtype = torch.float32 if cmd_opts.no_half else torch.float16
+devices.dtype_vae = torch.float32 if cmd_opts.no_half or cmd_opts.no_half_vae else torch.float16
+
device = devices.device
weight_load_location = None if cmd_opts.lowram else "cpu"
|