mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-09-14 13:35:05 +00:00
Same thing but for the other places where it's used.
This commit is contained in:
@@ -20,6 +20,11 @@ except:
|
||||
import os
|
||||
_ATTN_PRECISION = os.environ.get("ATTN_PRECISION", "fp32")
|
||||
|
||||
try:
|
||||
OOM_EXCEPTION = torch.cuda.OutOfMemoryError
|
||||
except:
|
||||
OOM_EXCEPTION = Exception
|
||||
|
||||
def exists(val):
|
||||
return val is not None
|
||||
|
||||
@@ -316,7 +321,7 @@ class CrossAttentionDoggettx(nn.Module):
|
||||
r1[:, i:end] = einsum('b i j, b j d -> b i d', s2, v)
|
||||
del s2
|
||||
break
|
||||
except torch.cuda.OutOfMemoryError as e:
|
||||
except OOM_EXCEPTION as e:
|
||||
if first_op_done == False:
|
||||
torch.cuda.empty_cache()
|
||||
torch.cuda.ipc_collect()
|
||||
|
Reference in New Issue
Block a user