-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
At least StableDiffusionXLPipeline and StableDiffusionXLImg2ImgPipeline sends step to callback function, starting at 1 and incrementing by 2 instead of incrementing by 1.
Reproduction
import torch
from diffusers import AutoencoderKL, StableDiffusionXLPipeline, StableDiffusionXLImg2ImgPipeline, KDPM2AncestralDiscreteScheduler
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix",
torch_dtype=torch.float16
)
base = StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0",
vae=vae,
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True
)
scheduler = KDPM2AncestralDiscreteScheduler.from_config(base.scheduler.config, use_karras_sigmas=True)
base.scheduler = scheduler
base.to("cuda")
def print_step(s, t, latents):
print(s)
generator=torch.manual_seed(1111)
images = base(
prompt="LOVE",
num_inference_steps=10,
generator=generator,
callback=print_step
).images
for image in images:
display(image)Output from print_step function:
1
3
5
7
9
...Expected output:
0
1
2
3
4
...
System Info
Diffusers 0.21.4
Who can help?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working