Skip to content

Commit

Permalink
[Release 0.21] Bump version (#5018)
Browse files Browse the repository at this point in the history
* [Release 0.21] Bump version

* fix & remove

* fix more

* fix all, upload
  • Loading branch information
patrickvonplaten authored Sep 14, 2023
1 parent 169fc4a commit 342c5c0
Show file tree
Hide file tree
Showing 33 changed files with 33 additions and 130 deletions.
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/controlnet/train_controlnet_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/custom_diffusion/train_custom_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

# Cache compiled models across invocations of this script.
cc.initialize_cache(os.path.expanduser("~/.cache/jax/compilation_cache"))
Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/dreambooth/train_dreambooth_lora_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/instruct_pix2pix/train_instruct_pix2pix.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/instruct_pix2pix/train_instruct_pix2pix_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/t2i_adapter/train_t2i_adapter_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import wandb

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image_lora_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/text_to_image/train_text_to_image_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/textual_inversion/textual_inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion examples/textual_inversion/textual_inversion_flax.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# ------------------------------------------------------------------------------

# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


# Will error if the minimal version of diffusers is not installed. Remove at your own risks.
check_min_version("0.21.0.dev0")
check_min_version("0.22.0.dev0")

logger = get_logger(__name__, log_level="INFO")

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def run(self):

setup(
name="diffusers",
version="0.21.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)
version="0.22.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="State-of-the-art diffusion in PyTorch and JAX.",
long_description=open("README.md", "r", encoding="utf-8").read(),
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion src/diffusers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.21.0.dev0"
__version__ = "0.22.0.dev0"

from typing import TYPE_CHECKING

Expand Down
14 changes: 1 addition & 13 deletions src/diffusers/models/attention_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,19 +477,7 @@ def get_attention_scores(self, query, key, attention_mask=None):

return attention_probs

def prepare_attention_mask(self, attention_mask, target_length, batch_size=None, out_dim=3):
if batch_size is None:
deprecate(
"batch_size=None",
"0.22.0",
(
"Not passing the `batch_size` parameter to `prepare_attention_mask` can lead to incorrect"
" attention mask preparation and is deprecated behavior. Please make sure to pass `batch_size` to"
" `prepare_attention_mask` when preparing the attention_mask."
),
)
batch_size = 1

def prepare_attention_mask(self, attention_mask, target_length, batch_size, out_dim=3):
head_size = self.heads
if attention_mask is None:
return attention_mask
Expand Down
29 changes: 0 additions & 29 deletions src/diffusers/pipeline_utils.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,15 @@ def __call__(
[`~pipelines.ImagePipelineOutput`] or `tuple`
"""
if not self._warn_has_been_called and version.parse(version.parse(__version__).base_version) < version.parse(
"0.22.0.dev0"
"0.23.0.dev0"
):
logger.warn(
"Please note that the expected format of `mask_image` has recently been changed. "
"Before diffusers == 0.19.0, Kandinsky Inpainting pipelines repainted black pixels and preserved black pixels. "
"As of diffusers==0.19.0 this behavior has been inverted. Now white pixels are repainted and black pixels are preserved. "
"This way, Kandinsky's masking behavior is aligned with Stable Diffusion. "
"THIS means that you HAVE to invert the input mask to have the same behavior as before as explained in https://github.com/huggingface/diffusers/pull/4207. "
"This warning will be surpressed after the first inference call and will be removed in diffusers>0.22.0"
"This warning will be surpressed after the first inference call and will be removed in diffusers>0.23.0"
)
self._warn_has_been_called = True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,15 @@ def __call__(
[`~pipelines.ImagePipelineOutput`] or `tuple`
"""
if not self._warn_has_been_called and version.parse(version.parse(__version__).base_version) < version.parse(
"0.22.0.dev0"
"0.23.0.dev0"
):
logger.warn(
"Please note that the expected format of `mask_image` has recently been changed. "
"Before diffusers == 0.19.0, Kandinsky Inpainting pipelines repainted black pixels and preserved black pixels. "
"As of diffusers==0.19.0 this behavior has been inverted. Now white pixels are repainted and black pixels are preserved. "
"This way, Kandinsky's masking behavior is aligned with Stable Diffusion. "
"THIS means that you HAVE to invert the input mask to have the same behavior as before as explained in https://github.com/huggingface/diffusers/pull/4207. "
"This warning will be surpressed after the first inference call and will be removed in diffusers>0.22.0"
"This warning will be surpressed after the first inference call and will be removed in diffusers>0.23.0"
)
self._warn_has_been_called = True

Expand Down
4 changes: 2 additions & 2 deletions src/diffusers/pipelines/pipeline_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1471,10 +1471,10 @@ def download(cls, pretrained_model_name, **kwargs) -> Union[str, os.PathLike]:
deprecation_message = (
f"You are trying to load the model files of the `variant={variant}`, but no such modeling files are available."
f"The default model files: {model_filenames} will be loaded instead. Make sure to not load from `variant={variant}`"
"if such variant modeling files are not available. Doing so will lead to an error in v0.22.0 as defaulting to non-variant"
"if such variant modeling files are not available. Doing so will lead to an error in v0.24.0 as defaulting to non-variant"
"modeling files is deprecated."
)
deprecate("no variant default", "0.22.0", deprecation_message, standard_warn=False)
deprecate("no variant default", "0.24.0", deprecation_message, standard_warn=False)

# remove ignored filenames
model_filenames = set(model_filenames) - set(ignore_filenames)
Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion tests/fixtures/custom_pipeline/what_ever.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import torch

from diffusers.pipeline_utils import DiffusionPipeline, ImagePipelineOutput
from diffusers.pipelines.pipeline_utils import DiffusionPipeline, ImagePipelineOutput


class CustomLocalPipeline(DiffusionPipeline):
Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/controlnet/test_controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
StableDiffusionControlNetPipeline,
UNet2DConditionModel,
)
from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet import MultiControlNetModel
from diffusers.pipelines.controlnet.pipeline_controlnet import MultiControlNetModel
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import (
enable_full_determinism,
Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/controlnet/test_controlnet_img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
StableDiffusionControlNetImg2ImgPipeline,
UNet2DConditionModel,
)
from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet import MultiControlNetModel
from diffusers.pipelines.controlnet.pipeline_controlnet import MultiControlNetModel
from diffusers.utils import load_image
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import (
Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/controlnet/test_controlnet_inpaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
StableDiffusionControlNetInpaintPipeline,
UNet2DConditionModel,
)
from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet import MultiControlNetModel
from diffusers.pipelines.controlnet.pipeline_controlnet import MultiControlNetModel
from diffusers.utils import load_image
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import (
Expand Down
2 changes: 1 addition & 1 deletion tests/pipelines/controlnet/test_controlnet_sdxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
StableDiffusionXLControlNetPipeline,
UNet2DConditionModel,
)
from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet import MultiControlNetModel
from diffusers.pipelines.controlnet.pipeline_controlnet import MultiControlNetModel
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import enable_full_determinism, load_image, require_torch_gpu, slow, torch_device
from diffusers.utils.torch_utils import randn_tensor
Expand Down

0 comments on commit 342c5c0

Please sign in to comment.