aboutsummaryrefslogtreecommitdiffstats
path: root/modules/processing.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-11-02 04:30:03 +0000
committerGitHub <noreply@github.com>2022-11-02 04:30:03 +0000
commit65522ff157e4be4095a99421da04ecb0749824ac (patch)
treecac5086113fe5fd751416a754da83ce4a44e4b16 /modules/processing.py
parent10f62546d30913ad7fde5d77ed39e864b84bb856 (diff)
parentc9148b2312b36fee8727f5233da9dbe32aa1f58c (diff)
downloadstable-diffusion-webui-gfx803-65522ff157e4be4095a99421da04ecb0749824ac.tar.gz
stable-diffusion-webui-gfx803-65522ff157e4be4095a99421da04ecb0749824ac.tar.bz2
stable-diffusion-webui-gfx803-65522ff157e4be4095a99421da04ecb0749824ac.zip
Merge pull request #4142 from jn-jairo/processing-close
Release processing resources after it finishes
Diffstat (limited to 'modules/processing.py')
-rw-r--r--modules/processing.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/processing.py b/modules/processing.py
index 57d3a523..b541ee2b 100644
--- a/modules/processing.py
+++ b/modules/processing.py
@@ -202,6 +202,10 @@ class StableDiffusionProcessing():
def sample(self, conditioning, unconditional_conditioning, seeds, subseeds, subseed_strength):
raise NotImplementedError()
+ def close(self):
+ self.sd_model = None
+ self.sampler = None
+
class Processed:
def __init__(self, p: StableDiffusionProcessing, images_list, seed=-1, info="", subseed=None, all_prompts=None, all_seeds=None, all_subseeds=None, index_of_first_image=0, infotexts=None):
@@ -597,9 +601,6 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
if p.scripts is not None:
p.scripts.postprocess(p, res)
- p.sd_model = None
- p.sampler = None
-
return res