Skip to content

off-by-one error in pndm scheduler #477

@rokbok

Description

@rokbok

There appears to be an off-by-one error on this line:

alpha_prod_t = self.alphas_cumprod[timestep + 1 - self._offset]

I got IndexError: index 1000 is out of bounds for dimension 0 with size 1000

Repro script:

from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline
from PIL import Image

pipe = StableDiffusionPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4", 
    torch_dtype = torch.float16,
    revision = 'fp16',
    use_auth_token = True,
).to("cuda")

with torch.autocast("cuda"):
        image = pipe(prompt="astronaut or doesn't really matter", num_inference_steps=3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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