Skip to content

StableDiffusionInpaintPipeline does not work with LMSDiscreteScheduler #562

@shirayu

Description

@shirayu

Describe the bug

StableDiffusionInpaintPipeline does not work with LMSDiscreteScheduler

Reason

  • This seems to be because of the absence of special operations for LMSDiscreteScheduler as performed in StableDiffusionImg2ImgPipeline

if isinstance(self.scheduler, LMSDiscreteScheduler):
timesteps = torch.tensor(
[num_inference_steps - init_timestep] * batch_size, dtype=torch.long, device=self.device
)
else:
timesteps = self.scheduler.timesteps[-init_timestep]
timesteps = torch.tensor([timesteps] * batch_size, dtype=torch.long, device=self.device)

timesteps = torch.tensor([timesteps] * batch_size, dtype=torch.long, device=self.device)

Proposal:

I think it is better to unify pipelines as proposed in #551, since most processes are the same.

Reproduction

No response

Logs

"/path/to/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py", line 245, in __call__
    timesteps = torch.tensor([timesteps] * batch_size, dtype=torch.long, device=self.device)

TypeError: only integer tensors of a single element can be converted to an index

System Info

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions