Skip to content

Conversation

@anton-l
Copy link
Member

@anton-l anton-l commented Oct 6, 2022

Now the legacy pipelines that support LMS won't break because of the integer timesteps :)
For instance: https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/CLIP_Guided_Stable_diffusion_with_diffusers.ipynb

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 6, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@patil-suraj patil-suraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, thanks a lot!

@anton-l anton-l merged commit df9c070 into main Oct 6, 2022
timesteps = timesteps.to(original_samples.device)
step_indices = [(schedule_timesteps == t).nonzero().item() for t in timesteps]
if isinstance(timesteps, torch.IntTensor) or isinstance(timesteps, torch.LongTensor):
warnings.warn(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the deprecate functionality here

or isinstance(timestep, torch.IntTensor)
or isinstance(timestep, torch.LongTensor)
):
warnings.warn(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the deprecate functionality here: #659

if isinstance(timestep, torch.Tensor):
timestep = timestep.to(self.timesteps.device)
step_index = (self.timesteps == timestep).nonzero().item()
if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could lead to some nasty silent bugs though if the "new" passed timesteps are ints instead of float no? Not sure whether this is a good idea tbh

@anton-l anton-l deleted the lms-int-compat branch October 6, 2022 13:52
prathikr pushed a commit to prathikr/diffusers that referenced this pull request Oct 26, 2022
* Add back-compatibility to LMS timesteps

* style
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* Add back-compatibility to LMS timesteps

* style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants