Repository Analysis

Tencent-Hunyuan/HunyuanVideo

HunyuanVideo: A Systematic Framework For Large Video Generation Model

18.4 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of Tencent-Hunyuan/HunyuanVideo, a Python project with 12,334 GitHub stars. SynthScan v2.0 examined 8,902 lines of code across 44 source files, recording 103 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 18.4 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

18.4
Adjusted Score
18.4
Raw Score
100%
Time Factor
2026-06-29
Last Push
12.3K
Stars
Python
Language
8.9K
Lines of Code
44
Files
103
Pattern Hits
2026-07-14
Scan Date
0.05
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 2MEDIUM 27LOW 74

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 103 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Decorative Section Separators26 hits · 83 pts
SeverityFileLineSnippetContext
MEDIUMhyvideo/constants.py32# --------------------------------------------------------------------COMMENT
MEDIUMhyvideo/inference.py608 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py610 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py618 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py620 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py626 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py628 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py153 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py531 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py533 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py568 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py570 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py590 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py592 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py644 # ========================================================================COMMENT
MEDIUMhyvideo/inference.py646 # ========================================================================COMMENT
MEDIUMhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py14# ==============================================================================COMMENT
MEDIUMhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py18# ==============================================================================COMMENT
MEDIUMhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py181 # ==========================================================================================STRING
MEDIUMhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py189 # ==========================================================================================STRING
MEDIUM…diffusion/schedulers/scheduling_flow_match_discrete.py14# ==============================================================================COMMENT
MEDIUM…diffusion/schedulers/scheduling_flow_match_discrete.py18# ==============================================================================COMMENT
MEDIUMhyvideo/vae/unet_causal_3d_blocks.py14# ==============================================================================COMMENT
MEDIUMhyvideo/vae/unet_causal_3d_blocks.py18# ==============================================================================COMMENT
MEDIUMhyvideo/vae/autoencoder_kl_causal_3d.py14# ==============================================================================COMMENT
MEDIUMhyvideo/vae/autoencoder_kl_causal_3d.py18# ==============================================================================COMMENT
AI Structural Patterns23 hits · 22 pts
SeverityFileLineSnippetContext
LOWhyvideo/inference.py498CODE
LOWhyvideo/text_encoder/__init__.py103CODE
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py238CODE
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py664CODE
LOWhyvideo/modules/attenion.py175CODE
LOWhyvideo/modules/attenion.py60CODE
LOWhyvideo/modules/models.py449CODE
LOWhyvideo/modules/embed_layers.py23CODE
LOWhyvideo/modules/mlp_layers.py16CODE
LOWhyvideo/modules/token_refiner.py17CODE
LOWhyvideo/modules/token_refiner.py104CODE
LOWhyvideo/modules/token_refiner.py168CODE
LOWhyvideo/vae/unet_causal_3d_blocks.py418CODE
LOWhyvideo/vae/unet_causal_3d_blocks.py471CODE
LOWhyvideo/vae/unet_causal_3d_blocks.py82CODE
LOWhyvideo/vae/unet_causal_3d_blocks.py190CODE
LOWhyvideo/vae/unet_causal_3d_blocks.py254CODE
LOWhyvideo/vae/unet_causal_3d_blocks.py531CODE
LOWhyvideo/vae/unet_causal_3d_blocks.py632CODE
LOWhyvideo/vae/unet_causal_3d_blocks.py698CODE
LOWhyvideo/vae/autoencoder_kl_causal_3d.py64CODE
LOWhyvideo/vae/vae.py37CODE
LOWhyvideo/vae/vae.py141CODE
Unused Imports21 hits · 21 pts
SeverityFileLineSnippetContext
LOWgradio_server.py7CODE
LOWgradio_server.py12CODE
LOWutils/collect_env.py36CODE
LOWhyvideo/config.py2CODE
LOWhyvideo/inference.py5CODE
LOWhyvideo/inference.py5CODE
LOWhyvideo/inference.py5CODE
LOWhyvideo/utils/data_utils.py1CODE
LOWhyvideo/text_encoder/__init__.py3CODE
LOWhyvideo/diffusion/__init__.py1CODE
LOWhyvideo/diffusion/__init__.py2CODE
LOWhyvideo/diffusion/pipelines/__init__.py1CODE
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py25CODE
LOW…diffusion/schedulers/scheduling_flow_match_discrete.py23CODE
LOWhyvideo/diffusion/schedulers/__init__.py1CODE
LOWhyvideo/modules/attenion.py1CODE
LOWhyvideo/modules/attenion.py5CODE
LOWhyvideo/modules/models.py6CODE
LOWhyvideo/modules/embed_layers.py4CODE
LOWhyvideo/modules/embed_layers.py4CODE
LOWhyvideo/modules/token_refiner.py13CODE
Deep Nesting11 hits · 11 pts
SeverityFileLineSnippetContext
LOWgradio_server.py67CODE
LOWutils/collect_env.py64CODE
LOWhyvideo/inference.py280CODE
LOWhyvideo/inference.py498CODE
LOWhyvideo/text_encoder/__init__.py217CODE
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py238CODE
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py482CODE
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py664CODE
LOWhyvideo/modules/activation_layers.py4CODE
LOWhyvideo/modules/attenion.py60CODE
LOWhyvideo/vae/unet_causal_3d_blocks.py254CODE
Docstring Block Structure2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py704 The call function to the pipeline for generation. Args: prompt (`str` or `List[str]`): STRING
HIGHhyvideo/modules/posemb_layers.py70 Reshape frequency tensor for broadcasting it with another tensor. This function reshapes the frequency tensor STRING
Hyper-Verbose Identifiers12 hits · 8 pts
SeverityFileLineSnippetContext
LOWtests/test_attention.py44def test_mm_double_stream_block_attention(rank, world_size):CODE
LOWtests/test_attention.py112def test_mm_single_stream_block_attention(rank, world_size):CODE
LOWhyvideo/config.py175def add_denoise_schedule_args(parser: argparse.ArgumentParser):CODE
LOW…video/utils/preprocess_text_encoder_tokenizer_utils.py9def preprocess_text_encoder_tokenizer(args):CODE
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py469 def prepare_extra_func_kwargs(self, func, kwargs):STRING
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py597 def get_guidance_scale_embedding(STRING
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py646 def do_classifier_free_guidance(self):STRING
LOWhyvideo/vae/unet_causal_3d_blocks.py37def prepare_causal_attention_mask(n_frame: int, n_hw: int, dtype, device, batch_size: int = None):CODE
LOWhyvideo/vae/autoencoder_kl_causal_3d.py134 def _set_gradient_checkpointing(self, module, value=False):STRING
LOWhyvideo/vae/autoencoder_kl_causal_3d.py192 def fn_recursive_add_processors(name: str, module: torch.nn.Module, processors: Dict[str, AttentionProcessor]):STRING
LOWhyvideo/vae/autoencoder_kl_causal_3d.py230 def fn_recursive_attn_processor(name: str, module: torch.nn.Module, processor):STRING
LOWhyvideo/vae/autoencoder_kl_causal_3d.py244 def set_default_attn_processor(self):STRING
Over-Commented Block5 hits · 5 pts
SeverityFileLineSnippetContext
LOWscripts/run_sample_video_multigpu.sh1#!/bin/bashCOMMENT
LOWhyvideo/diffusion/pipelines/pipeline_hunyuan_video.py1# Copyright 2024 The HuggingFace Team. All rights reserved.COMMENT
LOW…diffusion/schedulers/scheduling_flow_match_discrete.py1# Copyright 2024 Stability AI, Katherine Crowson and The HuggingFace Team. All rights reserved.COMMENT
LOWhyvideo/vae/unet_causal_3d_blocks.py1# Copyright 2024 The HuggingFace Team. All rights reserved.COMMENT
LOWhyvideo/vae/autoencoder_kl_causal_3d.py1# Copyright 2024 The HuggingFace Team. All rights reserved.COMMENT
Excessive Try-Catch Wrapping1 hit · 1 pts
SeverityFileLineSnippetContext
LOWutils/collect_env.py38except Exception:CODE
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWhyvideo/constants.py4__all__ = [CODE
Slop Phrases1 hit · 1 pts
SeverityFileLineSnippetContext
MEDIUMhyvideo/prompt_rewrite.py51# Then you can use the normal_prompt or master_prompt to access the hunyuan-large rewrite model to get the final prompt.STRING