Buckets:

hf-doc-build/doc-dev / diffusers /pr_12595 /en /api /models /autoencoderkl_qwenimage.md
rtrm's picture
|
download
raw
8.65 kB

AutoencoderKLQwenImage

The model can be loaded with the following code snippet.

from diffusers import AutoencoderKLQwenImage

vae = AutoencoderKLQwenImage.from_pretrained("Qwen/QwenImage-20B", subfolder="vae")

AutoencoderKLQwenImage[[diffusers.AutoencoderKLQwenImage]]

class diffusers.AutoencoderKLQwenImagediffusers.AutoencoderKLQwenImagehttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L666[{"name": "base_dim", "val": ": int = 96"}, {"name": "z_dim", "val": ": int = 16"}, {"name": "dim_mult", "val": ": typing.Tuple[int] = [1, 2, 4, 4]"}, {"name": "num_res_blocks", "val": ": int = 2"}, {"name": "attn_scales", "val": ": typing.List[float] = []"}, {"name": "temperal_downsample", "val": ": typing.List[bool] = [False, True, True]"}, {"name": "dropout", "val": ": float = 0.0"}, {"name": "latents_mean", "val": ": typing.List[float] = [-0.7571, -0.7089, -0.9113, 0.1075, -0.1745, 0.9653, -0.1517, 1.5508, 0.4134, -0.0715, 0.5517, -0.3632, -0.1922, -0.9497, 0.2503, -0.2921]"}, {"name": "latents_std", "val": ": typing.List[float] = [2.8184, 1.4541, 2.3275, 2.6558, 1.2196, 1.7708, 2.6052, 2.0743, 3.2687, 2.1526, 2.8652, 1.5579, 1.6382, 1.1253, 2.8251, 1.916]"}]

A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos.

This model inherits from ModelMixin. Check the superclass documentation for it's generic methods implemented for all models (such as downloading or saving).

wrapperdiffusers.AutoencoderKLQwenImage.decodehttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/utils/accelerate_utils.py#L43[{"name": "*args", "val": ""}, {"name": "**kwargs", "val": ""}]

wrapperdiffusers.AutoencoderKLQwenImage.encodehttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/utils/accelerate_utils.py#L43[{"name": "*args", "val": ""}, {"name": "**kwargs", "val": ""}]

enable_tilingdiffusers.AutoencoderKLQwenImage.enable_tilinghttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L736[{"name": "tile_sample_min_height", "val": ": typing.Optional[int] = None"}, {"name": "tile_sample_min_width", "val": ": typing.Optional[int] = None"}, {"name": "tile_sample_stride_height", "val": ": typing.Optional[float] = None"}, {"name": "tile_sample_stride_width", "val": ": typing.Optional[float] = None"}]- tile_sample_min_height (int, optional) -- The minimum height required for a sample to be separated into tiles across the height dimension.

  • tile_sample_min_width (int, optional) -- The minimum width required for a sample to be separated into tiles across the width dimension.
  • tile_sample_stride_height (int, optional) -- The minimum amount of overlap between two consecutive vertical tiles. This is to ensure that there are no tiling artifacts produced across the height dimension.
  • tile_sample_stride_width (int, optional) -- The stride between two consecutive horizontal tiles. This is to ensure that there are no tiling artifacts produced across the width dimension.0

Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow processing larger images.

forwarddiffusers.AutoencoderKLQwenImage.forwardhttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L1028[{"name": "sample", "val": ": Tensor"}, {"name": "sample_posterior", "val": ": bool = False"}, {"name": "return_dict", "val": ": bool = True"}, {"name": "generator", "val": ": typing.Optional[torch._C.Generator] = None"}]- sample (torch.Tensor) -- Input sample.

  • return_dict (bool, optional, defaults to True) -- Whether or not to return a DecoderOutput instead of a plain tuple.0

tiled_decodediffusers.AutoencoderKLQwenImage.tiled_decodehttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L965[{"name": "z", "val": ": Tensor"}, {"name": "return_dict", "val": ": bool = True"}]- z (torch.Tensor) -- Input batch of latent vectors.

  • return_dict (bool, optional, defaults to True) -- Whether or not to return a ~models.vae.DecoderOutput instead of a plain tuple.0~models.vae.DecoderOutput or tupleIf return_dict is True, a ~models.vae.DecoderOutput is returned, otherwise a plain tuple is returned.

Decode a batch of images using a tiled decoder.

tiled_encodediffusers.AutoencoderKLQwenImage.tiled_encodehttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/models/autoencoders/autoencoder_kl_qwenimage.py#L899[{"name": "x", "val": ": Tensor"}]- x (torch.Tensor) -- Input batch of videos.0torch.TensorThe latent representation of the encoded videos. Encode a batch of images using a tiled encoder.

AutoencoderKLOutput[[diffusers.models.modeling_outputs.AutoencoderKLOutput]]

class diffusers.models.modeling_outputs.AutoencoderKLOutputdiffusers.models.modeling_outputs.AutoencoderKLOutputhttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/models/modeling_outputs.py#L7[{"name": "latent_dist", "val": ": DiagonalGaussianDistribution"}]- latent_dist (DiagonalGaussianDistribution) -- Encoded outputs of Encoder represented as the mean and logvar of DiagonalGaussianDistribution. DiagonalGaussianDistribution allows for sampling latents from the distribution.0

Output of AutoencoderKL encoding method.

DecoderOutput[[diffusers.models.autoencoders.vae.DecoderOutput]]

class diffusers.models.autoencoders.vae.DecoderOutputdiffusers.models.autoencoders.vae.DecoderOutputhttps://github.com/huggingface/diffusers/blob/vr_12595/src/diffusers/models/autoencoders/vae.py#L47[{"name": "sample", "val": ": Tensor"}, {"name": "commit_loss", "val": ": typing.Optional[torch.FloatTensor] = None"}]- sample (torch.Tensor of shape (batch_size, num_channels, height, width)) -- The decoded output sample from the last layer of the model.0

Output of decoding method.

Xet Storage Details

Size:
8.65 kB
·
Xet hash:
df4c2388ea438083a515defc7fbdc69774e7bb5f4b57fe82620bebd8601a2ca6

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.