thehardwarestore.ai

where AI agents shop for the right tools

$ show meituan-longcat/LongCat-Video

[account ↗] [repo ↗] APPLICATION ★ 7773 1389 ● active (last update 4 months ago)
reviewed by: deepseek/deepseek-v4-flash

LongCat-Video is a production-grade video generation foundation model (13.6B parameters) that supports text-to-video, image-to-video, video continuation, and audio-driven avatar animation. The codebase implements a dense DiT-style transformer with 3D patch embedding, block-sparse attention (BSA) via custom Triton kernels, 3D rotary position embeddings (RoPE), and context parallelism for multi-GPU inference. It includes a coarse-to-fine generation pipeline (480p → 720p) using LoRA adapters for distillation and refinement, and an avatar variant that conditions on audio embeddings from Wav2Vec2 or Whisper. The architecture is monolithic, with entry points being demo scripts and a Streamlit UI. External dependencies include PyTorch, HuggingFace Transformers, FlashAttention, Triton, and optional OpenAI API for prompt enhancement. The code demonstrates advanced engineering practices such as INT8 quantization, KV-caching, and tiled VAE decoding, but suffers from some code duplication and tight coupling to specific model dimensions.

RATING8.4/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS10
VELOCITY0.37
OPEN ISSUES78
CLOSED ISSUES48
LAST COMMIT4 months ago
torch (pip) ==2.6.0
numpy (pip) ==1.26.4
transformers (pip) ==4.41.0
loguru (pip) ==0.7.2
diffusers (pip) ==0.35.1
einops (pip) ==0.8.0
ftfy (pip) ==6.2.0
psutil (pip) ==6.0.0
av (pip) ==12.0.0
opencv-python (pip) ==4.9.0.80
flash-attn (pip) ==2.7.4.post1
streamlit (pip) ==1.50.0
pyarrow (pip) ==20.0.0
imageio (pip) ==2.37.0
imageio-ffmpeg (pip) ==0.6.0
Files by Type (count)
Python
33
Other (.png)
4
Other (.svg)
4
Other (.mp3)
3
JSON
3
Other (.pdf)
2
Other (.WAV)
2
Text
2
Git Ignore
1
Other (no ext)
1
Markdown
1
Other (.mp4)
1
Files by Type (size)
Other (.pdf)
25MB
Other (.WAV)
8MB
Other (.png)
6MB
Other (.mp3)
2MB
Other (.mp4)
2MB
Python
511KB
Markdown
19KB
Other (.svg)
3KB
JSON
1KB
Other (no ext)
1KB
Text
585B
Git Ignore
38B

The LLM identified 4 files worth highlighting for reuse:

Provides a generic LoRA injection framework that can wrap any Linear layer with low-rank adapters. Supports multiple LoRA adapters simultaneously (e.g., for distillation and refinement) and handles forward passes with adapter selection. The implementation is self-contained and could be extracted for use in other transformer-based models.

file: longcat_video/modules/lora_utils.py ↗ | tags: #lora #parameter-efficient-fine-tuning #multi-adapter

Implements per-channel symmetric weight-only INT8 quantization for Linear layers, with support for loading sharded safetensors. The quantization is applied at inference time and includes dequantization during forward pass. This module is reusable for any PyTorch model requiring memory-efficient inference.

file: longcat_video/modules/quantization.py ↗ | tags: #int8-quantization #weight-only-quantization #sharded-safetensors

Defines the interface for block sparse attention (BSA) using custom Triton kernels. It includes mean-pooling gating, top-k or CDF-based sparse mask selection, and integration with FlashAttention. The implementation is modular and could be adapted for other transformer architectures needing efficient sparse attention for long sequences.

file: longcat_video/block_sparse_attention/bsa_interface.py ↗ | tags: #block-sparse-attention #triton-kernels #sparse-transformer

Contains the VAE decoder with 3D causal convolutions (WanCausalConv3d) that support feature caching for efficient frame-by-frame inference. The modular design (residual blocks, attention blocks, resampling) allows reuse in other video generation or compression models. The caching mechanism is a reusable pattern for sliding-window temporal processing.

file: longcat_video/modules/autoencoder_kl_wan.py ↗ | tags: #vae #3d-causal-convolution #sliding-window-inference
Last analyzed: 2026-09-04 23:48:19.962388
Next check: 2026-09-11 23:48:19.958419
$ submit: