Buckets:
AutoencoderKLKVAEVideo
The 3D variational autoencoder (VAE) model with KL loss.
The model can be loaded with the following code snippet.
import torch
from diffusers import AutoencoderKLKVAEVideo
vae = AutoencoderKLKVAEVideo.from_pretrained("kandinskylab/KVAE-3D-1.0", subfolder="diffusers", torch_dtype=torch.float16)
AutoencoderKLKVAEVideo[[diffusers.AutoencoderKLKVAEVideo]]
diffusers.AutoencoderKLKVAEVideo[[diffusers.AutoencoderKLKVAEVideo]]
A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos. Used in KVAE.
This model inherits from ModelMixin. Check the superclass documentation for its generic methods implemented for all models (such as downloading or saving).
decodediffusers.AutoencoderKLKVAEVideo.decodehttps://github.com/huggingface/diffusers/blob/vr_13803/src/diffusers/models/autoencoders/autoencoder_kl_kvae_video.py#L915[{"name": "z", "val": ": Tensor"}, {"name": "return_dict", "val": ": bool = True"}]- z (torch.Tensor) -- Input batch of latent vectors with shape (B, C, T, H, W).
- return_dict (
bool, optional, defaults toTrue) -- Whether to return a~models.vae.DecoderOutputinstead of a plain tuple.0~models.vae.DecoderOutputortupleDecoded video.
Decode a batch of videos.
Parameters:
ch (int, optional, defaults to 128) : Base channel count.
ch_mult (Tuple[int], optional, defaults to (1, 2, 4, 8)) : Channel multipliers per level.
num_res_blocks (int, optional, defaults to 2) : Number of residual blocks per level.
in_channels (int, optional, defaults to 3) : Number of input channels.
out_ch (int, optional, defaults to 3) : Number of output channels.
z_channels (int, optional, defaults to 16) : Number of latent channels.
temporal_compress_times (int, optional, defaults to 4) : Temporal compression factor.
Returns:
~models.vae.DecoderOutput` or `tuple
Decoded video.
disable_slicing[[diffusers.AutoencoderKLKVAEVideo.disable_slicing]]
Disable sliced VAE decoding.
enable_slicing[[diffusers.AutoencoderKLKVAEVideo.enable_slicing]]
Enable sliced VAE decoding.
encode[[diffusers.AutoencoderKLKVAEVideo.encode]]
Encode a batch of videos into latents.
Parameters:
x (torch.Tensor) : Input batch of videos with shape (B, C, T, H, W).
return_dict (bool, optional, defaults to True) : Whether to return a ~models.autoencoder_kl.AutoencoderKLOutput instead of a plain tuple.
Returns:
The latent representations of the encoded videos.
forward[[diffusers.AutoencoderKLKVAEVideo.forward]]
Parameters:
sample (torch.Tensor) : Input sample.
sample_posterior (bool, optional, defaults to False) : Whether to sample from the posterior.
return_dict (bool, optional, defaults to True) : Whether or not to return a DecoderOutput instead of a plain tuple.
generator (torch.Generator, optional) : A torch.Generator to make sampling deterministic.
Xet Storage Details
- Size:
- 3.85 kB
- Xet hash:
- 2094138a2ba2d8136449bb8344f1e6a545a67766c04a5992dba9c5bfe60f3638
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.