Co-authored-by: Aryan Kumar <aryan5v@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
371 lines
12 KiB
TOML
371 lines
12 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=61.0"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "fastvideo"
|
|
version = "0.2.1"
|
|
description = "FastVideo"
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
classifiers = [
|
|
"Programming Language :: Python :: 3",
|
|
"License :: OSI Approved :: Apache Software License",
|
|
]
|
|
|
|
dependencies = [
|
|
# Core Libraries
|
|
"scipy>=1.14.1",
|
|
"six>=1.16.0",
|
|
"h5py>=3.12.1",
|
|
"requests>=2.32.2",
|
|
|
|
# Machine Learning & Transformers
|
|
# Floor raised from >=5.0.0 to >=5.15.0 for the public vision interpolation
|
|
# helper (get_vision_interpolation_indices_and_weights) that the MiniMax-H3
|
|
# Qwen3-VL encoder cross-checks against.
|
|
# LTX-2.5's packed Gemma 4 unified encoder also requires transformers 5.15.0+
|
|
# for correct mapping and loading of the Gemma 4 architecture.
|
|
"transformers>=5.15.0",
|
|
# <0.23: tokenizers 0.23 renamed RobertaProcessing's binding args, so
|
|
# transformers' CLIP-style tokenizer loading dies with
|
|
# "RobertaProcessing.__new__() got an unexpected keyword argument 'cls'".
|
|
"tokenizers>=0.20.1,<0.23",
|
|
"sentencepiece>=0.2.0",
|
|
"timm>=1.0.11",
|
|
"peft>=0.15.0",
|
|
"diffusers>=0.38.0",
|
|
"torch==2.12.0",
|
|
"torchvision",
|
|
"torchaudio",
|
|
# CUDA-only: no wheels for non-Linux platforms, and the sdist build shells
|
|
# out to nvcc unconditionally. Gate on sys_platform so installs on macOS
|
|
# (MPS) and other non-Linux platforms don't try to build it from source.
|
|
"flashinfer-python; sys_platform == 'linux'",
|
|
|
|
# Acceleration & Optimization
|
|
"accelerate==1.0.1",
|
|
|
|
# Computer Vision & Image Processing
|
|
"opencv-python>=4.10.0.84",
|
|
"pillow>=10.3.0",
|
|
"imageio>=2.36.0",
|
|
"imageio-ffmpeg>=0.5.1",
|
|
"einops",
|
|
|
|
# Experiment Tracking & Logging
|
|
"wandb>=0.21.0",
|
|
"loguru",
|
|
"test-tube>=0.7.5",
|
|
|
|
# Miscellaneous Utilities
|
|
"tqdm",
|
|
"pytest",
|
|
"PyYAML>=6.0.1",
|
|
"protobuf>=5.28.3",
|
|
"gradio==5.32.0",
|
|
"moviepy>=2.0.0",
|
|
"flask",
|
|
"flask_restful",
|
|
"aiohttp",
|
|
"aiofiles",
|
|
"huggingface_hub",
|
|
"cloudpickle",
|
|
"omegaconf",
|
|
|
|
# System & Monitoring Tools
|
|
"gpustat",
|
|
"watch",
|
|
"remote-pdb",
|
|
|
|
# Kernel & Packaging
|
|
# CUDA-only: PyPI only publishes manylinux wheels, and the sdist build
|
|
# requires nvcc via CMake. Gate on sys_platform so installs on macOS
|
|
# (MPS) and other non-Linux platforms don't try to build it from source;
|
|
# every fastvideo_kernel import elsewhere is already guarded to degrade
|
|
# gracefully when the package is absent.
|
|
# Pin the exact published kernel so every install resolves the same
|
|
# tested wheel; the in-repo FastH3 extra still selects this checkout's
|
|
# kernel source via the uv sources mapping. Bump this pin in the
|
|
# companion PR of each kernel release.
|
|
"fastvideo-kernel==0.3.5; sys_platform == 'linux'",
|
|
"wheel",
|
|
|
|
# Training Dependencies
|
|
"torchdata",
|
|
"pyarrow",
|
|
"datasets>=4.0.0",
|
|
"av",
|
|
|
|
# Preprocessing Dependencies
|
|
"torchcodec",
|
|
"ray>=2.49.1",
|
|
"ftfy>=6.3.1",
|
|
|
|
# Job Runner
|
|
"fastapi>=0.129.0",
|
|
"orjson>=3.9.0", # fastapi ORJSONResponse in the OpenAI-compatible server
|
|
"python-multipart>=0.0.18", # fastapi Form/UploadFile parsing
|
|
"uvicorn>=0.41.0"
|
|
]
|
|
|
|
[tool.uv]
|
|
prerelease = "allow"
|
|
|
|
[tool.uv.workspace]
|
|
members = ["apps/dreamverse", "apps/infinite_livestream"]
|
|
|
|
[tool.uv.sources]
|
|
# PyPI's aarch64 fastvideo-kernel wheels do not cover the NVIDIA DGX Spark /
|
|
# GB10 (sm_121), so on ARM build from the in-tree source instead. The FastH3
|
|
# extra also selects the in-tree source on x86_64 so a PR checkout can build
|
|
# its matching ptx_blackwell route and key-length-sized sparse FP4 entry point
|
|
# before that version reaches PyPI. Other x86_64 installs keep the published
|
|
# wheel. This table is uv-only: plain pip ignores it. Pass --no-sources to
|
|
# bypass it (e.g. when the kernel is already installed, as in the Spark
|
|
# install guide).
|
|
fastvideo-kernel = [
|
|
{ path = "fastvideo-kernel", marker = "platform_machine == 'aarch64'" },
|
|
{ path = "fastvideo-kernel", marker = "platform_machine == 'x86_64'", extra = "fasth3" },
|
|
]
|
|
# torch / torchvision / torchaudio are intentionally NOT pinned to a PyTorch
|
|
# index here. Pick the supported build explicitly at install time:
|
|
# UV_TORCH_BACKEND=cu126 uv pip install -e ".[dev]" # CUDA 12
|
|
# UV_TORCH_BACKEND=cu130 uv pip install -e ".[dev]" # CUDA 13
|
|
# uv reads UV_TORCH_BACKEND / --torch-backend (not a pyproject setting). The
|
|
# supported backends (cu126, cu130) both provide torch 2.12.0.
|
|
imagebind = { git = "https://github.com/facebookresearch/ImageBind.git", rev = "53680b02d7e37b19b124fa37bae4b6c98c38f5be" }
|
|
# FA4 cute. This revision pins nvidia-cutlass-dsl==4.6.0.dev0; holding cutlass-dsl
|
|
# back at 4.5.x breaks the CuTe kernels at JIT time, not at import
|
|
# (see fastvideo-kernel/README.md).
|
|
# torch.compile support comes from FastVideo's own custom_op wrappers.
|
|
flash-attn-4 = { git = "https://github.com/Dao-AILab/flash-attention.git", rev = "14c377950125c70b7a9dabf9c561fca53715ac7d", subdirectory = "flash_attn/cute" }
|
|
|
|
[project.optional-dependencies]
|
|
|
|
# flash-attn: uv pip install flash-attn==2.8.1 --no-cache-dir --no-build-isolation
|
|
|
|
swanlab = [
|
|
"swanlab>=0.6.7",
|
|
]
|
|
|
|
mmaudio-train = [
|
|
"librosa>=0.10.0",
|
|
"nitrous-ema==0.0.1",
|
|
"tensordict>=0.6.1",
|
|
]
|
|
|
|
lint = [
|
|
"pre-commit==4.0.1",
|
|
"types-aiofiles",
|
|
"types-requests",
|
|
]
|
|
|
|
test = [
|
|
"av",
|
|
"openai==3.6.0", # OpenAI video-client compatibility tests and the livestream app's moderator/upsampler tests; no cloud requests.
|
|
"pytorch-msssim>=1.0.0",
|
|
"pytest",
|
|
"pandas",
|
|
"plotly",
|
|
]
|
|
|
|
# Eval extras. See fastvideo/eval/README.md for which install path
|
|
# covers which metrics. detectron2 (vbench color/object_class/etc.) is
|
|
# CUDA-version-pinned and not cleanly pip-installable — install it
|
|
# separately as documented in the README. decord has no aarch64 wheels
|
|
# (upstream effectively unmaintained); it's split into its own extra so
|
|
# the main eval extras install on ARM systems too. eval/io/video.py has
|
|
# a PyAV fallback that covers the video-decode path without decord. The
|
|
# judge.* metrics (eval-judge) call a remote API and need a key, so they
|
|
# are opt-in and intentionally kept out of the default [eval] set.
|
|
eval-vbench = ["openai-clip", "pyiqa", "easydict"]
|
|
eval-vqeval = [
|
|
# MediaPipe is deliberately not declared. VQeval's anatomical-error
|
|
# detector wants the legacy mp.solutions API, which only exists in
|
|
# mediapipe 0.10.x, and every 0.10.x pins protobuf<5 (0.10.21:
|
|
# protobuf<5,>=4.25.3) -- unsatisfiable next to the base
|
|
# protobuf>=5.28.3 pin above. mediapipe 1.x dropped mp.solutions.
|
|
# Upstream's artifact_detection wraps its mediapipe import in
|
|
# try/except and reports zero anatomical errors without it.
|
|
# cv2 comes from the base opencv-python pin; declaring
|
|
# opencv-contrib-python here too would install two providers of the
|
|
# cv2 package (mixed cv2 trees on version skew). Upstream's
|
|
# cv2.quality BRISQUE path falls back to pyiqa when contrib is absent.
|
|
"open_clip_torch>=2.24.0",
|
|
"pyiqa>=0.1.10",
|
|
]
|
|
eval-physics-iq = []
|
|
eval-audio = ["jiwer", "librosa", "pyloudnorm", "hear21passt", "audiobox_aesthetics", "imagebind", "pytorchvideo"]
|
|
eval-judge = ["google-genai"]
|
|
eval = [
|
|
# ptlflow>=0.4: get_model() takes ckpt_path (0.3 called it
|
|
# pretrained_ckpt); unpinned, the resolver backtracked to 0.2.5.
|
|
"lpips", "ptlflow>=0.4", "qwen-vl-utils",
|
|
"fastvideo[eval-vbench]", "fastvideo[eval-physics-iq]",
|
|
]
|
|
eval-fast-decode = ["decord"]
|
|
eval-full = ["fastvideo[eval]", "fastvideo[eval-audio]", "fastvideo[eval-vqeval]", "qwen-omni-utils"]
|
|
|
|
dev = [ "fastvideo[lint]", "fastvideo[test]", ]
|
|
|
|
# Dependencies required by the measured FastH3 Preview profile. The pinned
|
|
# flash-attn-4 source above keeps the CuTe DSL stack reproducible for uv
|
|
# installs without putting a direct URL in published package metadata.
|
|
fasth3 = [
|
|
"flash-attn-4",
|
|
"fastvideo-kernel==0.3.5; sys_platform == 'linux'",
|
|
"quack-kernels==0.5.3",
|
|
]
|
|
|
|
prompt-safety = [
|
|
"fasttext",
|
|
]
|
|
|
|
prompt-enhancer = [
|
|
"httpx",
|
|
]
|
|
|
|
streaming = [
|
|
"fastvideo[prompt-enhancer]",
|
|
"fastvideo[prompt-safety]",
|
|
"websockets",
|
|
]
|
|
|
|
infinite-livestream = [
|
|
"av>=17,<19",
|
|
"fastapi>=0.115,<1",
|
|
"openai>=1.40",
|
|
"pyyaml>=6.0",
|
|
"uvicorn[standard]>=0.30,<1",
|
|
]
|
|
|
|
dreamverse = [
|
|
"uvicorn[standard]>=0.41.0",
|
|
"cerebras-cloud-sdk",
|
|
# PyPI forbids direct URL deps in published metadata; pin upstream cute via
|
|
# [tool.uv.sources] above (same pattern as imagebind) so the wheel stays
|
|
# publishable while uv workspace installs still get it.
|
|
"flash-attn-4",
|
|
"flashinfer-python",
|
|
"openai>=1.40",
|
|
]
|
|
|
|
rocm = [
|
|
"amdsmi",
|
|
]
|
|
|
|
# Apple Silicon FastWan release runtime. The range is intentionally pinned to
|
|
# the MLX version used for the checked-in parity and checkpoint tests.
|
|
mlx = [
|
|
"mlx>=0.31.2,<0.33; platform_system == 'Darwin' and platform_machine == 'arm64'",
|
|
]
|
|
|
|
[project.scripts]
|
|
fastvideo = "fastvideo.entrypoints.cli.main:main"
|
|
infinite-livestream-server = "infinite_livestream.server_entry:cli"
|
|
dreamverse-server = "dreamverse.server_entry:cli"
|
|
dreamverse-mock-server = "dreamverse.mock_server:cli"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = [".", "apps/dreamverse", "apps/infinite_livestream"]
|
|
exclude = ["assets*", "docker*", "docs", "scripts*", "apps*", "dreamverse.tests*",
|
|
"infinite_livestream.tests*"]
|
|
|
|
[tool.setuptools.package-data]
|
|
"fastvideo.entrypoints.openai" = ["static/*.html", "static/*.css", "static/*.js"]
|
|
dreamverse = ["prompts/*.md"]
|
|
infinite_livestream = ["configs/*.yaml", "presets/*.json", "web/*"]
|
|
"fastvideo.third_party.rife_mlx" = ["LICENSE"]
|
|
"fastvideo.third_party.taehv" = ["LICENSE"]
|
|
|
|
[tool.wheel]
|
|
exclude = ["assets*", "docker*", "docs", "scripts*", "apps*"]
|
|
|
|
[tool.pytest.ini_options]
|
|
markers = [
|
|
"gpu: requires real GPU + model weights; skip in CI",
|
|
]
|
|
|
|
|
|
[tool.mypy]
|
|
warn_unused_configs = true
|
|
ignore_missing_imports = true
|
|
disallow_untyped_calls = true
|
|
check_untyped_defs = true
|
|
follow_imports = "silent"
|
|
|
|
[tool.codespell]
|
|
# ``*/_vendored/*`` matches upstream-provenance files vendored under any
|
|
# ``_vendored/`` subdir (project-wide convention; mirrors the
|
|
# ``_``-prefixed auto-discovery skip).
|
|
skip = "./data,./wandb,apps/fastvideo_studio/package-lock.json,apps/performance_dashboard/frontend/package-lock.json,docs/package-lock.json,docs-site/package-lock.json,*/_vendored/*"
|
|
# "tread" matches daVinci-MagiHuman's acronym "TReAD" (Token Routing and
|
|
# Early Drop). codespell lowercases ignore-words entries, so the single
|
|
# lowercase form silences all case variants.
|
|
# "padd" is the literal value of Wan2.2-S2V's ``framepack_drop_mode`` in the
|
|
# published checkpoint config; it must be spelled exactly to match.
|
|
ignore-words-list = "tread,passt,dout,padd"
|
|
|
|
[tool.ruff]
|
|
# Allow lines to be as long as 120.
|
|
line-length = 120
|
|
extend-exclude = [
|
|
# Upstream submodules under fastvideo/third_party/ are not our style
|
|
# territory; modern-dep compat lives as runtime shims in our metric
|
|
# __init__.py files.
|
|
"fastvideo/third_party/**",
|
|
]
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
# pycodestyle
|
|
"E",
|
|
# Pyflakes
|
|
"F",
|
|
# pyupgrade
|
|
"UP",
|
|
# flake8-bugbear
|
|
"B",
|
|
# flake8-simplify
|
|
"SIM",
|
|
# isort
|
|
# "I",
|
|
"G",
|
|
]
|
|
ignore = [
|
|
# star imports
|
|
"F405", "F403",
|
|
# lambda expression assignment
|
|
"E731",
|
|
# Loop control variable not used within loop body
|
|
"B007",
|
|
# f-string format
|
|
"UP032",
|
|
# line too long
|
|
"E501",
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
# Ignore all files that end in `_test.py`.
|
|
"fastvideo/models/hunyuan/diffusion/pipelines/pipeline_hunyuan_video.py" = ["E741"]
|
|
|
|
|
|
[tool.yapf]
|
|
column_limit = 120
|
|
|
|
[tool.isort]
|
|
line_length = 120
|
|
use_parentheses = true
|
|
skip_gitignore = true
|
|
|
|
|
|
[project.urls]
|
|
Repository = "https://github.com/hao-ai-lab/FastVideo"
|
|
# Used by Comfy Registry https://comfyregistry.org
|
|
|
|
[tool.comfy]
|
|
PublisherId = "fastvideo"
|
|
DisplayName = "FastVideo"
|
|
Icon = "https://raw.githubusercontent.com/hao-ai-lab/FastVideo/main/comfyui/assets/icon_simple.svg"
|