Skip to content

tiled VAE fails with IndexError #2646

@keturn

Description

@keturn

Describe the bug

decoding with enable_vae_tiling fails with the Stable Diffusion 2.1 model on certain sizes, throwing an IndexError.

Reproduction

import diffusers, torch
pipeline = diffusers.StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16, revision="fp16").to("cuda")
pipeline.enable_xformers_memory_efficient_attention()
pipeline.enable_vae_tiling()

t0 = torch.zeros((1, 4, 20, 24))

with torch.inference_mode():
    decoded = pipeline.decode_latents(t)

Logs

IndexError: index 128 is out of bounds for dimension 2 with size 128

System Info

  • diffusers version: 0.14.0
  • Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.35
  • Python version: 3.10.6
  • PyTorch version (GPU?): 1.13.1+cu117 (True)
  • Huggingface_hub version: 0.11.1
  • Transformers version: 4.26.1
  • Accelerate version: 0.16.0
  • xFormers version: 0.0.16
  • Using GPU in script?: yes
  • Using distributed or parallel set-up in script?: no

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleIssues that haven't received updates

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions