hunyuanvideo15 ¶
Classes¶
fastvideo.models.dits.hunyuanvideo15.FinalLayer ¶
FinalLayer(hidden_size, patch_size, out_channels, dtype=None, prefix: str = '')
Bases: Module
The final layer of DiT that projects features to pixel space.
Source code in fastvideo/models/dits/hunyuanvideo15.py
fastvideo.models.dits.hunyuanvideo15.HunyuanRMSNorm ¶
Bases: Module
Initialize the RMSNorm normalization layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim | int | The dimension of the input tensor. | required |
eps | float | A small value added to the denominator for numerical stability. Default is 1e-6. | 1e-06 |
Attributes:
| Name | Type | Description |
|---|---|---|
eps | float | A small value added to the denominator for numerical stability. |
weight | Parameter | Learnable scaling parameter. |
Source code in fastvideo/models/dits/hunyuanvideo15.py
Methods:¶
fastvideo.models.dits.hunyuanvideo15.HunyuanRMSNorm.forward ¶
Forward pass through the RMSNorm layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x | Tensor | The input tensor. | required |
Returns:
| Type | Description |
|---|---|
| torch.Tensor: The output tensor after applying RMSNorm. |
Source code in fastvideo/models/dits/hunyuanvideo15.py
fastvideo.models.dits.hunyuanvideo15.HunyuanVideo15TimeEmbedding ¶
Bases: Module
Time embedding for HunyuanVideo 1.5.
Supports standard timestep embedding and optional reference timestep embedding for MeanFlow-based super-resolution models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
embedding_dim | `int` | The dimension of the output embedding. | required |
Source code in fastvideo/models/dits/hunyuanvideo15.py
fastvideo.models.dits.hunyuanvideo15.HunyuanVideo15Transformer3DModel ¶
Bases: BaseDiT
A Transformer model for video-like data used in HunyuanVideo1.5.
Source code in fastvideo/models/dits/hunyuanvideo15.py
fastvideo.models.dits.hunyuanvideo15.IndividualTokenRefinerBlock ¶
IndividualTokenRefinerBlock(hidden_size, num_attention_heads, mlp_ratio=4.0, qkv_bias=True, dtype=None, prefix: str = '')
Bases: Module
A transformer block for refining individual tokens with self-attention.
Source code in fastvideo/models/dits/hunyuanvideo15.py
fastvideo.models.dits.hunyuanvideo15.MMDoubleStreamBlock ¶
MMDoubleStreamBlock(hidden_size: int, num_attention_heads: int, mlp_ratio: float, dtype: dtype | None = None, supported_attention_backends: tuple[AttentionBackendEnum, ...] | None = None, prefix: str = '')
Bases: Module
A multimodal DiT block with separate modulation for text and image/video, using distributed attention and linear layers.
Source code in fastvideo/models/dits/hunyuanvideo15.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | |
fastvideo.models.dits.hunyuanvideo15.SingleTokenRefiner ¶
SingleTokenRefiner(in_channels, hidden_size, num_attention_heads, depth=2, qkv_bias=True, dtype=None, prefix: str = '')
Bases: Module
A token refiner that processes text embeddings with attention to improve their representation for cross-attention with image features.