Buckets:
AutoencoderKLHunyuanVideo
HunyuanVideoで使用されているKL損失付き3次元変分オートエンコーダ(VAE)モデルです。Tencentによって、HunyuanVideo: A Systematic Framework For Large Video Generative Modelsで紹介されました。
モデルは、以下のコードスニペットで読み込むことができます。
from diffusers import AutoencoderKLHunyuanVideo
vae = AutoencoderKLHunyuanVideo.from_pretrained("hunyuanvideo-community/HunyuanVideo", subfolder="vae", dtype=torch.float16)
AutoencoderKLHunyuanVideo[[diffusers.AutoencoderKLHunyuanVideo]]
diffusers.AutoencoderKLHunyuanVideo[[diffusers.AutoencoderKLHunyuanVideo]]
diffusers.AutoencoderKLHunyuanVideo(in_channels: int = 3, out_channels: int = 3, latent_channels: int = 16, down_block_types: tuple[str, ...] = ('HunyuanVideoDownBlock3D', 'HunyuanVideoDownBlock3D', 'HunyuanVideoDownBlock3D', 'HunyuanVideoDownBlock3D'), up_block_types: tuple[str, ...] = ('HunyuanVideoUpBlock3D', 'HunyuanVideoUpBlock3D', 'HunyuanVideoUpBlock3D', 'HunyuanVideoUpBlock3D'), block_out_channels: tuple[int] = (128, 256, 512, 512), layers_per_block: int = 2, act_fn: str = 'silu', norm_num_groups: int = 32, scaling_factor: float = 0.476986, spatial_compression_ratio: int = 8, temporal_compression_ratio: int = 4, mid_block_add_attention: bool = True)
KL損失を用いて動画を潜在変数にエンコードし、潜在表現を動画にデコードするためのVAEモデル。HunyuanVideoで導入されました。
このモデルは ModelMixin を継承しています。すべてのモデルに実装されている汎用的なメソッド(ダウンロードや保存など)については、スーパークラスのドキュメントを参照してください。
decode[[diffusers.AutoencoderKLHunyuanVideo.decode]]
decode(z: Tensor, return_dict: bool = True)
パラメータ:
z (torch.Tensor) : 潜在ベクトルの入力バッチ。
return_dict (bool、任意、デフォルトはTrue) : プレーンなタプルではなく~models.vae.DecoderOutputを返すかどうか。
戻り値: ~models.vae.DecoderOutput または tuple
return_dict が True の場合、~models.vae.DecoderOutput が返され、それ以外の場合は通常の tuple が返されます。
画像のバッチをデコードします。
enable_tiling[[diffusers.AutoencoderKLHunyuanVideo.enable_tiling]]
enable_tiling(tile_sample_min_height: int | None = None, tile_sample_min_width: int | None = None, tile_sample_min_num_frames: int | None = None, tile_sample_stride_height: float | None = None, tile_sample_stride_width: float | None = None, tile_sample_stride_num_frames: float | None = None)
パラメータ:
tile_sample_min_height (int, optional) : サンプルを高さ方向にタイル分割するために必要な最小高さ。
tile_sample_min_width (int, optional) : サンプルを幅方向にタイル分割するために必要な最小幅。
tile_sample_min_num_frames (int, 任意) : サンプルをフレーム次元に沿ってタイルに分割するために必要な最小フレーム数。
tile_sample_stride_height (int, 任意) : 2つの連続する垂直タイル間の最小オーバーラップ量です。これにより、高さ方向にタイルリングアーティファクトが発生しないことを保証します。
tile_sample_stride_width (int, 任意) : 連続する2つの水平タイル間のストライドです。これにより、幅方向にタイル化によるアーティファクトが発生しないことを保証します。
tile_sample_stride_num_frames (int, 任意) : 2つの連続するフレームタイル間のストライドです。これにより、フレーム次元にわたってタイル化アーティファクトが発生しないことを保証します。
タイル化VAEデコーディングを有効にします。このオプションを有効にすると、VAEは入力テンソルをタイルに分割し、デコーディングとエンコーディングを複数ステップで計算します。これにより、大量のメモリを節約し、より大きな画像の処理を可能にします。
encode[[diffusers.AutoencoderKLHunyuanVideo.encode]]
encode(x: Tensor, return_dict: bool = True)
パラメータ:
x (torch.Tensor) : 画像の入力バッチ。
return_dict (bool、任意、デフォルトはTrue) : プレーンなタプルではなく~models.autoencoder_kl.AutoencoderKLOutputを返すかどうか。
戻り値:
エンコードされた動画の潜在表現。return_dictがTrueの場合、~models.autoencoder_kl.AutoencoderKLOutputが返され、それ以外の場合は通常のtupleが返されます。
バッチの画像を潜在変数にエンコードします。
forward[[diffusers.AutoencoderKLHunyuanVideo.forward]]
forward(sample: Tensor, sample_posterior: bool = False, return_dict: bool = True, generator: typing.Optional[torch.Generator] = None)
パラメータ:
sample (torch.Tensor) : 入力サンプル。
sample_posterior (bool、任意、デフォルトはFalse) : 事後分布からサンプリングするかどうか。
return_dict (bool、任意、デフォルトはTrue) : プレーンなタプルではなくDecoderOutputを返すかどうか。
generator (torch.Generator, 任意) : サンプリングを決定論的にするための torch.Generator。
戻り値: ~models.vae.DecoderOutput または tuple
return_dict が True の場合、~models.vae.DecoderOutput が返され、それ以外の場合は通常の tuple が返されます。
tiled_decode[[diffusers.AutoencoderKLHunyuanVideo.tiled_decode]]
tiled_decode(z: Tensor, return_dict: bool = True)
パラメータ:
z (torch.Tensor) : 潜在ベクトルの入力バッチ。
return_dict (bool、任意、デフォルトはTrue) : プレーンなタプルではなく~models.vae.DecoderOutputを返すかどうか。
戻り値: ~models.vae.DecoderOutput または tuple
return_dict が True の場合、~models.vae.DecoderOutput が返され、それ以外の場合は通常の tuple が返されます。
タイル化されたデコーダーを使用して、画像のバッチをデコードします。
tiled_encode[[diffusers.AutoencoderKLHunyuanVideo.tiled_encode]]
tiled_encode(x: Tensor)
パラメータ:
x (torch.Tensor) : 入力バッチの動画。
戻り値: torch.Tensor
エンコードされた動画の潜在表現。
タイル化されたエンコーダーを使用して、画像のバッチをエンコードします。
DecoderOutput[[diffusers.models.autoencoders.vae.DecoderOutput]]
diffusers.models.autoencoders.vae.DecoderOutput[[diffusers.models.autoencoders.vae.DecoderOutput]]
diffusers.models.autoencoders.vae.DecoderOutput(sample: Tensor, commit_loss: typing.Optional[torch.FloatTensor] = None)
パラメータ:
sample (torch.Tensor、形状 (batch_size, num_channels, height, width)) : モデルの最終層からのデコード済み出力サンプル。
デコードメソッドの出力。
Xet Storage Details
- Size:
- 8.71 kB
- Xet hash:
- 4543869859411393798a1357d37a09d23755c4519bf30173b22aaa08ec159575
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.