mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-16 00:12:33 +08:00
To enable support for non-CUDA devices, substitute torch.cuda.empty_cache() with model_management.soft_empty_cache().
This commit is contained in:
parent
4d4e6a05fa
commit
0264149f46
@ -721,13 +721,13 @@ class Decoder(nn.Module):
|
|||||||
if len(self.up[i_level].attn) > 0:
|
if len(self.up[i_level].attn) > 0:
|
||||||
h_new = self.up[i_level].attn[i_block](h_new, **kwargs)
|
h_new = self.up[i_level].attn[i_block](h_new, **kwargs)
|
||||||
del h
|
del h
|
||||||
torch.cuda.empty_cache()
|
model_management.soft_empty_cache()
|
||||||
h = h_new
|
h = h_new
|
||||||
|
|
||||||
if i_level != 0:
|
if i_level != 0:
|
||||||
h_new = self.up[i_level].upsample(h)
|
h_new = self.up[i_level].upsample(h)
|
||||||
del h
|
del h
|
||||||
torch.cuda.empty_cache()
|
model_management.soft_empty_cache()
|
||||||
h = h_new
|
h = h_new
|
||||||
|
|
||||||
# end
|
# end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user