Added memory clearance after deletion
This commit is contained in:
parent
ff1609f91e
commit
44db35fb1a
|
@ -1,3 +1,5 @@
|
|||
import gc
|
||||
|
||||
import torch
|
||||
from torch.nn.functional import silu
|
||||
from types import MethodType
|
||||
|
@ -190,7 +192,9 @@ class StableDiffusionModelHijack:
|
|||
delattr(m.model.diffusion_model.output_blocks[0][1].transformer_blocks,i)
|
||||
delattr(m.model.diffusion_model.output_blocks[1][1].transformer_blocks,i)
|
||||
delattr(m.model.diffusion_model.output_blocks[4][1].transformer_blocks,'1')
|
||||
delattr(m.model.diffusion_model.output_blocks[5][1].transformer_blocks,'1')
|
||||
delattr(m.model.diffusion_model.output_blocks[5][1].transformer_blocks,'1')
|
||||
torch.cuda.empty_cache()
|
||||
gc.collect()
|
||||
|
||||
def hijack(self, m):
|
||||
conditioner = getattr(m, 'conditioner', None)
|
||||
|
|
Loading…
Reference in New Issue