diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-09 07:25:35 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-09 07:25:35 +0000 |
commit | 386245a26427a64f364f66f6fecd03b3bccfd7f3 (patch) | |
tree | 427cd01b680c318acb964076232b064882d2f364 /modules/sd_models.py | |
parent | 7d81ecbea6b558addd356d49c56891d04bc91fd4 (diff) | |
download | stable-diffusion-webui-gfx803-386245a26427a64f364f66f6fecd03b3bccfd7f3.tar.gz stable-diffusion-webui-gfx803-386245a26427a64f364f66f6fecd03b3bccfd7f3.tar.bz2 stable-diffusion-webui-gfx803-386245a26427a64f364f66f6fecd03b3bccfd7f3.zip |
split shared.py into multiple files; should resolve all circular reference import errors related to shared.py
Diffstat (limited to 'modules/sd_models.py')
-rw-r--r-- | modules/sd_models.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/modules/sd_models.py b/modules/sd_models.py index 53c1df54..88a09899 100644 --- a/modules/sd_models.py +++ b/modules/sd_models.py @@ -14,7 +14,7 @@ import ldm.modules.midas as midas from ldm.util import instantiate_from_config
-from modules import paths, shared, modelloader, devices, script_callbacks, sd_vae, sd_disable_initialization, errors, hashes, sd_models_config, sd_unet, sd_models_xl, cache
+from modules import paths, shared, modelloader, devices, script_callbacks, sd_vae, sd_disable_initialization, errors, hashes, sd_models_config, sd_unet, sd_models_xl, cache, extra_networks, processing, lowvram, sd_hijack
from modules.timer import Timer
import tomesd
@@ -473,7 +473,6 @@ model_data = SdModelData() def get_empty_cond(sd_model):
- from modules import extra_networks, processing
p = processing.StableDiffusionProcessingTxt2Img()
extra_networks.activate(p, {})
@@ -486,8 +485,6 @@ def get_empty_cond(sd_model): def send_model_to_cpu(m):
- from modules import lowvram
-
if shared.cmd_opts.lowvram or shared.cmd_opts.medvram:
lowvram.send_everything_to_cpu()
else:
@@ -497,8 +494,6 @@ def send_model_to_cpu(m): def send_model_to_device(m):
- from modules import lowvram
-
if shared.cmd_opts.lowvram or shared.cmd_opts.medvram:
lowvram.setup_for_low_vram(m, shared.cmd_opts.medvram)
else:
@@ -642,7 +637,6 @@ def reuse_model_from_already_loaded(sd_model, checkpoint_info, timer): def reload_model_weights(sd_model=None, info=None):
- from modules import devices, sd_hijack
checkpoint_info = info or select_checkpoint()
timer = Timer()
@@ -705,7 +699,6 @@ def reload_model_weights(sd_model=None, info=None): def unload_model_weights(sd_model=None, info=None):
- from modules import devices, sd_hijack
timer = Timer()
if model_data.sd_model:
|