Diffusers documentation

Normalization layers

You are viewing v0.24.0 version. A newer version v0.32.2 is available.
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Normalization layers

Customized normalization layers for supporting various models in πŸ€— Diffusers.

AdaLayerNorm

class diffusers.models.normalization.AdaLayerNorm

< >

( embedding_dim: intnum_embeddings: int )

Parameters

  • embedding_dim (int) β€” The size of each embedding vector.
  • num_embeddings (int) β€” The size of the embeddings dictionary.

Norm layer modified to incorporate timestep embeddings.

AdaLayerNormZero

class diffusers.models.normalization.AdaLayerNormZero

< >

( embedding_dim: intnum_embeddings: int )

Parameters

  • embedding_dim (int) β€” The size of each embedding vector.
  • num_embeddings (int) β€” The size of the embeddings dictionary.

Norm layer adaptive layer norm zero (adaLN-Zero).

AdaLayerNormSingle

class diffusers.models.normalization.AdaLayerNormSingle

< >

( embedding_dim: intuse_additional_conditions: bool = False )

Parameters

  • embedding_dim (int) β€” The size of each embedding vector.
  • use_additional_conditions (bool) β€” To use additional conditions for normalization or not.

Norm layer adaptive layer norm single (adaLN-single).

As proposed in PixArt-Alpha (see: https://arxiv.org/abs/2310.00426; Section 2.3).

AdaGroupNorm

class diffusers.models.normalization.AdaGroupNorm

< >

( embedding_dim: intout_dim: intnum_groups: intact_fn: typing.Optional[str] = Noneeps: float = 1e-05 )

Parameters

  • embedding_dim (int) β€” The size of each embedding vector.
  • num_embeddings (int) β€” The size of the embeddings dictionary.
  • num_groups (int) β€” The number of groups to separate the channels into.
  • act_fn (str, optional, defaults to None) β€” The activation function to use.
  • eps (float, optional, defaults to 1e-5) β€” The epsilon value to use for numerical stability.

GroupNorm layer modified to incorporate timestep embeddings.