Bump to 0.6.0.dev0 (#831)
* Bump to 0.6.0.dev0 * Deprecate tensor_format and .samples * style * upd * upd * style * sample -> images * Update src/diffusers/schedulers/scheduling_ddpm.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * Update src/diffusers/schedulers/scheduling_ddim.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * Update src/diffusers/schedulers/scheduling_karras_ve.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * Update src/diffusers/schedulers/scheduling_lms_discrete.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * Update src/diffusers/schedulers/scheduling_pndm.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * Update src/diffusers/schedulers/scheduling_sde_ve.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * Update src/diffusers/schedulers/scheduling_sde_vp.py Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
This commit is contained in:
parent
b8c4d5801c
commit
52394b53e2
2
setup.py
2
setup.py
|
@ -211,7 +211,7 @@ install_requires = [
|
|||
|
||||
setup(
|
||||
name="diffusers",
|
||||
version="0.5.1", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
|
||||
version="0.6.0.dev0", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
|
||||
description="Diffusers",
|
||||
long_description=open("README.md", "r", encoding="utf-8").read(),
|
||||
long_description_content_type="text/markdown",
|
||||
|
|
|
@ -9,7 +9,7 @@ from .utils import (
|
|||
)
|
||||
|
||||
|
||||
__version__ = "0.5.1"
|
||||
__version__ = "0.6.0.dev0"
|
||||
|
||||
from .configuration_utils import ConfigMixin
|
||||
from .onnx_utils import OnnxRuntimeModel
|
||||
|
|
|
@ -119,15 +119,7 @@ class DDIMScheduler(SchedulerMixin, ConfigMixin):
|
|||
clip_sample: bool = True,
|
||||
set_alpha_to_one: bool = True,
|
||||
steps_offset: int = 0,
|
||||
**kwargs,
|
||||
):
|
||||
deprecate(
|
||||
"tensor_format",
|
||||
"0.6.0",
|
||||
"If you're running your code in PyTorch, you can safely remove this argument.",
|
||||
take_from=kwargs,
|
||||
)
|
||||
|
||||
if trained_betas is not None:
|
||||
self.betas = torch.from_numpy(trained_betas)
|
||||
elif beta_schedule == "linear":
|
||||
|
|
|
@ -22,7 +22,7 @@ import numpy as np
|
|||
import torch
|
||||
|
||||
from ..configuration_utils import ConfigMixin, register_to_config
|
||||
from ..utils import BaseOutput, deprecate
|
||||
from ..utils import BaseOutput
|
||||
from .scheduling_utils import SchedulerMixin
|
||||
|
||||
|
||||
|
@ -112,15 +112,7 @@ class DDPMScheduler(SchedulerMixin, ConfigMixin):
|
|||
trained_betas: Optional[np.ndarray] = None,
|
||||
variance_type: str = "fixed_small",
|
||||
clip_sample: bool = True,
|
||||
**kwargs,
|
||||
):
|
||||
deprecate(
|
||||
"tensor_format",
|
||||
"0.6.0",
|
||||
"If you're running your code in PyTorch, you can safely remove this argument.",
|
||||
take_from=kwargs,
|
||||
)
|
||||
|
||||
if trained_betas is not None:
|
||||
self.betas = torch.from_numpy(trained_betas)
|
||||
elif beta_schedule == "linear":
|
||||
|
|
|
@ -20,7 +20,7 @@ import numpy as np
|
|||
import torch
|
||||
|
||||
from ..configuration_utils import ConfigMixin, register_to_config
|
||||
from ..utils import BaseOutput, deprecate
|
||||
from ..utils import BaseOutput
|
||||
from .scheduling_utils import SchedulerMixin
|
||||
|
||||
|
||||
|
@ -86,15 +86,7 @@ class KarrasVeScheduler(SchedulerMixin, ConfigMixin):
|
|||
s_churn: float = 80,
|
||||
s_min: float = 0.05,
|
||||
s_max: float = 50,
|
||||
**kwargs,
|
||||
):
|
||||
deprecate(
|
||||
"tensor_format",
|
||||
"0.6.0",
|
||||
"If you're running your code in PyTorch, you can safely remove this argument.",
|
||||
take_from=kwargs,
|
||||
)
|
||||
|
||||
# standard deviation of the initial noise distribution
|
||||
self.init_noise_sigma = sigma_max
|
||||
|
||||
|
|
|
@ -74,15 +74,7 @@ class LMSDiscreteScheduler(SchedulerMixin, ConfigMixin):
|
|||
beta_end: float = 0.02,
|
||||
beta_schedule: str = "linear",
|
||||
trained_betas: Optional[np.ndarray] = None,
|
||||
**kwargs,
|
||||
):
|
||||
deprecate(
|
||||
"tensor_format",
|
||||
"0.6.0",
|
||||
"If you're running your code in PyTorch, you can safely remove this argument.",
|
||||
take_from=kwargs,
|
||||
)
|
||||
|
||||
if trained_betas is not None:
|
||||
self.betas = torch.from_numpy(trained_betas)
|
||||
elif beta_schedule == "linear":
|
||||
|
|
|
@ -100,15 +100,7 @@ class PNDMScheduler(SchedulerMixin, ConfigMixin):
|
|||
skip_prk_steps: bool = False,
|
||||
set_alpha_to_one: bool = False,
|
||||
steps_offset: int = 0,
|
||||
**kwargs,
|
||||
):
|
||||
deprecate(
|
||||
"tensor_format",
|
||||
"0.6.0",
|
||||
"If you're running your code in PyTorch, you can safely remove this argument.",
|
||||
take_from=kwargs,
|
||||
)
|
||||
|
||||
if trained_betas is not None:
|
||||
self.betas = torch.from_numpy(trained_betas)
|
||||
elif beta_schedule == "linear":
|
||||
|
|
|
@ -21,7 +21,7 @@ from typing import Optional, Tuple, Union
|
|||
import torch
|
||||
|
||||
from ..configuration_utils import ConfigMixin, register_to_config
|
||||
from ..utils import BaseOutput, deprecate
|
||||
from ..utils import BaseOutput
|
||||
from .scheduling_utils import SchedulerMixin, SchedulerOutput
|
||||
|
||||
|
||||
|
@ -75,15 +75,7 @@ class ScoreSdeVeScheduler(SchedulerMixin, ConfigMixin):
|
|||
sigma_max: float = 1348.0,
|
||||
sampling_eps: float = 1e-5,
|
||||
correct_steps: int = 1,
|
||||
**kwargs,
|
||||
):
|
||||
deprecate(
|
||||
"tensor_format",
|
||||
"0.6.0",
|
||||
"If you're running your code in PyTorch, you can safely remove this argument.",
|
||||
take_from=kwargs,
|
||||
)
|
||||
|
||||
# standard deviation of the initial noise distribution
|
||||
self.init_noise_sigma = sigma_max
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ from typing import Union
|
|||
import torch
|
||||
|
||||
from ..configuration_utils import ConfigMixin, register_to_config
|
||||
from ..utils import deprecate
|
||||
from .scheduling_utils import SchedulerMixin
|
||||
|
||||
|
||||
|
@ -40,13 +39,7 @@ class ScoreSdeVpScheduler(SchedulerMixin, ConfigMixin):
|
|||
"""
|
||||
|
||||
@register_to_config
|
||||
def __init__(self, num_train_timesteps=2000, beta_min=0.1, beta_max=20, sampling_eps=1e-3, **kwargs):
|
||||
deprecate(
|
||||
"tensor_format",
|
||||
"0.6.0",
|
||||
"If you're running your code in PyTorch, you can safely remove this argument.",
|
||||
take_from=kwargs,
|
||||
)
|
||||
def __init__(self, num_train_timesteps=2000, beta_min=0.1, beta_max=20, sampling_eps=1e-3):
|
||||
self.sigmas = None
|
||||
self.discrete_sigmas = None
|
||||
self.timesteps = None
|
||||
|
|
|
@ -15,7 +15,7 @@ from dataclasses import dataclass
|
|||
|
||||
import torch
|
||||
|
||||
from ..utils import BaseOutput, deprecate
|
||||
from ..utils import BaseOutput
|
||||
|
||||
|
||||
SCHEDULER_CONFIG_NAME = "scheduler_config.json"
|
||||
|
@ -41,12 +41,3 @@ class SchedulerMixin:
|
|||
"""
|
||||
|
||||
config_name = SCHEDULER_CONFIG_NAME
|
||||
|
||||
def set_format(self, tensor_format="pt"):
|
||||
deprecate(
|
||||
"set_format",
|
||||
"0.6.0",
|
||||
"If you're running your code in PyTorch, you can safely remove this function as the schedulers are always"
|
||||
" in Pytorch",
|
||||
)
|
||||
return self
|
||||
|
|
|
@ -21,7 +21,6 @@ from typing import Any, Tuple
|
|||
|
||||
import numpy as np
|
||||
|
||||
from .deprecation_utils import deprecate
|
||||
from .import_utils import is_torch_available
|
||||
|
||||
|
||||
|
@ -86,9 +85,6 @@ class BaseOutput(OrderedDict):
|
|||
def __getitem__(self, k):
|
||||
if isinstance(k, str):
|
||||
inner_dict = {k: v for (k, v) in self.items()}
|
||||
if self.__class__.__name__ in ["StableDiffusionPipelineOutput", "ImagePipelineOutput"] and k == "sample":
|
||||
deprecate("samples", "0.6.0", "Please use `.images` or `'images'` instead.")
|
||||
return inner_dict["images"]
|
||||
return inner_dict[k]
|
||||
else:
|
||||
return self.to_tuple()[k]
|
||||
|
|
|
@ -318,14 +318,14 @@ class PipelineFastTests(unittest.TestCase):
|
|||
# Warmup pass when using mps (see #372)
|
||||
if torch_device == "mps":
|
||||
generator = torch.manual_seed(0)
|
||||
_ = ldm([prompt], generator=generator, guidance_scale=6.0, num_inference_steps=1, output_type="numpy")[
|
||||
"sample"
|
||||
]
|
||||
_ = ldm(
|
||||
[prompt], generator=generator, guidance_scale=6.0, num_inference_steps=1, output_type="numpy"
|
||||
).images
|
||||
|
||||
generator = torch.manual_seed(0)
|
||||
image = ldm([prompt], generator=generator, guidance_scale=6.0, num_inference_steps=2, output_type="numpy")[
|
||||
"sample"
|
||||
]
|
||||
image = ldm(
|
||||
[prompt], generator=generator, guidance_scale=6.0, num_inference_steps=2, output_type="numpy"
|
||||
).images
|
||||
|
||||
generator = torch.manual_seed(0)
|
||||
image_from_tuple = ldm(
|
||||
|
@ -1535,9 +1535,9 @@ class PipelineTesterMixin(unittest.TestCase):
|
|||
|
||||
prompt = "A painting of a squirrel eating a burger"
|
||||
generator = torch.manual_seed(0)
|
||||
image = ldm([prompt], generator=generator, guidance_scale=6.0, num_inference_steps=20, output_type="numpy")[
|
||||
"sample"
|
||||
]
|
||||
image = ldm(
|
||||
[prompt], generator=generator, guidance_scale=6.0, num_inference_steps=20, output_type="numpy"
|
||||
).images
|
||||
|
||||
image_slice = image[0, -3:, -3:, -1]
|
||||
|
||||
|
|
Loading…
Reference in New Issue