quick fix when updating the prompt

text_encoders and tokenizers are not deleted when encoding prompt, and deleting them that way didn't free much vram anyway
This commit is contained in:
GiusTex
2024-10-05 15:05:55 +02:00
committed by GitHub
parent 6a51ce5d3b
commit 34c1bdad6e
-7
View File
@@ -274,13 +274,6 @@ class EncodeDiffusersOutpaintPrompt:
"pooled_prompt_embeds": pooled_prompt_embeds,
"negative_pooled_prompt_embeds": negative_pooled_prompt_embeds
}
del pipe.text_encoder, pipe.text_encoder_2, pipe.tokenizer, pipe.tokenizer_2
gc.collect()
torch.cuda.empty_cache()
torch.cuda.ipc_collect()
# Update pipe
diffusers_outpaint_pipe["pipe"] = pipe
return (diffusers_outpaint_pipe,diffusers_outpaint_conditioning,)