ip-2-1-l", torch_dtype=torch.float16
... )  # TODO update model path
>>> pipe = pipe.to("cuda")

>>> prompt = "a photo of an astronaut riding a horse on mars"
>>> images = pipe(prompt).images
>>> images[0].save("astronaut_horse.png")

enable_attention_slicing

<
source
>
(
slice_size: typing.Union[str, int, NoneType] = 'auto'

)


Parameters 

slice_size (str or int, optional, defaults to "auto") —
When "auto", halves the input to the attention