diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-30 16:36:24 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-30 16:36:24 +0000 |
commit | 0af4127fd14360ebb12c6569d98aebf8047abbfc (patch) | |
tree | bfb191898459449d6eac3d90d65bf7a08d17bb63 /modules | |
parent | 02038036ff571e0f04a94c3e279609666e239dec (diff) | |
download | stable-diffusion-webui-gfx803-0af4127fd14360ebb12c6569d98aebf8047abbfc.tar.gz stable-diffusion-webui-gfx803-0af4127fd14360ebb12c6569d98aebf8047abbfc.tar.bz2 stable-diffusion-webui-gfx803-0af4127fd14360ebb12c6569d98aebf8047abbfc.zip |
delete the field that is preventing the model from being unloaded and is causing increased RAM usage
Diffstat (limited to 'modules')
-rw-r--r-- | modules/processing.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/processing.py b/modules/processing.py index 0677de81..b09433b0 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -1076,11 +1076,15 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): current = shared.sd_model.sd_checkpoint_info
try:
if self.hr_checkpoint_info is not None:
+ del self.sampler
sd_models.reload_model_weights(info=self.hr_checkpoint_info)
+ devices.torch_gc()
return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
finally:
+ del self.sampler
sd_models.reload_model_weights(info=current)
+ devices.torch_gc()
def sample_hr_pass(self, samples, decoded_samples, seeds, subseeds, subseed_strength, prompts):
self.is_hr_pass = True
|