Add a force argument to soft_empty_cache to force a cache empty.

This commit is contained in:
comfyanonymous
2023-09-04 00:58:18 -04:00
parent 7746bdf7b0
commit 1938f5c5fe
3 changed files with 4 additions and 3 deletions

View File

@@ -323,7 +323,7 @@ class CrossAttentionDoggettx(nn.Module):
break
except model_management.OOM_EXCEPTION as e:
if first_op_done == False:
model_management.soft_empty_cache()
model_management.soft_empty_cache(True)
if cleared_cache == False:
cleared_cache = True
print("out of memory error, emptying cache and trying again")