diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-08 14:13:18 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-07-08 14:13:18 +0000 |
commit | da8916f92649fc4d947cb46d9d8f8ea1621b2a59 (patch) | |
tree | b3c6883f8c731b0e1291e61a16f16b12ed22e101 /modules/codeformer_model.py | |
parent | e161b5a0259c870b9d01408d02c504c3281dbdb1 (diff) | |
download | stable-diffusion-webui-gfx803-da8916f92649fc4d947cb46d9d8f8ea1621b2a59.tar.gz stable-diffusion-webui-gfx803-da8916f92649fc4d947cb46d9d8f8ea1621b2a59.tar.bz2 stable-diffusion-webui-gfx803-da8916f92649fc4d947cb46d9d8f8ea1621b2a59.zip |
added torch.mps.empty_cache() to torch_gc()
changed a bunch of places that use torch.cuda.empty_cache() to use torch_gc() instead
Diffstat (limited to 'modules/codeformer_model.py')
-rw-r--r-- | modules/codeformer_model.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/codeformer_model.py b/modules/codeformer_model.py index f293acf5..da42b5e9 100644 --- a/modules/codeformer_model.py +++ b/modules/codeformer_model.py @@ -99,7 +99,7 @@ def setup_model(dirname): output = self.net(cropped_face_t, w=w if w is not None else shared.opts.code_former_weight, adain=True)[0]
restored_face = tensor2img(output, rgb2bgr=True, min_max=(-1, 1))
del output
- torch.cuda.empty_cache()
+ devices.torch_gc()
except Exception:
errors.report('Failed inference for CodeFormer', exc_info=True)
restored_face = tensor2img(cropped_face_t, rgb2bgr=True, min_max=(-1, 1))
|