Unverified Commit 6a05b274 authored by M. Tolga Cangöz's avatar M. Tolga Cangöz Committed by GitHub
Browse files

Fix Typos (#7325)

* Fix PyTorch's convention for inplace functions

* Fix import structure in __init__.py and update config loading logic in test_config.py

* Update configuration access

* Fix typos

* Trim trailing white spaces

* Fix typo in logger name

* Revert "Fix PyTorch's convention for inplace functions"

This reverts commit f65dc4afcb57ceb43d5d06389229d47bafb10d2d.

* Fix typo in step_index property description

* Revert "Update configuration access"

This reverts commit 8d44e870b8c1ad08802e3e904c34baeca1b598f8.

* Revert "Fix import structure in __init__.py and update config loading logic in test_config.py"

This reverts commit 2ad5e8bca25aede3b912da22bd57285b598fe171.

* Fix typos

* Fix typos

* Fix typos

* Fix a typo: tranform -> transform
parent 98d46a3f
...@@ -440,7 +440,7 @@ def betas_for_alpha_bar( ...@@ -440,7 +440,7 @@ def betas_for_alpha_bar(
return math.exp(t * -12.0) return math.exp(t * -12.0)
else: else:
raise ValueError(f"Unsupported alpha_tranform_type: {alpha_transform_type}") raise ValueError(f"Unsupported alpha_transform_type: {alpha_transform_type}")
betas = [] betas = []
for i in range(num_diffusion_timesteps): for i in range(num_diffusion_timesteps):
......
...@@ -348,7 +348,7 @@ def betas_for_alpha_bar( ...@@ -348,7 +348,7 @@ def betas_for_alpha_bar(
return math.exp(t * -12.0) return math.exp(t * -12.0)
else: else:
raise ValueError(f"Unsupported alpha_tranform_type: {alpha_transform_type}") raise ValueError(f"Unsupported alpha_transform_type: {alpha_transform_type}")
betas = [] betas = []
for i in range(num_diffusion_timesteps): for i in range(num_diffusion_timesteps):
......
...@@ -206,7 +206,7 @@ def prepare_mask_and_masked_image(image, mask, height, width, return_image: bool ...@@ -206,7 +206,7 @@ def prepare_mask_and_masked_image(image, mask, height, width, return_image: bool
dimensions: ``batch x channels x height x width``. dimensions: ``batch x channels x height x width``.
""" """
# checkpoint. TOD(Yiyi) - need to clean this up later # checkpoint. #TODO(Yiyi) - need to clean this up later
if image is None: if image is None:
raise ValueError("`image` input cannot be undefined.") raise ValueError("`image` input cannot be undefined.")
...@@ -277,7 +277,7 @@ def prepare_mask_and_masked_image(image, mask, height, width, return_image: bool ...@@ -277,7 +277,7 @@ def prepare_mask_and_masked_image(image, mask, height, width, return_image: bool
# images are in latent space and thus can't # images are in latent space and thus can't
# be masked set masked_image to None # be masked set masked_image to None
# we assume that the checkpoint is not an inpainting # we assume that the checkpoint is not an inpainting
# checkpoint. TOD(Yiyi) - need to clean this up later # checkpoint. #TODO(Yiyi) - need to clean this up later
masked_image = None masked_image = None
else: else:
masked_image = image * (mask < 0.5) masked_image = image * (mask < 0.5)
......
...@@ -81,7 +81,7 @@ def betas_for_alpha_bar( ...@@ -81,7 +81,7 @@ def betas_for_alpha_bar(
return math.exp(t * -12.0) return math.exp(t * -12.0)
else: else:
raise ValueError(f"Unsupported alpha_tranform_type: {alpha_transform_type}") raise ValueError(f"Unsupported alpha_transform_type: {alpha_transform_type}")
betas = [] betas = []
for i in range(num_diffusion_timesteps): for i in range(num_diffusion_timesteps):
......
...@@ -424,7 +424,7 @@ class Attention(nn.Module): ...@@ -424,7 +424,7 @@ class Attention(nn.Module):
# If doesn't apply LoRA do `add_k_proj` or `add_v_proj` # If doesn't apply LoRA do `add_k_proj` or `add_v_proj`
is_lora_activated.pop("add_k_proj", None) is_lora_activated.pop("add_k_proj", None)
is_lora_activated.pop("add_v_proj", None) is_lora_activated.pop("add_v_proj", None)
# 2. else it is not posssible that only some layers have LoRA activated # 2. else it is not possible that only some layers have LoRA activated
if not all(is_lora_activated.values()): if not all(is_lora_activated.values()):
raise ValueError( raise ValueError(
f"Make sure that either all layers or no layers have LoRA activated, but have {is_lora_activated}" f"Make sure that either all layers or no layers have LoRA activated, but have {is_lora_activated}"
...@@ -2098,7 +2098,7 @@ class LoRAAttnAddedKVProcessor(nn.Module): ...@@ -2098,7 +2098,7 @@ class LoRAAttnAddedKVProcessor(nn.Module):
class IPAdapterAttnProcessor(nn.Module): class IPAdapterAttnProcessor(nn.Module):
r""" r"""
Attention processor for Multiple IP-Adapater. Attention processor for Multiple IP-Adapters.
Args: Args:
hidden_size (`int`): hidden_size (`int`):
...@@ -2152,8 +2152,8 @@ class IPAdapterAttnProcessor(nn.Module): ...@@ -2152,8 +2152,8 @@ class IPAdapterAttnProcessor(nn.Module):
encoder_hidden_states, ip_hidden_states = encoder_hidden_states encoder_hidden_states, ip_hidden_states = encoder_hidden_states
else: else:
deprecation_message = ( deprecation_message = (
"You have passed a tensor as `encoder_hidden_states`.This is deprecated and will be removed in a future release." "You have passed a tensor as `encoder_hidden_states`. This is deprecated and will be removed in a future release."
" Please make sure to update your script to pass `encoder_hidden_states` as a tuple to supress this warning." " Please make sure to update your script to pass `encoder_hidden_states` as a tuple to suppress this warning."
) )
deprecate("encoder_hidden_states not a tuple", "1.0.0", deprecation_message, standard_warn=False) deprecate("encoder_hidden_states not a tuple", "1.0.0", deprecation_message, standard_warn=False)
end_pos = encoder_hidden_states.shape[1] - self.num_tokens[0] end_pos = encoder_hidden_states.shape[1] - self.num_tokens[0]
...@@ -2253,7 +2253,7 @@ class IPAdapterAttnProcessor(nn.Module): ...@@ -2253,7 +2253,7 @@ class IPAdapterAttnProcessor(nn.Module):
class IPAdapterAttnProcessor2_0(torch.nn.Module): class IPAdapterAttnProcessor2_0(torch.nn.Module):
r""" r"""
Attention processor for IP-Adapater for PyTorch 2.0. Attention processor for IP-Adapter for PyTorch 2.0.
Args: Args:
hidden_size (`int`): hidden_size (`int`):
...@@ -2312,8 +2312,8 @@ class IPAdapterAttnProcessor2_0(torch.nn.Module): ...@@ -2312,8 +2312,8 @@ class IPAdapterAttnProcessor2_0(torch.nn.Module):
encoder_hidden_states, ip_hidden_states = encoder_hidden_states encoder_hidden_states, ip_hidden_states = encoder_hidden_states
else: else:
deprecation_message = ( deprecation_message = (
"You have passed a tensor as `encoder_hidden_states`.This is deprecated and will be removed in a future release." "You have passed a tensor as `encoder_hidden_states`. This is deprecated and will be removed in a future release."
" Please make sure to update your script to pass `encoder_hidden_states` as a tuple to supress this warning." " Please make sure to update your script to pass `encoder_hidden_states` as a tuple to suppress this warning."
) )
deprecate("encoder_hidden_states not a tuple", "1.0.0", deprecation_message, standard_warn=False) deprecate("encoder_hidden_states not a tuple", "1.0.0", deprecation_message, standard_warn=False)
end_pos = encoder_hidden_states.shape[1] - self.num_tokens[0] end_pos = encoder_hidden_states.shape[1] - self.num_tokens[0]
......
...@@ -281,7 +281,7 @@ class ControlNetModel(ModelMixin, ConfigMixin, FromOriginalControlNetMixin): ...@@ -281,7 +281,7 @@ class ControlNetModel(ModelMixin, ConfigMixin, FromOriginalControlNetMixin):
elif encoder_hid_dim_type == "text_image_proj": elif encoder_hid_dim_type == "text_image_proj":
# image_embed_dim DOESN'T have to be `cross_attention_dim`. To not clutter the __init__ too much # image_embed_dim DOESN'T have to be `cross_attention_dim`. To not clutter the __init__ too much
# they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use # they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use
# case when `addition_embed_type == "text_image_proj"` (Kadinsky 2.1)` # case when `addition_embed_type == "text_image_proj"` (Kandinsky 2.1)`
self.encoder_hid_proj = TextImageProjection( self.encoder_hid_proj = TextImageProjection(
text_embed_dim=encoder_hid_dim, text_embed_dim=encoder_hid_dim,
image_embed_dim=cross_attention_dim, image_embed_dim=cross_attention_dim,
...@@ -330,7 +330,7 @@ class ControlNetModel(ModelMixin, ConfigMixin, FromOriginalControlNetMixin): ...@@ -330,7 +330,7 @@ class ControlNetModel(ModelMixin, ConfigMixin, FromOriginalControlNetMixin):
elif addition_embed_type == "text_image": elif addition_embed_type == "text_image":
# text_embed_dim and image_embed_dim DON'T have to be `cross_attention_dim`. To not clutter the __init__ too much # text_embed_dim and image_embed_dim DON'T have to be `cross_attention_dim`. To not clutter the __init__ too much
# they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use # they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use
# case when `addition_embed_type == "text_image"` (Kadinsky 2.1)` # case when `addition_embed_type == "text_image"` (Kandinsky 2.1)`
self.add_embedding = TextImageTimeEmbedding( self.add_embedding = TextImageTimeEmbedding(
text_embed_dim=cross_attention_dim, image_embed_dim=cross_attention_dim, time_embed_dim=time_embed_dim text_embed_dim=cross_attention_dim, image_embed_dim=cross_attention_dim, time_embed_dim=time_embed_dim
) )
......
...@@ -20,15 +20,15 @@ from .transformers.transformer_temporal import ( ...@@ -20,15 +20,15 @@ from .transformers.transformer_temporal import (
class TransformerTemporalModelOutput(TransformerTemporalModelOutput): class TransformerTemporalModelOutput(TransformerTemporalModelOutput):
deprecation_message = "Importing `TransformerTemporalModelOutput` from `diffusers.models.transformer_temporal` is deprecated and this will be removed in a future version. Please use `from diffusers.models.transformers.tranformer_temporal import TransformerTemporalModelOutput`, instead." deprecation_message = "Importing `TransformerTemporalModelOutput` from `diffusers.models.transformer_temporal` is deprecated and this will be removed in a future version. Please use `from diffusers.models.transformers.transformer_temporal import TransformerTemporalModelOutput`, instead."
deprecate("TransformerTemporalModelOutput", "0.29", deprecation_message) deprecate("TransformerTemporalModelOutput", "0.29", deprecation_message)
class TransformerTemporalModel(TransformerTemporalModel): class TransformerTemporalModel(TransformerTemporalModel):
deprecation_message = "Importing `TransformerTemporalModel` from `diffusers.models.transformer_temporal` is deprecated and this will be removed in a future version. Please use `from diffusers.models.transformers.tranformer_temporal import TransformerTemporalModel`, instead." deprecation_message = "Importing `TransformerTemporalModel` from `diffusers.models.transformer_temporal` is deprecated and this will be removed in a future version. Please use `from diffusers.models.transformers.transformer_temporal import TransformerTemporalModel`, instead."
deprecate("TransformerTemporalModel", "0.29", deprecation_message) deprecate("TransformerTemporalModel", "0.29", deprecation_message)
class TransformerSpatioTemporalModel(TransformerSpatioTemporalModel): class TransformerSpatioTemporalModel(TransformerSpatioTemporalModel):
deprecation_message = "Importing `TransformerSpatioTemporalModel` from `diffusers.models.transformer_temporal` is deprecated and this will be removed in a future version. Please use `from diffusers.models.transformers.tranformer_temporal import TransformerSpatioTemporalModel`, instead." deprecation_message = "Importing `TransformerSpatioTemporalModel` from `diffusers.models.transformer_temporal` is deprecated and this will be removed in a future version. Please use `from diffusers.models.transformers.transformer_temporal import TransformerSpatioTemporalModel`, instead."
deprecate("TransformerTemporalModelOutput", "0.29", deprecation_message) deprecate("TransformerTemporalModelOutput", "0.29", deprecation_message)
...@@ -129,7 +129,7 @@ class Transformer2DModel(ModelMixin, ConfigMixin): ...@@ -129,7 +129,7 @@ class Transformer2DModel(ModelMixin, ConfigMixin):
if norm_type == "layer_norm" and num_embeds_ada_norm is not None: if norm_type == "layer_norm" and num_embeds_ada_norm is not None:
deprecation_message = ( deprecation_message = (
f"The configuration file of this model: {self.__class__} is outdated. `norm_type` is either not set or" f"The configuration file of this model: {self.__class__} is outdated. `norm_type` is either not set or"
" incorrectly set to `'layer_norm'`.Make sure to set `norm_type` to `'ada_norm'` in the config." " incorrectly set to `'layer_norm'`. Make sure to set `norm_type` to `'ada_norm'` in the config."
" Please make sure to update the config accordingly as leaving `norm_type` might led to incorrect" " Please make sure to update the config accordingly as leaving `norm_type` might led to incorrect"
" results in future versions. If you have downloaded this checkpoint from the Hugging Face Hub, it" " results in future versions. If you have downloaded this checkpoint from the Hugging Face Hub, it"
" would be very nice if you could open a Pull request for the `transformer/config.json` file" " would be very nice if you could open a Pull request for the `transformer/config.json` file"
......
...@@ -580,7 +580,7 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin, ...@@ -580,7 +580,7 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin,
elif encoder_hid_dim_type == "text_image_proj": elif encoder_hid_dim_type == "text_image_proj":
# image_embed_dim DOESN'T have to be `cross_attention_dim`. To not clutter the __init__ too much # image_embed_dim DOESN'T have to be `cross_attention_dim`. To not clutter the __init__ too much
# they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use # they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use
# case when `addition_embed_type == "text_image_proj"` (Kadinsky 2.1)` # case when `addition_embed_type == "text_image_proj"` (Kandinsky 2.1)`
self.encoder_hid_proj = TextImageProjection( self.encoder_hid_proj = TextImageProjection(
text_embed_dim=encoder_hid_dim, text_embed_dim=encoder_hid_dim,
image_embed_dim=cross_attention_dim, image_embed_dim=cross_attention_dim,
...@@ -660,7 +660,7 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin, ...@@ -660,7 +660,7 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin,
elif addition_embed_type == "text_image": elif addition_embed_type == "text_image":
# text_embed_dim and image_embed_dim DON'T have to be `cross_attention_dim`. To not clutter the __init__ too much # text_embed_dim and image_embed_dim DON'T have to be `cross_attention_dim`. To not clutter the __init__ too much
# they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use # they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use
# case when `addition_embed_type == "text_image"` (Kadinsky 2.1)` # case when `addition_embed_type == "text_image"` (Kandinsky 2.1)`
self.add_embedding = TextImageTimeEmbedding( self.add_embedding = TextImageTimeEmbedding(
text_embed_dim=cross_attention_dim, image_embed_dim=cross_attention_dim, time_embed_dim=time_embed_dim text_embed_dim=cross_attention_dim, image_embed_dim=cross_attention_dim, time_embed_dim=time_embed_dim
) )
...@@ -1010,7 +1010,7 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin, ...@@ -1010,7 +1010,7 @@ class UNet2DConditionModel(ModelMixin, ConfigMixin, UNet2DConditionLoadersMixin,
if self.encoder_hid_proj is not None and self.config.encoder_hid_dim_type == "text_proj": if self.encoder_hid_proj is not None and self.config.encoder_hid_dim_type == "text_proj":
encoder_hidden_states = self.encoder_hid_proj(encoder_hidden_states) encoder_hidden_states = self.encoder_hid_proj(encoder_hidden_states)
elif self.encoder_hid_proj is not None and self.config.encoder_hid_dim_type == "text_image_proj": elif self.encoder_hid_proj is not None and self.config.encoder_hid_dim_type == "text_image_proj":
# Kadinsky 2.1 - style # Kandinsky 2.1 - style
if "image_embeds" not in added_cond_kwargs: if "image_embeds" not in added_cond_kwargs:
raise ValueError( raise ValueError(
f"{self.__class__} has the config param `encoder_hid_dim_type` set to 'text_image_proj' which requires the keyword argument `image_embeds` to be passed in `added_conditions`" f"{self.__class__} has the config param `encoder_hid_dim_type` set to 'text_image_proj' which requires the keyword argument `image_embeds` to be passed in `added_conditions`"
......
...@@ -1171,7 +1171,7 @@ class StableDiffusionControlNetInpaintPipeline( ...@@ -1171,7 +1171,7 @@ class StableDiffusionControlNetInpaintPipeline(
`padding_mask_crop` is not `None`, it will first find a rectangular region with the same aspect ration of the image and `padding_mask_crop` is not `None`, it will first find a rectangular region with the same aspect ration of the image and
contains all masked area, and then expand that area based on `padding_mask_crop`. The image and mask_image will then be cropped based on contains all masked area, and then expand that area based on `padding_mask_crop`. The image and mask_image will then be cropped based on
the expanded area before resizing to the original image size for inpainting. This is useful when the masked area is small while the image is large the expanded area before resizing to the original image size for inpainting. This is useful when the masked area is small while the image is large
and contain information inreleant for inpainging, such as background. and contain information irrelevant for inpainting, such as background.
strength (`float`, *optional*, defaults to 1.0): strength (`float`, *optional*, defaults to 1.0):
Indicates extent to transform the reference `image`. Must be between 0 and 1. `image` is used as a Indicates extent to transform the reference `image`. Must be between 0 and 1. `image` is used as a
starting point and more noise is added the higher the `strength`. The number of denoising steps depends starting point and more noise is added the higher the `strength`. The number of denoising steps depends
......
...@@ -1198,7 +1198,7 @@ class StableDiffusionXLControlNetInpaintPipeline( ...@@ -1198,7 +1198,7 @@ class StableDiffusionXLControlNetInpaintPipeline(
`padding_mask_crop` is not `None`, it will first find a rectangular region with the same aspect ration of the image and `padding_mask_crop` is not `None`, it will first find a rectangular region with the same aspect ration of the image and
contains all masked area, and then expand that area based on `padding_mask_crop`. The image and mask_image will then be cropped based on contains all masked area, and then expand that area based on `padding_mask_crop`. The image and mask_image will then be cropped based on
the expanded area before resizing to the original image size for inpainting. This is useful when the masked area is small while the image is large the expanded area before resizing to the original image size for inpainting. This is useful when the masked area is small while the image is large
and contain information inreleant for inpainging, such as background. and contain information irrelevant for inpainting, such as background.
strength (`float`, *optional*, defaults to 0.9999): strength (`float`, *optional*, defaults to 0.9999):
Conceptually, indicates how much to transform the masked portion of the reference `image`. Must be Conceptually, indicates how much to transform the masked portion of the reference `image`. Must be
between 0 and 1. `image` will be used as a starting point, adding more noise to it the larger the between 0 and 1. `image` will be used as a starting point, adding more noise to it the larger the
......
...@@ -531,7 +531,7 @@ class UNetFlatConditionModel(ModelMixin, ConfigMixin): ...@@ -531,7 +531,7 @@ class UNetFlatConditionModel(ModelMixin, ConfigMixin):
elif encoder_hid_dim_type == "text_image_proj": elif encoder_hid_dim_type == "text_image_proj":
# image_embed_dim DOESN'T have to be `cross_attention_dim`. To not clutter the __init__ too much # image_embed_dim DOESN'T have to be `cross_attention_dim`. To not clutter the __init__ too much
# they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use # they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use
# case when `addition_embed_type == "text_image_proj"` (Kadinsky 2.1)` # case when `addition_embed_type == "text_image_proj"` (Kandinsky 2.1)`
self.encoder_hid_proj = TextImageProjection( self.encoder_hid_proj = TextImageProjection(
text_embed_dim=encoder_hid_dim, text_embed_dim=encoder_hid_dim,
image_embed_dim=cross_attention_dim, image_embed_dim=cross_attention_dim,
...@@ -591,7 +591,7 @@ class UNetFlatConditionModel(ModelMixin, ConfigMixin): ...@@ -591,7 +591,7 @@ class UNetFlatConditionModel(ModelMixin, ConfigMixin):
elif addition_embed_type == "text_image": elif addition_embed_type == "text_image":
# text_embed_dim and image_embed_dim DON'T have to be `cross_attention_dim`. To not clutter the __init__ too much # text_embed_dim and image_embed_dim DON'T have to be `cross_attention_dim`. To not clutter the __init__ too much
# they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use # they are set to `cross_attention_dim` here as this is exactly the required dimension for the currently only use
# case when `addition_embed_type == "text_image"` (Kadinsky 2.1)` # case when `addition_embed_type == "text_image"` (Kandinsky 2.1)`
self.add_embedding = TextImageTimeEmbedding( self.add_embedding = TextImageTimeEmbedding(
text_embed_dim=cross_attention_dim, image_embed_dim=cross_attention_dim, time_embed_dim=time_embed_dim text_embed_dim=cross_attention_dim, image_embed_dim=cross_attention_dim, time_embed_dim=time_embed_dim
) )
...@@ -1257,7 +1257,7 @@ class UNetFlatConditionModel(ModelMixin, ConfigMixin): ...@@ -1257,7 +1257,7 @@ class UNetFlatConditionModel(ModelMixin, ConfigMixin):
if self.encoder_hid_proj is not None and self.config.encoder_hid_dim_type == "text_proj": if self.encoder_hid_proj is not None and self.config.encoder_hid_dim_type == "text_proj":
encoder_hidden_states = self.encoder_hid_proj(encoder_hidden_states) encoder_hidden_states = self.encoder_hid_proj(encoder_hidden_states)
elif self.encoder_hid_proj is not None and self.config.encoder_hid_dim_type == "text_image_proj": elif self.encoder_hid_proj is not None and self.config.encoder_hid_dim_type == "text_image_proj":
# Kadinsky 2.1 - style # Kandinsky 2.1 - style
if "image_embeds" not in added_cond_kwargs: if "image_embeds" not in added_cond_kwargs:
raise ValueError( raise ValueError(
f"{self.__class__} has the config param `encoder_hid_dim_type` set to 'text_image_proj' which requires the keyword argument `image_embeds` to be passed in `added_conditions`" f"{self.__class__} has the config param `encoder_hid_dim_type` set to 'text_image_proj' which requires the keyword argument `image_embeds` to be passed in `added_conditions`"
......
...@@ -1026,7 +1026,7 @@ class StableDiffusionInpaintPipeline( ...@@ -1026,7 +1026,7 @@ class StableDiffusionInpaintPipeline(
`padding_mask_crop` is not `None`, it will first find a rectangular region with the same aspect ration of the image and `padding_mask_crop` is not `None`, it will first find a rectangular region with the same aspect ration of the image and
contains all masked area, and then expand that area based on `padding_mask_crop`. The image and mask_image will then be cropped based on contains all masked area, and then expand that area based on `padding_mask_crop`. The image and mask_image will then be cropped based on
the expanded area before resizing to the original image size for inpainting. This is useful when the masked area is small while the image is large the expanded area before resizing to the original image size for inpainting. This is useful when the masked area is small while the image is large
and contain information inreleant for inpainging, such as background. and contain information irrelevant for inpainting, such as background.
strength (`float`, *optional*, defaults to 1.0): strength (`float`, *optional*, defaults to 1.0):
Indicates extent to transform the reference `image`. Must be between 0 and 1. `image` is used as a Indicates extent to transform the reference `image`. Must be between 0 and 1. `image` is used as a
starting point and more noise is added the higher the `strength`. The number of denoising steps depends starting point and more noise is added the higher the `strength`. The number of denoising steps depends
......
...@@ -1259,7 +1259,7 @@ class StableDiffusionXLInpaintPipeline( ...@@ -1259,7 +1259,7 @@ class StableDiffusionXLInpaintPipeline(
`padding_mask_crop` is not `None`, it will first find a rectangular region with the same aspect ration of the image and `padding_mask_crop` is not `None`, it will first find a rectangular region with the same aspect ration of the image and
contains all masked area, and then expand that area based on `padding_mask_crop`. The image and mask_image will then be cropped based on contains all masked area, and then expand that area based on `padding_mask_crop`. The image and mask_image will then be cropped based on
the expanded area before resizing to the original image size for inpainting. This is useful when the masked area is small while the image is large the expanded area before resizing to the original image size for inpainting. This is useful when the masked area is small while the image is large
and contain information inreleant for inpainging, such as background. and contain information irrelevant for inpainting, such as background.
strength (`float`, *optional*, defaults to 0.9999): strength (`float`, *optional*, defaults to 0.9999):
Conceptually, indicates how much to transform the masked portion of the reference `image`. Must be Conceptually, indicates how much to transform the masked portion of the reference `image`. Must be
between 0 and 1. `image` will be used as a starting point, adding more noise to it the larger the between 0 and 1. `image` will be used as a starting point, adding more noise to it the larger the
......
...@@ -45,7 +45,7 @@ def betas_for_alpha_bar( ...@@ -45,7 +45,7 @@ def betas_for_alpha_bar(
return math.exp(t * -12.0) return math.exp(t * -12.0)
else: else:
raise ValueError(f"Unsupported alpha_tranform_type: {alpha_transform_type}") raise ValueError(f"Unsupported alpha_transform_type: {alpha_transform_type}")
betas = [] betas = []
for i in range(num_diffusion_timesteps): for i in range(num_diffusion_timesteps):
......
...@@ -104,7 +104,7 @@ class CMStochasticIterativeScheduler(SchedulerMixin, ConfigMixin): ...@@ -104,7 +104,7 @@ class CMStochasticIterativeScheduler(SchedulerMixin, ConfigMixin):
@property @property
def step_index(self): def step_index(self):
""" """
The index counter for current timestep. It will increae 1 after each scheduler step. The index counter for current timestep. It will increase 1 after each scheduler step.
""" """
return self._step_index return self._step_index
......
...@@ -82,7 +82,7 @@ def betas_for_alpha_bar( ...@@ -82,7 +82,7 @@ def betas_for_alpha_bar(
return math.exp(t * -12.0) return math.exp(t * -12.0)
else: else:
raise ValueError(f"Unsupported alpha_tranform_type: {alpha_transform_type}") raise ValueError(f"Unsupported alpha_transform_type: {alpha_transform_type}")
betas = [] betas = []
for i in range(num_diffusion_timesteps): for i in range(num_diffusion_timesteps):
......
...@@ -80,7 +80,7 @@ def betas_for_alpha_bar( ...@@ -80,7 +80,7 @@ def betas_for_alpha_bar(
return math.exp(t * -12.0) return math.exp(t * -12.0)
else: else:
raise ValueError(f"Unsupported alpha_tranform_type: {alpha_transform_type}") raise ValueError(f"Unsupported alpha_transform_type: {alpha_transform_type}")
betas = [] betas = []
for i in range(num_diffusion_timesteps): for i in range(num_diffusion_timesteps):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment