pu_offload

<
source
>
(
gpu_id = 0

)



Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline’s
models have their state dicts saved to CPU and then are moved to a torch.device('meta') and loaded to GPU only when their specific submodule has its forward` method called.

noise_image_embeddings

<
source
>
(
image_embeds: Tensor
noise_level: int
noise: typing.Optional[torch.FloatTensor] = Non