One restore command. One run command. 4K video from a Vast.ai A100/A800.
This repository packages a known-good FlashVSR runtime for NVIDIA A100 / A800 (sm80) plus the shell scripts that actually process long videos: overlapped chunks, original frame timing, and a 3840×2160 output.
中文:在 Vast.ai 上租一台 A100/A800,一条命令还原已经编好的 FlashVSR 环境,再一条命令把视频超到 4K。默认保持片源帧率,竖屏会先转横再处理,长视频按重叠分块避免接缝跳变。
FlashVSR on a cloud GPU usually fails for boring reasons: disk too small, cuDNN too old, Block-Sparse-Attention rebuilt for the wrong architecture, ffmpeg eating the chunk list from stdin, seams between 8-second segments.
This repo is the path that already worked:
- Restore a prebuilt conda env + FlashVSR + Block-Sparse-Attention from GitHub Releases (no compile on a fresh box).
- Run
run_flashvsr_video.shon one file or a folder.
| Item | Requirement |
|---|---|
| GPU | A100 80GB or A800 80GB (sm80). Other architectures need a fresh Block-Sparse-Attention build. |
| CUDA | Driver reporting ≥ 12.8. Runtime in the backup is torch 2.11.0+cu128, cuDNN 91900. |
| Disk | 100 GB minimum, 150 GB better. A 32 GB root disk is not enough. |
| Image | Vast.ai CUDA 12.8 base / Jupyter image is fine. |
On a new Vast.ai instance:
cd /workspace
apt-get update
apt-get install -y git
git clone https://github.com/PA5MIN/A100.git
bash /workspace/A100/vastai_setup_flashvsr.shPut videos in /workspace/flashvsr_jobs/input, then:
bash /workspace/A100/run_flashvsr_video.shOr pass a path:
bash /workspace/A100/run_flashvsr_video.sh /workspace/my_video.mp4Outputs land in /workspace/flashvsr_jobs/output as *_3840x2160_flashvsr.mp4.
Step-by-step notes: DEPLOY.md. Real failure modes from the first restore: TROUBLESHOOTING.md.
Default: keep source frame timing (no fps= filter). Portrait is rotated to landscape first.
portrait 1088×1920
→ rotate 1920×1088
→ scale 960×544
→ FlashVSR ×4 → 3840×2176
→ crop 8 px top/bottom → 3840×2160
→ mux original audio
portrait 1080×1920
→ rotate 1920×1080
→ scale 960×540
→ pad 2 px → 960×544
→ FlashVSR ×4 → 3840×2176
→ crop → 3840×2160
→ mux original audio
Landscape skips rotation. Matching 960×544 scales directly; 16:9 scales to 960×540 then pads; anything else is center-cropped to fit.
Chunks overlap so FlashVSR’s 8n−3 tail loss does not show up as a jump. Every ffmpeg call uses -nostdin so it cannot steal the chunk list from the shell loop.
# Force 30 fps (off by default)
FPS=30 bash /workspace/A100/run_flashvsr_video.sh /workspace/video.mp4
# Custom preprocess
PREPROCESS_FILTER='transpose=1,scale=960:544:flags=area,setsar=1' \
bash /workspace/A100/run_flashvsr_video.sh /workspace/video.mp4
# Opposite portrait rotation
PORTRAIT_ROTATE_FILTER=transpose=2 bash /workspace/A100/run_flashvsr_video.sh /workspace/video.mp4
# Honor container rotation metadata
FFMPEG_INPUT_OPTS='' bash /workspace/A100/run_flashvsr_video.sh /workspace/video.mp4
# More overlap if a chunk is short on frames
OVERLAP_FRAMES=24 bash /workspace/A100/run_flashvsr_video.shTag a100-cu128-cudnn919-sm80-20260523 restores:
/workspace/envs/flashvsr-fast
/workspace/FlashVSR
/workspace/Block-Sparse-Attention
/workspace/flashvsr_backup_meta
About 18 GB compressed split archives, SHA-256 checked before extract. vastai_setup_flashvsr.sh refuses to start unless /workspace has at least 80 GB free.
| File | Role |
|---|---|
vastai_setup_flashvsr.sh |
Download release, verify checksums, install Miniconda, restore env |
run_flashvsr_video.sh |
Daily path: preprocess → overlapped FlashVSR → concat → audio |
flashvsr_overlap_fix.sh |
Standalone overlap-trim helper from the first seam-debug session |
- FlashVSR — OpenImagingLab
- FlashVSR-v1.1 weights
This repo only ships restore/run glue and a prebuilt sm80 runtime. Model licenses follow upstream.
Scripts and docs in this repository are MIT. Third-party code and weights inside the release keep their original licenses.