    prompt_embeds, prompt_attention_mask, negative_embeds, negative_prompt_attention_mask = pipe.encode_prompt(prompt) Since text embeddings have been computed, remove the text_encoder and pipe from the memory, and free up som GPU VRAM:   Copied import gc 