=torch.float16
... )
>>> pipe = pipe.to("cuda")

>>> generator = torch.Generator(device="cuda").manual_seed(0)
>>> image = pipe(image, generator=generator).images[0]
>>> image.save("./car_variation.png")

enable_sequential_cpu_offload

<
source
>
(
gpu_id = 0

)



Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then