lvsa-tuning

Tune LVSA sparsity_scale and window parameters for Wan and HunyuanVideo models.

18|4|Updated May 21, 2026
One-click install
npx skills add https://github.com/JiusiServe/LongVideoSparseAttention --skill lvsa-tuning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lvsa-tuning
Source: https://github.com/JiusiServe/LongVideoSparseAttention/tree/main/skills/lvsa-tuning
Command: npx skills add https://github.com/JiusiServe/LongVideoSparseAttention --skill lvsa-tuning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

LVSA tuning helps ML practitioners optimize the long-video sparse attention scheduler to achieve a desired balance between visual quality and generation speed, without changing model weights.

Core Features & Use Cases

  • Knob-based optimization: adjust sparsity_scale, window_size, and n_first_frames to control long-range attention budget.
  • Rotation and extrapolation: enable rotate-keyframes and RIFLEx composition to extend horizon without quality collapse.
  • Practical guidance: choose configurations for Wan, HunyuanVideo, or CogVideo-like models to meet latency targets while preserving motion fidelity.

Quick Start

Tune LVSA by adjusting sparsity_scale and window settings to achieve the desired balance between quality and speed for your Wan/HunyuanVideo experiments.

Frequently Asked Questions about lvsa-tuning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I balance video generation quality and speed using sparse attention?

Adjust the LVSA sparsity_scale and window parameters to control the long-range attention budget, balancing visual quality and generation speed without modifying model weights.

Can I tune long video sparse attention for Wan and HunyuanVideo models?

Yes, LVSA tuning supports Wan, HunyuanVideo, and other LVSA-enabled models across different horizons to test configurations and meet latency targets while preserving motion fidelity.

What parameters control long video sparse attention scheduling?

The core parameters include sparsity_scale, window_size, and n_first_frames, configurable via environment variables or CLI arguments to manage the long-range attention budget.

How do I extend video generation horizon without quality collapse?

Enable rotate-keyframes and optional RIFLEx composition for extrapolation to extend the video generation horizon without experiencing visual quality collapse.

Does adjusting sparsity_scale require changing model weights?

No, adjusting sparsity_scale and window parameters optimizes the long-video sparse attention scheduler dynamically, achieving the desired quality versus speed balance without changing model weights.