Compare commits

..

2 Commits

Author SHA1 Message Date
anton-l
c1b378db69 Release: v0.2.1 2022-08-16 18:22:45 +02:00
Patrick von Platen
b50a9ae383 [Stable diffusion] Hot fix 2022-08-16 16:17:32 +00:00
5 changed files with 9 additions and 9 deletions

View File

@@ -123,7 +123,7 @@ The class provides functionality to compute previous image according to alpha, b
**With `pip`**
```bash
pip install --upgrade diffusers # should install diffusers 0.2.0
pip install --upgrade diffusers # should install diffusers 0.2.1
```
**With `conda`**

View File

@@ -181,7 +181,7 @@ install_requires = [
setup(
name="diffusers",
version="0.2.0",
version="0.2.1",
description="Diffusers",
long_description=open("README.md", "r", encoding="utf-8").read(),
long_description_content_type="text/markdown",

View File

@@ -4,7 +4,7 @@
from .utils import is_inflect_available, is_scipy_available, is_transformers_available, is_unidecode_available
__version__ = "0.2.0"
__version__ = "0.2.1"
from .modeling_utils import ModelMixin
from .models import AutoencoderKL, UNet2DConditionModel, UNet2DModel, VQModel

View File

@@ -96,6 +96,10 @@ class StableDiffusionPipeline(DiffusionPipeline):
self.scheduler.set_timesteps(num_inference_steps, **extra_set_kwargs)
# if we use LMSDiscreteScheduler, let's make sure latents are mulitplied by sigmas
if isinstance(self.scheduler, LMSDiscreteScheduler):
latents = latents * self.scheduler.sigmas[0]
# prepare extra kwargs for the scheduler step, since not all schedulers have the same signature
# eta (η) is only used with the DDIMScheduler, it will be ignored for other schedulers.
# eta corresponds to η in DDIM paper: https://arxiv.org/abs/2010.02502
@@ -105,10 +109,6 @@ class StableDiffusionPipeline(DiffusionPipeline):
if accepts_eta:
extra_step_kwargs["eta"] = eta
self.scheduler.set_timesteps(num_inference_steps)
if isinstance(self.scheduler, LMSDiscreteScheduler):
latents = latents * self.scheduler.sigmas[0]
for i, t in tqdm(enumerate(self.scheduler.timesteps)):
# expand the latents if we are doing classifier free guidance
latent_model_input = torch.cat([latents] * 2) if do_classifier_free_guidance else latents

View File

@@ -36,8 +36,8 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
tensor_format="pt",
):
"""
Linear Multistep Scheduler for discrete beta schedules.
Based on the original k-diffusion implementation by Katherine Crowson:
Linear Multistep Scheduler for discrete beta schedules. Based on the original k-diffusion implementation by
Katherine Crowson:
https://github.com/crowsonkb/k-diffusion/blob/481677d114f6ea445aa009cf5bd7a9cdee909e47/k_diffusion/sampling.py#L181
"""