lingbot_video ¶
FastVideo-native LingBot-Video Dense and MoE diffusion transformers.
Classes¶
fastvideo.models.dits.lingbot_video.LingBotVideoAttention ¶
LingBotVideoAttention(hidden_size: int, num_heads: int, norm_eps: float, qkv_bias: bool, out_bias: bool)
Bases: Module
Joint video-text attention shared by the Dense and MoE variants.
Create released QKV projections, per-head norms, and output projection.
Source code in fastvideo/models/dits/lingbot_video.py
Methods:¶
fastvideo.models.dits.lingbot_video.LingBotVideoAttention.forward ¶
forward(hidden_states: Tensor, rotary_emb: Tensor, attention_mask: Tensor | None = None, original_seq_len: int | None = None) -> Tensor
Project QKV, apply rotary embeddings, and run non-causal SDPA.
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoBlock ¶
LingBotVideoBlock(hidden_size: int, num_attention_heads: int, intermediate_size: int, norm_eps: float, qkv_bias: bool, out_bias: bool, num_experts: int, num_experts_per_tok: int, moe_intermediate_size: int, decoder_sparse_step: int, mlp_only_layers: tuple[int, ...] | list[int], n_shared_experts: int | None, score_func: str, norm_topk_prob: bool, n_group: int | None, topk_group: int | None, routed_scaling_factor: float, layer_idx: int)
Bases: Module
One Dense or sparse LingBot-Video transformer block.
Select the released Dense or sparse feed-forward structure for one layer.
Source code in fastvideo/models/dits/lingbot_video.py
Methods:¶
fastvideo.models.dits.lingbot_video.LingBotVideoBlock.forward ¶
forward(hidden_states: Tensor, temb6: Tensor, rotary_emb: Tensor, attention_mask: Tensor | None = None, moe_padding_mask: Tensor | None = None, original_seq_len: int | None = None) -> Tensor
Run attention and configured feed-forward residual branches with fp32 AdaLN.
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoGroupedExperts ¶
Bases: Module
Released grouped-expert parameter layout: w1/w3 [E,I,H], w2 [E,H,I].
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoLinear ¶
LingBotVideoLinear(input_size: int, output_size: int, bias: bool = True, skip_bias_add: bool = False, params_dtype: dtype | None = None, quant_config: QuantizationConfig | None = None, prefix: str = '')
Bases: ReplicatedLinear
Replicated FastVideo linear with the tensor-only official call contract.
Source code in fastvideo/layers/linear.py
fastvideo.models.dits.lingbot_video.LingBotVideoMLP ¶
Bases: Module
Dense SwiGLU feed-forward network.
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoRMSNorm ¶
Bases: Module
RMSNorm with fp32 accumulation and input-dtype output.
Source code in fastvideo/models/dits/lingbot_video.py
Methods:¶
fastvideo.models.dits.lingbot_video.LingBotVideoRMSNorm.forward ¶
Normalize the last dimension using the official accumulation order.
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoRotaryEmbedding ¶
Bases: Module
Complex64 rotary table indexed by temporal and spatial positions.
Source code in fastvideo/models/dits/lingbot_video.py
Methods:¶
fastvideo.models.dits.lingbot_video.LingBotVideoRotaryEmbedding.forward ¶
Gather and concatenate rotary frequencies for (S, 3) positions.
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoRouter ¶
LingBotVideoRouter(hidden_size: int, num_experts: int, top_k: int, score_func: str, norm_topk_prob: bool, n_group: int | None, topk_group: int | None, route_scale: float)
Bases: Module
Released token-choice router with bias-only expert selection correction.
Create fp32-routed expert scores with the released persistent bias.
Source code in fastvideo/models/dits/lingbot_video.py
Methods:¶
fastvideo.models.dits.lingbot_video.LingBotVideoRouter.forward ¶
forward(tokens: Tensor) -> tuple[Tensor, Tensor, Tensor, Tensor, Tensor]
Score in fp32, select with correction bias, and weight without it.
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoSparseMoeBlock ¶
LingBotVideoSparseMoeBlock(hidden_size: int, intermediate_size: int, num_experts: int, top_k: int, moe_intermediate_size: int, score_func: str, norm_topk_prob: bool, n_group: int | None, topk_group: int | None, routed_scaling_factor: float, n_shared_experts: int | None)
Bases: Module
Token-choice sparse feed-forward block matching the released state surface.
Create routed and optional shared experts with released parameter names.
Source code in fastvideo/models/dits/lingbot_video.py
Methods:¶
fastvideo.models.dits.lingbot_video.LingBotVideoSparseMoeBlock.forward ¶
Route token choices, zero padded routes, and add optional shared experts.
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoTextEmbedder ¶
Bases: Module
Project Qwen3-VL hidden states into the DiT hidden dimension.
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoTimestepEmbedding ¶
fastvideo.models.dits.lingbot_video.LingBotVideoTransformer3DModel ¶
LingBotVideoTransformer3DModel(config: LingBotVideoConfig, hf_config: dict[str, Any])
Bases: BaseDiT
LingBot-Video DiT with a source-compatible Dense or MoE state surface.
Construct the Dense or MoE variant from its released transformer config.
Source code in fastvideo/models/dits/lingbot_video.py
Methods:¶
fastvideo.models.dits.lingbot_video.LingBotVideoTransformer3DModel.forward ¶
forward(hidden_states: Tensor, timestep: Tensor, encoder_hidden_states: Tensor | list[Tensor], encoder_hidden_states_image: Tensor | list[Tensor] | None = None, guidance: Tensor | None = None, encoder_attention_mask: Tensor | None = None, return_dict: bool = True, **kwargs: Any) -> LingBotVideoTransformerOutput | tuple[Tensor]
Denoise video latents with joint video-text attention.
Source code in fastvideo/models/dits/lingbot_video.py
700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 | |
fastvideo.models.dits.lingbot_video.LingBotVideoTransformer3DModel.to ¶
to(*args: Any, **kwargs: Any) -> LingBotVideoTransformer3DModel
Cast bulk weights while retaining the released fp32-sensitive modules.
Source code in fastvideo/models/dits/lingbot_video.py
fastvideo.models.dits.lingbot_video.LingBotVideoTransformerOutput dataclass ¶
Output container matching the released transformer contract.