# Overflow error: cannot fit 'int' into an index-sized integer For SDXL

**URL:** <https://discuss.huggingface.co/t/overflow-error-cannot-fit-int-into-an-index-sized-integer-for-sdxl/92549>\
**Category:** 🧨 Diffusers\
**Created:** [June 17, 2024, 10:06am UTC](https://discuss.huggingface.co/t/overflow-error-cannot-fit-int-into-an-index-sized-integer-for-sdxl/92549 "2024-06-17T10:06:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Archan](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/archan/32/28312_2.png) [@Archan](https://discuss.huggingface.co/u/Archan)\
**Post date:** [June 17, 2024, 10:06am UTC](https://discuss.huggingface.co/t/overflow-error-cannot-fit-int-into-an-index-sized-integer-for-sdxl/92549/1 "2024-06-17T10:06:49Z")

</div>

I am trying to Run SDXL based on the code given in the model card:

```auto
from diffusers import DiffusionPipeline
import torch

pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
pipe.to("cuda")

# if using torch < 2.0
# pipe.enable_xformers_memory_efficient_attention()

prompt = "An astronaut riding a green horse"

images = pipe(prompt=prompt).images[0]

```

But I am getting the following Error:

```auto
encoded_inputs["attention_mask"] = encoded_inputs["attention_mask"] * [0] * difference

Overflow error: cannot fit 'int' into an index-sized integer

```

System Info:

Python:3.10  
GPU: A100  
Torch:2.3.1 + cu12.1
