HunyuanVideo: A Systematic Framework For Large Video Generation Model
This report summarizes scanner evidence for Tencent-Hunyuan/HunyuanVideo, a Python project with 12,611 GitHub stars. SynthScan examined 8,923 lines of code across 44 source files, recording 106 pattern matches distributed across 11 syntactic categories. The legacy adjusted pattern signal is 20.1 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 54 finding(s).
Are imports declared and package/API names verified? 21 finding(s).
Are wrappers, guards, and repeated structures necessary? 66 finding(s).
Which changes need focused human review? 106 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 106 distinct pattern matches across 11 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | hyvideo/constants.py | 32 | # -------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | hyvideo/inference.py | 612 | # ======================================================================== | COMMENT |
| MEDIUM⚡ | hyvideo/inference.py | 614 | # ======================================================================== | COMMENT |
| MEDIUM⚡ | hyvideo/inference.py | 622 | # ======================================================================== | COMMENT |
| MEDIUM⚡ | hyvideo/inference.py | 624 | # ======================================================================== | COMMENT |
| MEDIUM⚡ | hyvideo/inference.py | 630 | # ======================================================================== | COMMENT |
| MEDIUM⚡ | hyvideo/inference.py | 632 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/inference.py | 153 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/inference.py | 535 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/inference.py | 537 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/inference.py | 572 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/inference.py | 574 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/inference.py | 594 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/inference.py | 596 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/inference.py | 648 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/inference.py | 650 | # ======================================================================== | COMMENT |
| MEDIUM | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 14 | # ============================================================================== | COMMENT |
| MEDIUM | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 18 | # ============================================================================== | COMMENT |
| MEDIUM | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 181 | # ========================================================================================== | STRING |
| MEDIUM | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 189 | # ========================================================================================== | STRING |
| MEDIUM | …diffusion/schedulers/scheduling_flow_match_discrete.py | 14 | # ============================================================================== | COMMENT |
| MEDIUM | …diffusion/schedulers/scheduling_flow_match_discrete.py | 18 | # ============================================================================== | COMMENT |
| MEDIUM | hyvideo/vae/unet_causal_3d_blocks.py | 14 | # ============================================================================== | COMMENT |
| MEDIUM | hyvideo/vae/unet_causal_3d_blocks.py | 18 | # ============================================================================== | COMMENT |
| MEDIUM | hyvideo/vae/autoencoder_kl_causal_3d.py | 14 | # ============================================================================== | COMMENT |
| MEDIUM | hyvideo/vae/autoencoder_kl_causal_3d.py | 18 | # ============================================================================== | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | hyvideo/inference.py | 502 | CODE | |
| LOW | hyvideo/text_encoder/__init__.py | 103 | CODE | |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 238 | CODE | |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 664 | CODE | |
| LOW | hyvideo/modules/attenion.py | 175 | CODE | |
| LOW | hyvideo/modules/attenion.py | 60 | CODE | |
| LOW | hyvideo/modules/models.py | 449 | CODE | |
| LOW | hyvideo/modules/embed_layers.py | 23 | CODE | |
| LOW | hyvideo/modules/mlp_layers.py | 16 | CODE | |
| LOW | hyvideo/modules/token_refiner.py | 17 | CODE | |
| LOW | hyvideo/modules/token_refiner.py | 104 | CODE | |
| LOW | hyvideo/modules/token_refiner.py | 168 | CODE | |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 418 | CODE | |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 471 | CODE | |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 82 | CODE | |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 190 | CODE | |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 254 | CODE | |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 531 | CODE | |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 632 | CODE | |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 698 | CODE | |
| LOW | hyvideo/vae/autoencoder_kl_causal_3d.py | 64 | CODE | |
| LOW | hyvideo/vae/vae.py | 37 | CODE | |
| LOW | hyvideo/vae/vae.py | 141 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gradio_server.py | 6 | CODE | |
| LOW | gradio_server.py | 11 | CODE | |
| LOW | utils/collect_env.py | 36 | CODE | |
| LOW | hyvideo/config.py | 2 | CODE | |
| LOW | hyvideo/inference.py | 5 | CODE | |
| LOW | hyvideo/inference.py | 5 | CODE | |
| LOW | hyvideo/inference.py | 5 | CODE | |
| LOW | hyvideo/utils/data_utils.py | 1 | CODE | |
| LOW | hyvideo/text_encoder/__init__.py | 3 | CODE | |
| LOW | hyvideo/diffusion/__init__.py | 1 | CODE | |
| LOW | hyvideo/diffusion/__init__.py | 2 | CODE | |
| LOW | hyvideo/diffusion/pipelines/__init__.py | 1 | CODE | |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 25 | CODE | |
| LOW | …diffusion/schedulers/scheduling_flow_match_discrete.py | 23 | CODE | |
| LOW | hyvideo/diffusion/schedulers/__init__.py | 1 | CODE | |
| LOW | hyvideo/modules/attenion.py | 1 | CODE | |
| LOW | hyvideo/modules/attenion.py | 5 | CODE | |
| LOW | hyvideo/modules/models.py | 6 | CODE | |
| LOW | hyvideo/modules/embed_layers.py | 4 | CODE | |
| LOW | hyvideo/modules/embed_layers.py | 4 | CODE | |
| LOW | hyvideo/modules/token_refiner.py | 13 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | utils/collect_env.py | 188 | except ModuleNotFoundError: | CODE |
| HIGH | utils/collect_env.py | 194 | except ImportError: | CODE |
| HIGH | utils/collect_env.py | 21 | except ImportError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gradio_server.py | 65 | CODE | |
| LOW | utils/collect_env.py | 64 | CODE | |
| LOW | hyvideo/inference.py | 280 | CODE | |
| LOW | hyvideo/inference.py | 502 | CODE | |
| LOW | hyvideo/text_encoder/__init__.py | 217 | CODE | |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 238 | CODE | |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 482 | CODE | |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 664 | CODE | |
| LOW | hyvideo/modules/activation_layers.py | 4 | CODE | |
| LOW | hyvideo/modules/attenion.py | 60 | CODE | |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 254 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 704 | The call function to the pipeline for generation. Args: prompt (`str` or `List[str]`): | STRING |
| HIGH | hyvideo/modules/posemb_layers.py | 70 | Reshape frequency tensor for broadcasting it with another tensor. This function reshapes the frequency tensor | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_attention.py | 44 | def test_mm_double_stream_block_attention(rank, world_size): | CODE |
| LOW | tests/test_attention.py | 112 | def test_mm_single_stream_block_attention(rank, world_size): | CODE |
| LOW | hyvideo/config.py | 175 | def add_denoise_schedule_args(parser: argparse.ArgumentParser): | CODE |
| LOW | …video/utils/preprocess_text_encoder_tokenizer_utils.py | 9 | def preprocess_text_encoder_tokenizer(args): | CODE |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 469 | def prepare_extra_func_kwargs(self, func, kwargs): | STRING |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 597 | def get_guidance_scale_embedding( | STRING |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 646 | def do_classifier_free_guidance(self): | STRING |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 37 | def prepare_causal_attention_mask(n_frame: int, n_hw: int, dtype, device, batch_size: int = None): | CODE |
| LOW | hyvideo/vae/autoencoder_kl_causal_3d.py | 134 | def _set_gradient_checkpointing(self, module, value=False): | STRING |
| LOW | hyvideo/vae/autoencoder_kl_causal_3d.py | 192 | def fn_recursive_add_processors(name: str, module: torch.nn.Module, processors: Dict[str, AttentionProcessor]): | STRING |
| LOW | hyvideo/vae/autoencoder_kl_causal_3d.py | 230 | def fn_recursive_attn_processor(name: str, module: torch.nn.Module, processor): | STRING |
| LOW | hyvideo/vae/autoencoder_kl_causal_3d.py | 244 | def set_default_attn_processor(self): | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/run_sample_video_multigpu.sh | 1 | #!/bin/bash | COMMENT |
| LOW | hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py | 1 | # Copyright 2024 The HuggingFace Team. All rights reserved. | COMMENT |
| LOW | …diffusion/schedulers/scheduling_flow_match_discrete.py | 1 | # Copyright 2024 Stability AI, Katherine Crowson and The HuggingFace Team. All rights reserved. | COMMENT |
| LOW | hyvideo/vae/unet_causal_3d_blocks.py | 1 | # Copyright 2024 The HuggingFace Team. All rights reserved. | COMMENT |
| LOW | hyvideo/vae/autoencoder_kl_causal_3d.py | 1 | # Copyright 2024 The HuggingFace Team. All rights reserved. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | utils/collect_env.py | 38 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | hyvideo/constants.py | 4 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | hyvideo/prompt_rewrite.py | 51 | # Then you can use the normal_prompt or master_prompt to access the hunyuan-large rewrite model to get the final prompt. | STRING |