hunyuanvae ¶
Classes¶
fastvideo.models.vaes.hunyuanvae.AutoencoderKLHunyuanVideo ¶
Bases: Module, ParallelTiledVAE
A VAE model with KL loss for encoding videos into latents and decoding latent representations into videos. Introduced in HunyuanVideo.
This model inherits from [ModelMixin]. Check the superclass documentation for it's generic methods implemented for all models (such as downloading or saving).
Source code in fastvideo/models/vaes/hunyuanvae.py
Methods:¶
fastvideo.models.vaes.hunyuanvae.AutoencoderKLHunyuanVideo.forward ¶
forward(sample: Tensor, sample_posterior: bool = False, generator: Generator | None = None) -> Tensor
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample | `torch.Tensor` | Input sample. | required |
sample_posterior | `bool`, *optional*, defaults to `False` | Whether to sample from the posterior. | False |
Source code in fastvideo/models/vaes/hunyuanvae.py
fastvideo.models.vaes.hunyuanvae.HunyuanVideoDecoder3D ¶
HunyuanVideoDecoder3D(in_channels: int = 3, out_channels: int = 3, up_block_types: tuple[str, ...] = ('HunyuanVideoUpBlock3D', 'HunyuanVideoUpBlock3D', 'HunyuanVideoUpBlock3D', 'HunyuanVideoUpBlock3D'), block_out_channels: tuple[int, ...] = (128, 256, 512, 512), layers_per_block: int = 2, norm_num_groups: int = 32, act_fn: str = 'silu', mid_block_add_attention=True, time_compression_ratio: int = 4, spatial_compression_ratio: int = 8)
Bases: Module
Causal decoder for 3D video-like data introduced in Hunyuan Video.
Source code in fastvideo/models/vaes/hunyuanvae.py
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 | |
fastvideo.models.vaes.hunyuanvae.HunyuanVideoEncoder3D ¶
HunyuanVideoEncoder3D(in_channels: int = 3, out_channels: int = 3, down_block_types: tuple[str, ...] = ('HunyuanVideoDownBlock3D', 'HunyuanVideoDownBlock3D', 'HunyuanVideoDownBlock3D', 'HunyuanVideoDownBlock3D'), block_out_channels: tuple[int, ...] = (128, 256, 512, 512), layers_per_block: int = 2, norm_num_groups: int = 32, act_fn: str = 'silu', double_z: bool = True, mid_block_add_attention=True, temporal_compression_ratio: int = 4, spatial_compression_ratio: int = 8)
Bases: Module
Causal encoder for 3D video-like data introduced in Hunyuan Video.
Source code in fastvideo/models/vaes/hunyuanvae.py
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | |