diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1a4f4eb4a..4be7396c6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,82 +1,55 @@ -# Sample workflow for building and deploying a Hugo site to GitHub Pages -name: Deploy FastVideo Docs to Pages +name: Deploy Documentation on: - # Runs on pushes targeting the default branch push: - branches: - - main - paths: - - "docs/**/*.md" - - "fastvideo/examples/**/*.py" + branches: [ main ] pull_request: - branches: - - main - types: [opened, ready_for_review, synchronize, reopened] - paths: - - "docs/**/*.md" - - "fastvideo/examples/**/*.py" + branches: [ main ] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" cancel-in-progress: false -# Default to bash -defaults: - run: - shell: bash - jobs: - pre-commit: - uses: ./.github/workflows/pre-commit.yml - - # Build job build: runs-on: ubuntu-latest - needs: pre-commit steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Pages - id: pages - uses: actions/configure-pages@v5 - - name: Set up Python + + - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: '3.12' + - name: Install dependencies run: | - cd docs - pip install -r requirements-docs.txt - - name: Build docs - run: | - cd docs - make clean - make html + python -m pip install --upgrade pip + pip install -r requirements-mkdocs.txt + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Build documentation + run: mkdocs build + - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - path: ./docs/build/html + path: ./site - # Deployment job deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - if: ${{ github.event_name == 'push' }} runs-on: ubuntu-latest needs: build + if: github.ref == 'refs/heads/main' steps: - name: Deploy to GitHub Pages id: deployment diff --git a/.gitignore b/.gitignore index bb17640a5..c4023db07 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ wandb/ *.pt cache_dir/ wandb/ +venv/ +.venv/ runs/ samples/ *validation/ @@ -37,12 +39,13 @@ dist/ eggs/ .eggs/ -# Sphinx documentation -docs/_build/ -docs/source/getting_started/examples/ -docs/source/inference/examples/ -docs/source/training/examples/ -docs/source/distillation/examples/ +# MkDocs documentation +site/ +docs/getting_started/examples/ +docs/inference/examples/ +docs/training/examples/ +docs/distillation/examples/ +!requirements-mkdocs.txt # VSCode .vscode/ @@ -61,7 +64,7 @@ docs/source/distillation/examples/ !fastvideo/tests/ssim/reference_videos/**/*.mp4 # Static images -!docs/source/_static/images/**/*.png +!docs/assets/images/**/*.png !comfyui/assets/**/*.png !comfyui/assets/**/*.gif diff --git a/csrc/attn/sliding_tile_attn/README.md b/csrc/attn/sliding_tile_attn/README.md index 38c708115..4c6bfcb47 100644 --- a/csrc/attn/sliding_tile_attn/README.md +++ b/csrc/attn/sliding_tile_attn/README.md @@ -77,7 +77,7 @@ https://github.com/user-attachments/assets/f3b6dd79-7b43-4b60-a0fa-3d6495ec5747 Here is a diagram of how the window is configured and passed through the FastVideo pipeline:
- +
diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 3745dc403..000000000 --- a/docs/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -clean: - @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - rm -rf "$(SOURCEDIR)/getting_started/examples" - rm -rf "$(SOURCEDIR)/inference/examples" - rm -rf "$(SOURCEDIR)/training/examples" diff --git a/docs/README.md b/docs/README.md index 0a3151ad7..0bcab3afc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,20 +1,39 @@ -# FastVideo documents +# FastVideo Documentation -## Build the docs +This directory contains the FastVideo documentation built with MkDocs. + +## Build the docs locally ```bash -# Install dependencies. -pip install -r requirements-docs.txt +# Install dependencies +pip install -r docs/requirements-mkdocs.txt -# Build the docs. -make clean -make html +# Serve docs with live reload (recommended for development) +mkdocs serve + +# Or build static site +mkdocs build ``` -## Open the docs with your browser +## View the docs + +### Development server (with live reload) ```bash -python -m http.server -d build/html/ +mkdocs serve ``` -Launch your browser and open localhost:8000. +Then open your browser to: http://127.0.0.1:8000 + +### Static build + +```bash +mkdocs build +python -m http.server -d site/ +``` + +Then open your browser to: http://localhost:8000 + +## Automatic Deployment + +Documentation is automatically built and deployed to GitHub Pages when changes are pushed to the `main` branch via the `.github/workflows/docs.yml` workflow. diff --git a/docs/api/fastvideo.md b/docs/api/fastvideo.md new file mode 100644 index 000000000..2f81a3995 --- /dev/null +++ b/docs/api/fastvideo.md @@ -0,0 +1,248 @@ +# FastVideo API Reference + +This page contains the complete API reference for the FastVideo library. + +## fastvideo + +### Modules + +| Name | Description | +|------|-------------| +| [attention](#fastvideoattention) | Attention mechanisms and backends for video generation | +| [configs](#fastvideoconfigs) | Configuration classes for pipelines, models, and sampling | +| [distributed](#fastvideodistributed) | Distributed execution and communication utilities | +| [entrypoints](#fastvideoentrypoints) | Main API entry points for video generation | +| [models](#fastvideomodels) | Model implementations (transformers, VAEs, schedulers) | +| [pipelines](#fastvideopipelines) | Core pipeline classes for video diffusion | +| [training](#fastvideotraining) | Training utilities and helpers | +| [workflow](#fastvideoworkflow) | Workflow management and orchestration | +| [dataset](#fastvideodataset) | Dataset handling and preprocessing | +| [layers](#fastvideolayers) | Custom neural network layers | +| [platforms](#fastvideoplatforms) | Platform-specific implementations | +| [utils](#fastvideoutils) | Utility functions and helpers | +| [worker](#fastvideoworker) | Execution workers for video generation | + +## fastvideo.attention + +::: fastvideo.attention + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +## fastvideo.configs + +::: fastvideo.configs + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +### Submodules + +#### fastvideo.configs.pipelines + +::: fastvideo.configs.pipelines + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +#### fastvideo.configs.models + +::: fastvideo.configs.models + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +#### fastvideo.configs.sample + +::: fastvideo.configs.sample + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +## fastvideo.distributed + +::: fastvideo.distributed + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +## fastvideo.entrypoints + +::: fastvideo.entrypoints + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +## fastvideo.models + +::: fastvideo.models + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +### Submodules + +#### fastvideo.models.registry + +::: fastvideo.models.registry + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +#### fastvideo.models.loader + +::: fastvideo.models.loader + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +## fastvideo.pipelines + +::: fastvideo.pipelines + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +### Submodules + +#### fastvideo.pipelines.composed_pipeline_base + +::: fastvideo.pipelines.composed_pipeline_base + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +#### fastvideo.pipelines.lora_pipeline + +::: fastvideo.pipelines.lora_pipeline + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +#### fastvideo.pipelines.pipeline_batch_info + +::: fastvideo.pipelines.pipeline_batch_info + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +#### fastvideo.pipelines.pipeline_registry + +::: fastvideo.pipelines.pipeline_registry + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +#### fastvideo.pipelines.stages + +::: fastvideo.pipelines.stages + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 4 + +## fastvideo.training + +::: fastvideo.training + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +## fastvideo.workflow + +::: fastvideo.workflow + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +## fastvideo.dataset + +::: fastvideo.dataset + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +## fastvideo.layers + +::: fastvideo.layers + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +## fastvideo.platforms + +::: fastvideo.platforms + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 + +## fastvideo.utils + +::: fastvideo.utils + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + heading_level: 3 + +## fastvideo.worker + +::: fastvideo.worker + options: + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_submodules: true + heading_level: 3 diff --git a/docs/api/summary.md b/docs/api/summary.md new file mode 100644 index 000000000..76d751a63 --- /dev/null +++ b/docs/api/summary.md @@ -0,0 +1,27 @@ +# API Summary + +This page provides a quick overview of the main FastVideo API components. + +## Video Generator + +::: fastvideo.VideoGenerator + options: + show_root_heading: false + show_source: false + heading_level: 3 + +## Initialization Configuration + +::: fastvideo.PipelineConfig + options: + show_root_heading: false + show_source: false + heading_level: 3 + +## Sampling Configuration + +::: fastvideo.SamplingParam + options: + show_root_heading: false + show_source: false + heading_level: 3 diff --git a/docs/assets/custom.css b/docs/assets/custom.css new file mode 100644 index 000000000..7bf389a10 --- /dev/null +++ b/docs/assets/custom.css @@ -0,0 +1,41 @@ +.vertical-table-header th.head:not(.stub) { + writing-mode: sideways-lr; + white-space: nowrap; + max-width: 0; + p { + margin: 0; + } +} + +/* Image sizing classes */ +.image-small { + max-width: 200px; + height: auto; +} + +.image-medium { + max-width: 400px; + height: auto; +} + +.image-large { + max-width: 600px; + height: auto; +} + +.image-full { + max-width: 100%; + height: auto; +} + +/* Responsive images */ +img { + max-width: 100%; + height: auto; +} + +/* Center images */ +.image-center { + display: block; + margin: 0 auto; +} diff --git a/docs/source/_static/custom.js b/docs/assets/custom.js similarity index 100% rename from docs/source/_static/custom.js rename to docs/assets/custom.js diff --git a/docs/assets/images/STA_configuration.png b/docs/assets/images/STA_configuration.png new file mode 100644 index 000000000..7b96e9b53 Binary files /dev/null and b/docs/assets/images/STA_configuration.png differ diff --git a/docs/source/_static/images/fastwan.png b/docs/assets/images/fastwan.png similarity index 100% rename from docs/source/_static/images/fastwan.png rename to docs/assets/images/fastwan.png diff --git a/docs/source/_static/images/perf.png b/docs/assets/images/perf.png similarity index 100% rename from docs/source/_static/images/perf.png rename to docs/assets/images/perf.png diff --git a/docs/source/_static/images/runpod_cuda.png b/docs/assets/images/runpod_cuda.png similarity index 100% rename from docs/source/_static/images/runpod_cuda.png rename to docs/assets/images/runpod_cuda.png diff --git a/docs/source/_static/images/runpod_ssh.png b/docs/assets/images/runpod_ssh.png similarity index 100% rename from docs/source/_static/images/runpod_ssh.png rename to docs/assets/images/runpod_ssh.png diff --git a/docs/source/_static/images/runpod_template.png b/docs/assets/images/runpod_template.png similarity index 100% rename from docs/source/_static/images/runpod_template.png rename to docs/assets/images/runpod_template.png diff --git a/docs/assets/logos/icon_simple.svg b/docs/assets/logos/icon_simple.svg new file mode 100644 index 000000000..414643899 --- /dev/null +++ b/docs/assets/logos/icon_simple.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/assets/logos/logo.svg b/docs/assets/logos/logo.svg new file mode 100644 index 000000000..0b8b058b5 --- /dev/null +++ b/docs/assets/logos/logo.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/docs/source/contributing/developer_env/docker.md b/docs/contributing/developer_env/docker.md similarity index 98% rename from docs/source/contributing/developer_env/docker.md rename to docs/contributing/developer_env/docker.md index c8f411261..0de910e81 100644 --- a/docs/source/contributing/developer_env/docker.md +++ b/docs/contributing/developer_env/docker.md @@ -1,4 +1,4 @@ -(docker)= + # 🐳 Using the FastVideo Docker Image If you prefer a containerized development environment or want to avoid managing dependencies manually, you can use our prebuilt Docker image: diff --git a/docs/source/contributing/developer_env/index.md b/docs/contributing/developer_env/index.md similarity index 75% rename from docs/source/contributing/developer_env/index.md rename to docs/contributing/developer_env/index.md index 56a63a877..a093eda94 100644 --- a/docs/source/contributing/developer_env/index.md +++ b/docs/contributing/developer_env/index.md @@ -3,11 +3,3 @@ # 🧰 Developer Environment Accelerate your FastVideo development workflow by leveraging Docker images and cloud GPUs for efficient experimentation and reproducible environments. - -:::{toctree} -:caption: Contents -:maxdepth: 1 - -docker -runpod -::: diff --git a/docs/source/contributing/developer_env/runpod.md b/docs/contributing/developer_env/runpod.md similarity index 86% rename from docs/source/contributing/developer_env/runpod.md rename to docs/contributing/developer_env/runpod.md index 8ebe07015..0e6cb11ca 100644 --- a/docs/source/contributing/developer_env/runpod.md +++ b/docs/contributing/developer_env/runpod.md @@ -1,4 +1,3 @@ -(runpod)= # 📦 Developing FastVideo on RunPod @@ -10,7 +9,7 @@ Choose a GPU that supports CUDA 12.8 Pick 1 or 2 L40S GPU(s) -![RunPod CUDA selection](../../_static/images/runpod_cuda.png) +![RunPod CUDA selection](../../assets/images/runpod_cuda.png) When creating your pod template, use this image: @@ -24,11 +23,11 @@ Paste Container Start Command to support SSH ([RunPod Docs](https://docs.runpod. bash -c "apt update;DEBIAN_FRONTEND=noninteractive apt-get install openssh-server -y;mkdir -p ~/.ssh;cd $_;chmod 700 ~/.ssh;echo \"$PUBLIC_KEY\" >> authorized_keys;chmod 700 authorized_keys;service ssh start;sleep infinity" ``` -![RunPod template configuration](../../_static/images/runpod_template.png) +![RunPod template configuration](../../assets/images/runpod_template.png) After deploying, the pod will take a few minutes to pull the image and start the SSH service. -![RunPod ssh](../../_static/images/runpod_ssh.png) +![RunPod ssh](../../assets/images/runpod_ssh.png) ## Working with the pod diff --git a/docs/source/contributing/overview.md b/docs/contributing/overview.md similarity index 98% rename from docs/source/contributing/overview.md rename to docs/contributing/overview.md index eee1d80c5..27a07ceb9 100644 --- a/docs/source/contributing/overview.md +++ b/docs/contributing/overview.md @@ -1,4 +1,3 @@ -(developer-overview)= # 🛠️ Contributing to FastVideo diff --git a/docs/source/contributing/profiling.md b/docs/contributing/profiling.md similarity index 100% rename from docs/source/contributing/profiling.md rename to docs/contributing/profiling.md diff --git a/docs/source/design/overview.md b/docs/design/overview.md similarity index 97% rename from docs/source/design/overview.md rename to docs/design/overview.md index b38ebbbd8..49c53f694 100644 --- a/docs/source/design/overview.md +++ b/docs/design/overview.md @@ -29,7 +29,6 @@ FastVideo separates model components from execution logic with these principles: - **Custom Attention Backends**: Components can support and use different Attention implementations - **Pipeline Abstraction**: Consistent interface across diffusion models -(design-fastvideo-args)= ## FastVideoArgs The `FastVideoArgs` class in `fastvideo/fastvideo_args.py` serves as the central configuration system for FastVideo. It contains all parameters needed to control model loading, inference configuration, performance optimization settings, and more. @@ -61,7 +60,6 @@ with set_current_fastvideo_args(fastvideo_args): result = generate_video() ``` -(design-pipeline-system)= ## Pipeline System ### `ComposedPipelineBase` @@ -108,7 +106,6 @@ def forward(self, batch: ForwardBatch, fastvideo_args: FastVideoArgs) -> Forward return batch ``` -(design-forwardbatch)= ### ForwardBatch Defined in `fastvideo/pipelines/pipeline_batch_info.py`, `ForwardBatch` encapsulates the data payload passed between pipeline stages. It typically holds: @@ -120,12 +117,10 @@ Defined in `fastvideo/pipelines/pipeline_batch_info.py`, `ForwardBatch` encapsul This structure facilitates clear state transitions between stages. -(design-model-components)= ## Model Components The `fastvideo/models/` directory contains implementations of the core neural network models used in video diffusion: -(design-transformer-models)= ### Transformer Models Transformer networks perform the actual denoising during diffusion: @@ -152,7 +147,6 @@ def forward( return noise_pred # Predicted noise residual ``` -(design-vae-variational-auto-encoder)= ### VAE (Variational Auto-Encoder) VAEs handle conversion between pixel space and latent space: @@ -170,7 +164,6 @@ FastVideo's VAE implementations include: - Optional tiling for large frames - Distributed weight support -(design-text-and-image-encoders)= ### Text and Image Encoders Encoders process conditioning inputs into embeddings: @@ -188,7 +181,6 @@ FastVideo implements optimizations such as: - Caching for common prompts - Precision-tuned computation -(design-schedulers)= ### Schedulers Schedulers manage the diffusion sampling process: @@ -216,7 +208,6 @@ def step( return prev_sample ``` -(design-optimized-attention)= ## Optimized Attention The `fastvideo/attention/` directory contains optimized attention implementations crucial for efficient video diffusion: @@ -245,12 +236,10 @@ Supports various patterns with memory optimization techniques: - **Cross/Self/Temporal/Global-Local Attention** - Chunking, progressive computation, optimized masking -(design-distributed-processing)= ## Distributed Processing The `fastvideo/distributed/` directory contains implementations for distributed model execution: -(design-tensor-parallelism)= ### Tensor Parallelism Tensor parallelism splits model weights across devices: @@ -307,7 +296,6 @@ Efficient communication primitives minimize distributed overhead: - **Tensor-Parallel AllReduce**: Combines partial results - **Distributed Synchronization**: Coordinates execution -(design-forwardcontext)= ## Forward Context Management ### ForwardContext @@ -330,7 +318,6 @@ with set_forward_context(current_timestep, attn_metadata, fastvideo_args): output = model(inputs) ``` -(design-executor-and-worker-abstractions)= ## Executor and Worker System The `fastvideo/worker/` directory contains the distributed execution framework: @@ -357,7 +344,6 @@ Each GPU worker: This design allows FastVideo to efficiently utilize multiple GPUs while providing a simple, unified interface for model execution. -(design-platforms)= ## Platforms The `fastvideo/platforms/` directory provides hardware platform abstractions that enable FastVideo to run efficiently on different hardware configurations: @@ -388,7 +374,6 @@ else: The platform system is designed to be extensible for future hardware targets. -(design-logger)= ## Logger See [PR](https://github.com/hao-ai-lab/FastVideo/pull/356) diff --git a/docs/source/distillation/data_preprocess.md b/docs/distillation/data_preprocess.md similarity index 98% rename from docs/source/distillation/data_preprocess.md rename to docs/distillation/data_preprocess.md index 9388d804d..0b0824a55 100644 --- a/docs/source/distillation/data_preprocess.md +++ b/docs/distillation/data_preprocess.md @@ -1,4 +1,3 @@ -(v0-data-preprocess)= # 🧱 Data Preprocess for Distillation diff --git a/docs/source/distillation/dmd.md b/docs/distillation/dmd.md similarity index 100% rename from docs/source/distillation/dmd.md rename to docs/distillation/dmd.md diff --git a/docs/examples/examples_index.md b/docs/examples/examples_index.md new file mode 100644 index 000000000..d77a201bb --- /dev/null +++ b/docs/examples/examples_index.md @@ -0,0 +1,12 @@ +# 💡 Examples + +A collection of examples demonstrating usage of FastVideo. + +All documented examples are autogenerated using [generate_examples.py](https://github.com/hao-ai-lab/FastVideo/blob/main/docs/generate_examples.py) from examples found in the [examples](https://github.com/hao-ai-lab/FastVideo/tree/main/examples) directory. + +## Examples + +- [Examples Distillation Index](distillation/examples/examples_distillation_index.md) +- [Examples Training Index](training/examples/examples_training_index.md) +- [Examples Inference Index](inference/examples/examples_inference_index.md) + diff --git a/docs/source/generate_examples.py b/docs/generate_examples.py similarity index 76% rename from docs/source/generate_examples.py rename to docs/generate_examples.py index a2e4f6696..500f41759 100644 --- a/docs/source/generate_examples.py +++ b/docs/generate_examples.py @@ -6,10 +6,11 @@ import re from dataclasses import dataclass, field from pathlib import Path -ROOT_DIR = Path(__file__).parent.parent.parent.resolve() -ROOT_DIR_RELATIVE = '../../../..' +ROOT_DIR = Path(__file__).parent.parent.resolve() +ROOT_DIR_RELATIVE = '../..' EXAMPLE_DIR = ROOT_DIR / "examples" -EXAMPLE_DOC_DIR = ROOT_DIR / "docs/source/getting_started/examples" +EXAMPLE_DOC_DIR = ROOT_DIR / "docs/getting_started/examples" +GITHUB_REPO = "hao-ai-lab/FastVideo" # Update this to your repo def fix_case(text: str) -> str: @@ -71,9 +72,16 @@ class Index: def generate(self) -> str: content = f"# {self.title}\n\n{self.description}\n\n" - content += ":::{toctree}\n" - content += f":caption: {self.caption}\n:maxdepth: {self.maxdepth}\n" - content += "\n".join(self.documents) + "\n:::\n" + if self.caption: + content += f"## {self.caption}\n\n" + # Generate a simple list of links for MkDocs + for doc in self.documents: + # Convert document path to proper link + doc_link = doc.replace("\\", "/") + # Get just the filename for the link text + doc_title = fix_case(Path(doc).stem.replace("_", " ").title()) + content += f"- [{doc_title}]({doc_link}.md)\n" + content += "\n" return content @@ -142,30 +150,66 @@ class Example: return fix_case(self.path.stem.replace("_", " ").title()) def generate(self) -> str: - # Convert the path to a relative path from __file__ - make_relative = lambda path: ROOT_DIR_RELATIVE / path.relative_to( - ROOT_DIR) + # Create GitHub link to source + github_path = str(self.path.relative_to(ROOT_DIR)).replace("\\", "/") + github_url = f"https://github.com/{GITHUB_REPO}/blob/main/{github_path}" + content = f"**Source:** [{github_path}]({github_url})\n\n" - content = f"Source .\n\n" - include = "include" if self.main_file.suffix == ".md" else \ - "literalinclude" - if include == "literalinclude": + # Add title for code files + if self.main_file.suffix != ".md": content += f"# {self.title}\n\n" - content += f":::{{{include}}} {make_relative(self.main_file)}\n" # type: ignore[no-untyped-call] - if include == "literalinclude": - content += f":language: {self.main_file.suffix[1:]}\n" - content += ":::\n\n" + + # Include main file content + if self.main_file.suffix == ".md": + # For markdown files, include the content directly + with open(self.main_file, encoding='utf-8') as f: + content += f.read() + "\n\n" + else: + # For code files, use code blocks + language = self.main_file.suffix[1:] if self.main_file.suffix else "" + with open(self.main_file, encoding='utf-8') as f: + file_content = f.read() + content += f"```{language}\n{file_content}\n```\n\n" if not self.other_files: return content - content += "## Example materials\n\n" + content += "## Additional Files\n\n" + # Define binary/non-text file extensions to skip + binary_extensions = { + '.mp4', '.avi', '.mov', '.mkv', '.gif', '.jpg', '.jpeg', '.png', + '.webp', '.bmp', '.pdf', '.zip', '.tar', '.gz', '.mp3', '.wav' + } + for file in sorted(self.other_files): - include = "include" if file.suffix == ".md" else "literalinclude" - content += f":::{{admonition}} {file.relative_to(self.path)}\n" - content += ":class: dropdown\n\n" - content += f":::{{{include}}} {make_relative(file)}\n:::\n" # type: ignore[no-untyped-call] - content += ":::\n\n" + # Skip binary files + if file.suffix.lower() in binary_extensions: + continue + + file_rel_path = file.relative_to(self.path) + # Use collapsible admonition syntax for MkDocs + content += f"??? note \"{file_rel_path}\"\n\n" + + try: + if file.suffix == ".md": + # Include markdown content with indentation + with open(file, encoding='utf-8') as f: + for line in f: + content += f" {line}" + else: + # Include code with proper formatting + language = file.suffix[1:] if file.suffix else "" + with open(file, encoding='utf-8') as f: + file_content = f.read() + # Indent the code block for the admonition + content += f" ```{language}\n" + for line in file_content.split('\n'): + content += f" {line}\n" + content += " ```\n" + content += "\n" + except UnicodeDecodeError: + # Skip files that can't be decoded as UTF-8 + continue return content @@ -195,7 +239,7 @@ class NestedStructure: def create_category_indices() -> dict[str, Index]: """Create category indices with their respective configurations.""" - main_index_dir = ROOT_DIR / "docs/source/examples" + main_index_dir = ROOT_DIR / "docs/examples" if not main_index_dir.exists(): main_index_dir.mkdir(parents=True) @@ -203,17 +247,16 @@ def create_category_indices() -> dict[str, Index]: "inference": Index( path=ROOT_DIR / - "docs/source/inference/examples/examples_inference_index.md", + "docs/inference/examples/examples_inference_index.md", title="🚀 Examples", description= - "Inference examples demonstrate how to use FastVideo inference. We recommend starting with .", + "Inference examples demonstrate how to use FastVideo inference. We recommend starting with [basic.md](basic.md).", caption="Examples", maxdepth=1, ), "training": Index( - path=ROOT_DIR / - "docs/source/training/examples/examples_training_index.md", + path=ROOT_DIR / "docs/training/examples/examples_training_index.md", title="🚀 Examples", description= "Training examples demonstrate how to use FastVideo training.", @@ -223,7 +266,7 @@ def create_category_indices() -> dict[str, Index]: "distillation": Index( path=ROOT_DIR / - "docs/source/distillation/examples/examples_distillation_index.md", + "docs/distillation/examples/examples_distillation_index.md", title="🚀 Examples", description= "Distillation examples demonstrate how to use FastVideo distillation.", @@ -246,9 +289,21 @@ def find_examples(category_indices: dict[str, Index], examples = [] glob_patterns = ["*.py", "*.md", "*.sh"] + # Map category names to actual directory names + category_dir_mapping = { + "distillation": "distill", # examples/distill/ -> distillation category + } + # Find categorised examples for category in category_indices: - category_dir = EXAMPLE_DIR / category + # Use mapped directory name if available, otherwise use category name + dir_name = category_dir_mapping.get(category, category) + category_dir = EXAMPLE_DIR / dir_name + + # Skip if directory doesn't exist + if not category_dir.exists(): + continue + globs = [category_dir.glob(pattern) for pattern in glob_patterns] for path in itertools.chain(*globs): examples.append(Example(path, category)) @@ -279,11 +334,18 @@ def create_nested_structures( dict[str, NestedStructure]]]] = {} + # Map category names to actual directory names + category_dir_mapping = { + "distillation": "distill", + } + for example in examples: if example.category not in ["training", "distillation"]: continue - category_dir = EXAMPLE_DIR / example.category + # Use mapped directory name if available + dir_name = category_dir_mapping.get(example.category, example.category) + category_dir = EXAMPLE_DIR / dir_name relative_path = example.path.relative_to(category_dir) path_parts = relative_path.parts @@ -415,7 +477,7 @@ def generate_nested_examples(nested_structures: dict[str, dict[str, dict[ category_index.documents.append(method) -def generate_examples(generate_main_index=False): +def generate_examples(generate_main_index: bool = False) -> None: """ Generate example documentation. @@ -429,12 +491,14 @@ def generate_examples(generate_main_index=False): # Create the main examples index only if requested examples_index = None if generate_main_index: - main_index_dir = ROOT_DIR / "docs/source/examples" + main_index_dir = ROOT_DIR / "docs/examples" examples_index = Index( path=main_index_dir / "examples_index.md", title="💡 Examples", description= - "A collection of examples demonstrating usage of FastVideo.\nAll documented examples are autogenerated using from examples found in .", + "A collection of examples demonstrating usage of FastVideo.\n\n" + f"All documented examples are autogenerated using [generate_examples.py](https://github.com/{GITHUB_REPO}/blob/main/docs/generate_examples.py) " + f"from examples found in the [examples](https://github.com/{GITHUB_REPO}/tree/main/examples) directory.", caption="Examples", maxdepth=2) @@ -471,3 +535,19 @@ def generate_examples(generate_main_index=False): if generate_main_index and examples_index: with open(examples_index.path, "w+") as f: f.write(examples_index.generate()) + + +def on_pre_build_hook(config, **kwargs): + """ + MkDocs hook to generate examples before building the documentation. + This function is called automatically by the mkdocs-simple-hooks plugin. + """ + print("Generating example documentation...") + generate_examples(generate_main_index=True) + print("Example documentation generated successfully!") + + +if __name__ == "__main__": + print("Generating example documentation...") + generate_examples(generate_main_index=True) + print("Example documentation generated successfully!") diff --git a/docs/getting_started/installation.md b/docs/getting_started/installation.md new file mode 100644 index 000000000..6961a5d26 --- /dev/null +++ b/docs/getting_started/installation.md @@ -0,0 +1,41 @@ + +# 🔧 Installation + +FastVideo supports the following hardware platforms: + +- [NVIDIA CUDA](installation/gpu.md) +- [Apple silicon](installation/mps.md) + +## Quick Installation + +### Using pip + +```bash +pip install fastvideo +``` + +### Using conda + +```bash +conda install -c conda-forge fastvideo +``` + +### From source + +```bash +git clone https://github.com/hao-ai-lab/FastVideo.git +cd FastVideo +pip install -e . +``` + +## Hardware Requirements + +- **NVIDIA GPUs**: CUDA 11.8+ with compute capability 7.0+ +- **Apple Silicon**: macOS 12.0+ with M1/M2/M3 chips +- **CPU**: x86_64 architecture (for CPU-only inference) + +## Next Steps + +- [Quick Start Guide](quick_start.md) - Get started with your first video generation +- [Configuration](../inference/configuration.md) - Learn about configuration options +- [Examples](../inference/examples/) - Explore example scripts and notebooks diff --git a/docs/source/getting_started/installation/gpu.md b/docs/getting_started/installation/gpu.md similarity index 86% rename from docs/source/getting_started/installation/gpu.md rename to docs/getting_started/installation/gpu.md index 5b663d3fe..9d090b0bd 100644 --- a/docs/source/getting_started/installation/gpu.md +++ b/docs/getting_started/installation/gpu.md @@ -30,17 +30,8 @@ conda create -n fastvideo python=3.12 -y conda activate fastvideo ``` -:::{note} -[PyTorch has deprecated the conda release channel](https://github.com/pytorch/pytorch/issues/138506). If you use `conda`, please only use it to create Python environment rather than installing packages. -::: - #### uv -:::{tip} -We highly recommend using `uv` to install FastVideo. In our experience, `uv` speeds up installation by at least 3x. -Note that you can also use `uv` to install FastVideo in a Conda environment. -::: - Or you can create a new Python environment using [uv](https://docs.astral.sh/uv/), a very fast Python environment manager. Please follow the [documentation](https://docs.astral.sh/uv/#getting-started) to install `uv`. After installing `uv`, you can create a new Python environment using the following command: ```console diff --git a/docs/source/getting_started/installation/mps.md b/docs/getting_started/installation/mps.md similarity index 84% rename from docs/source/getting_started/installation/mps.md rename to docs/getting_started/installation/mps.md index 7f4091885..68b348872 100644 --- a/docs/source/getting_started/installation/mps.md +++ b/docs/getting_started/installation/mps.md @@ -31,17 +31,8 @@ conda create -n fastvideo python=3.12.4 -y conda activate fastvideo ``` -:::{note} -[PyTorch has deprecated the conda release channel](https://github.com/pytorch/pytorch/issues/138506). If you use `conda`, please only use it to create Python environment rather than installing packages. -::: - #### uv -:::{tip} -We highly recommend using `uv` to install FastVideo. In our experience, `uv` speeds up installation by at least 3x. -Note that you can also use `uv` to install FastVideo in a Conda environment. -::: - Or you can create a new Python environment using [uv](https://docs.astral.sh/uv/), a very fast Python environment manager. Please follow the [documentation](https://docs.astral.sh/uv/#getting-started) to install `uv`. After installing `uv`, you can create a new Python environment using the following command: ```console diff --git a/docs/getting_started/quick_start.md b/docs/getting_started/quick_start.md new file mode 100644 index 000000000..f6db8620f --- /dev/null +++ b/docs/getting_started/quick_start.md @@ -0,0 +1,55 @@ +# 🚀 Quick Start + +Get up and running with FastVideo in minutes! + +## Installation + +First, install FastVideo: + +```bash +pip install fastvideo +``` + +## Basic Usage + +### Text-to-Video Generation + +```python +from fastvideo import FastVideoPipeline + +# Initialize the pipeline +pipe = FastVideoPipeline.from_pretrained("wan2.1-t2v-1.3B") + +# Generate a video +prompt = "A cat playing with a ball of yarn" +video = pipe(prompt, num_frames=16, height=512, width=512) + +# Save the video +video.save("output.mp4") +``` + +### Image-to-Video Generation + +```python +from fastvideo import FastVideoPipeline +from PIL import Image + +# Load an image +image = Image.open("input.jpg") + +# Initialize the pipeline +pipe = FastVideoPipeline.from_pretrained("wan2.1-i2v-14B-480p") + +# Generate a video from the image +video = pipe(image, num_frames=16, height=480, width=480) + +# Save the video +video.save("output.mp4") +``` + +## Next Steps + +- [Installation Guide](installation.md) - Detailed installation instructions +- [Configuration](../inference/configuration.md) - Learn about configuration options +- [Examples](../inference/examples/) - Explore more examples +- [Optimizations](../inference/optimizations.md) - Performance optimization tips diff --git a/docs/getting_started/v1_api.md b/docs/getting_started/v1_api.md new file mode 100644 index 000000000..52292fd66 --- /dev/null +++ b/docs/getting_started/v1_api.md @@ -0,0 +1,42 @@ +# V1 API + +FastVideo's V1 API provides a streamlined interface for video generation tasks with powerful customization options. This page documents the primary components of the API. + +## Video Generator + +This class will be the primary Python API for generating videos and images. + +::: fastvideo.entrypoints.video_generator.VideoGenerator + options: + show_root_heading: true + show_source: false + members: + - from_pretrained + heading_level: 3 + +`VideoGenerator.from_pretrained()` should be the primary way of creating a new video generator. + +## Configuring FastVideo + +The following two classes `PipelineConfig` and `SamplingParam` are used to configure initialization and sampling parameters, respectively. + +### PipelineConfig + +::: fastvideo.configs.pipelines.base.PipelineConfig + options: + show_root_heading: true + show_source: false + members: + - from_pretrained + - dump_to_json + heading_level: 4 + +### SamplingParam + +::: fastvideo.configs.sample.base.SamplingParam + options: + show_root_heading: true + show_source: false + members: + - from_pretrained + heading_level: 4 diff --git a/docs/source/index.md b/docs/index.md similarity index 54% rename from docs/source/index.md rename to docs/index.md index 9027a8429..8499f0004 100644 --- a/docs/source/index.md +++ b/docs/index.md @@ -1,30 +1,24 @@ # Welcome to FastVideo -:::{figure} ../../assets/logos/logo.svg -:align: center -:alt: FastVideo -:class: no-scaled-link -:width: 60% -::: +
+ FastVideo +
-:::{raw} html -

-FastVideo is a unified inference and post-training framework for accelerated video generation. - -

+
+FastVideo is a unified inference and post-training framework for accelerated video generation. +
-

+

Star Watch Fork -

-::: +
FastVideo is an inference and post-training framework for diffusion models. It features an end-to-end unified pipeline for accelerating diffusion models, starting from data preprocessing to model training, finetuning, distillation, and inference. FastVideo is designed to be modular and extensible, allowing users to easily add new optimizations and techniques. Whether it is training-free optimizations or post-training optimizations, FastVideo has you covered.
- +
## Key Features @@ -42,91 +36,16 @@ FastVideo has the following features: ## Documentation -% How to start using FastVideo? +Welcome to FastVideo! This documentation will help you get started with our unified inference and post-training framework for accelerated video generation. -:::{toctree} -:caption: Getting Started -:maxdepth: 1 +Use the navigation menu on the left to explore different sections: -getting_started/installation - -::: - -:::{toctree} -:caption: Inference -:maxdepth: 1 - -inference/inference_quick_start -inference/examples/examples_inference_index -inference/configuration -inference/optimizations -inference/comfyui -inference/support_matrix -inference/cli -inference/add_pipeline -::: - -:::{toctree} -:caption: Training -:maxdepth: 1 - -training/examples/examples_training_index -training/data_preprocess - -::: - -:::{toctree} -:caption: Distillation -:maxdepth: 1 - -distillation/examples/examples_distillation_index -distillation/data_preprocess -distillation/dmd -::: - -% What is STA Kernel? - -:::{toctree} -:caption: Sliding Tile Attention -:maxdepth: 1 - -sliding_tile_attention/installation -sliding_tile_attention/demo -::: - -% What is VSA Kernel? - -:::{toctree} -:caption: Video Sparse Attention -:maxdepth: 1 - -video_sparse_attention/installation -::: - -:::{toctree} -:caption: Design -:maxdepth: 1 -design/overview -::: - -:::{toctree} -:caption: Developer Guide -:maxdepth: 2 - -contributing/overview -contributing/developer_env/index -contributing/profiling -::: - -:::{toctree} -:caption: API Reference -:maxdepth: 2 - - -api/fastvideo/fastvideo -::: - -## Indices and tables - -- {ref}`genindex` -- {ref}`modindex` +- **Getting Started**: Installation and quick start guides +- **Inference**: Learn how to use FastVideo for video generation +- **Training**: Data preprocessing and fine-tuning workflows +- **Distillation**: Post-training optimization techniques +- **Sliding Tile Attention**: Advanced attention mechanisms +- **Video Sparse Attention**: Efficient attention for video models +- **Design**: Framework architecture and design principles +- **Developer Guide**: Contributing and development setup +- **API Reference**: Complete API documentation diff --git a/docs/source/inference/add_pipeline.md b/docs/inference/add_pipeline.md similarity index 99% rename from docs/source/inference/add_pipeline.md rename to docs/inference/add_pipeline.md index dafa5fadf..5cf1501e7 100644 --- a/docs/source/inference/add_pipeline.md +++ b/docs/inference/add_pipeline.md @@ -1,4 +1,3 @@ -(add-pipeline)= # 🏗️ Adding a New Pipeline diff --git a/docs/source/inference/cli.md b/docs/inference/cli.md similarity index 100% rename from docs/source/inference/cli.md rename to docs/inference/cli.md diff --git a/docs/source/inference/comfyui.md b/docs/inference/comfyui.md similarity index 100% rename from docs/source/inference/comfyui.md rename to docs/inference/comfyui.md diff --git a/docs/source/inference/configuration.md b/docs/inference/configuration.md similarity index 98% rename from docs/source/inference/configuration.md rename to docs/inference/configuration.md index 6462931d0..feb8c594c 100644 --- a/docs/source/inference/configuration.md +++ b/docs/inference/configuration.md @@ -1,4 +1,4 @@ -(inference-configuration)= + # Configuration ## Multi-GPU Setup diff --git a/docs/source/inference/inference_quick_start.md b/docs/inference/inference_quick_start.md similarity index 100% rename from docs/source/inference/inference_quick_start.md rename to docs/inference/inference_quick_start.md diff --git a/docs/source/inference/optimizations.md b/docs/inference/optimizations.md similarity index 94% rename from docs/source/inference/optimizations.md rename to docs/inference/optimizations.md index 0774bf500..ec8bc69a0 100644 --- a/docs/source/inference/optimizations.md +++ b/docs/inference/optimizations.md @@ -1,4 +1,3 @@ -(inference-optimizations)= # Optimizations @@ -16,8 +15,6 @@ This page describes the various options for speeding up generation times in Fast - Caching Techniques - [TeaCache](#optimizations-teacache) -(optimizations-backends)= - ## Attention Backends ### Available Backends @@ -49,8 +46,6 @@ You can also set the environment variable on the command line: FASTVIDEO_ATTENTION_BACKEND=SAGE_ATTN python example.py ``` -(optimizations-flash)= - ### Flash Attention **`FLASH_ATTN`** @@ -71,12 +66,6 @@ pip install ninja python setup.py install ``` -:::{note} -FastVideo will automatically detect and use `FA3` if it is installed when using `FLASH_ATTN` backend. -::: - -(optimizations-sta)= - ### Sliding Tile Attention **`SLIDING_TILE_ATTN`** @@ -87,8 +76,6 @@ pip install st_attn==0.0.4 Please see [this page](#sta-installation) for more installation instructions. -(optimizations-vsa)= - ### Video Sparse Attention **`VIDEO_SPARSE_ATTN`** @@ -100,8 +87,6 @@ python setup_vsa.py install Please see [this page](#vsa-installation) for more installation instructions. -(optimizations-sage)= - ### Sage Attention **`SAGE_ATTN`** @@ -114,8 +99,6 @@ cd sageattention python setup.py install # or pip install -e . ``` -(optimizations-sage3)= - ### Sage Attention 3 **`SAGE_ATTN_THREE`** @@ -136,8 +119,6 @@ To use Sage Attention 3 in FastVideo, first get access to the SageAttention3 cod python setup.py install ``` -(optimizations-teacache)= - ## Teacache TeaCache is an optimization technique supported in FastVideo that can significantly speed up video generation by skipping redundant calculations across diffusion steps. This guide explains how to enable and configure TeaCache for optimal performance in FastVideo. diff --git a/docs/inference/support_matrix.md b/docs/inference/support_matrix.md new file mode 100644 index 000000000..d207d80ca --- /dev/null +++ b/docs/inference/support_matrix.md @@ -0,0 +1,66 @@ +# Compatibility Matrix + +The table below shows every supported model and optimizations supported for them. + +The symbols used have the following meanings: + +- ✅ = Full compatibility +- ❌ = No compatibility +- ⭕ = Does not apply to this model + +## Models x Optimization + +The `HuggingFace Model ID` can be directly pass to `from_pretrained()` methods and FastVideo will use the optimal default parameters when initializing and generating videos. + + + +| Model Name | HuggingFace Model ID | Resolutions | TeaCache | Sliding Tile Attn | Sage Attn | VSA | +|------------|---------------------|-------------|----------|-------------------|-----------|-----| +| FastWan2.1 T2V 1.3B | `FastVideo/FastWan2.1-T2V-1.3B-Diffusers` | 480P | ⭕ | ⭕ | ⭕ | ✅ | +| FastWan2.2 TI2V 5B Full Attn* | `FastVideo/FastWan2.2-TI2V-5B-FullAttn-Diffusers` | 720P | ⭕ | ⭕ | ⭕ | ✅ | +| Wan2.2 TI2V 5B | `Wan-AI/Wan2.2-TI2V-5B-Diffusers` | 720P | ⭕ | ⭕ | ✅ | ⭕ | +| Wan2.2 T2V A14B | `Wan-AI/Wan2.2-T2V-A14B-Diffusers` | 480P
720P | ❌ | ❌ | ✅ | ⭕ | +| Wan2.2 I2V A14B | `Wan-AI/Wan2.2-I2V-A14B-Diffusers` | 480P
720P | ❌ | ❌ | ✅ | ⭕ | +| HunyuanVideo | `hunyuanvideo-community/HunyuanVideo` | 720px1280p
544px960p | ❌ | ✅ | ✅ | ⭕ | +| FastHunyuan | `FastVideo/FastHunyuan-diffusers` | 720px1280p
544px960p | ❌ | ✅ | ✅ | ⭕ | +| Wan2.1 T2V 1.3B | `Wan-AI/Wan2.1-T2V-1.3B-Diffusers` | 480P | ✅ | ✅* | ✅ | ⭕ | +| Wan2.1 T2V 14B | `Wan-AI/Wan2.1-T2V-14B-Diffusers` | 480P, 720P | ✅ | ✅* | ✅ | ⭕ | +| Wan2.1 I2V 480P | `Wan-AI/Wan2.1-I2V-14B-480P-Diffusers` | 480P | ✅ | ✅* | ✅ | ⭕ | +| Wan2.1 I2V 720P | `Wan-AI/Wan2.1-I2V-14B-720P-Diffusers` | 720P | ✅ | ✅ | ✅ | ⭕ | +| StepVideo T2V | `FastVideo/stepvideo-t2v-diffusers` | 768px768px204f
544px992px204f
544px992px136f | ❌ | ❌ | ✅ | ⭕ | + +**Note**: Wan2.2 TI2V 5B has some quality issues when performing I2V generation. We are working on fixing this issue. + +## Special requirements + +### StepVideo T2V +- The self-attention in text-encoder (step_llm) only supports CUDA capabilities sm_80 sm_86 and sm_90 + +### Sliding Tile Attention +- Currently only Hopper GPUs (H100s) are supported. diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 747ffb7b3..000000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt deleted file mode 100644 index 07613d669..000000000 --- a/docs/requirements-docs.txt +++ /dev/null @@ -1,15 +0,0 @@ -sphinx==7.4.7 -sphinx-argparse==0.5.2 -sphinx-autodoc2==0.5.0 -sphinx-book-theme==1.1.4 -sphinx-copybutton==0.5.2 -sphinx-design==0.6.1 -sphinx-togglebutton==0.3.2 -myst-parser==3.0.1 -msgspec -commonmark # Required by sphinx-argparse when using :markdownhelp: - -# packages to install to build the documentation -cachetools -# -f https://download.pytorch.org/whl/cpu -torch \ No newline at end of file diff --git a/docs/source/sliding_tile_attention/demo.md b/docs/sliding_tile_attention/demo.md similarity index 97% rename from docs/source/sliding_tile_attention/demo.md rename to docs/sliding_tile_attention/demo.md index dadae81db..080b8e24c 100644 --- a/docs/source/sliding_tile_attention/demo.md +++ b/docs/sliding_tile_attention/demo.md @@ -1,4 +1,3 @@ -(sta-demo)= # 🔍 Demo This is is a demo for 2D STA with window size (6,6) operating on a (10, 10) image. diff --git a/docs/source/sliding_tile_attention/installation.md b/docs/sliding_tile_attention/installation.md similarity index 98% rename from docs/source/sliding_tile_attention/installation.md rename to docs/sliding_tile_attention/installation.md index 8e9f1daec..0ed54f3db 100644 --- a/docs/source/sliding_tile_attention/installation.md +++ b/docs/sliding_tile_attention/installation.md @@ -1,4 +1,3 @@ -(sta-installation)= # 🔧 Installation You can install the Sliding Tile Attention package using diff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css deleted file mode 100644 index 79bd2082b..000000000 --- a/docs/source/_static/custom.css +++ /dev/null @@ -1,8 +0,0 @@ -.vertical-table-header th.head:not(.stub) { - writing-mode: sideways-lr; - white-space: nowrap; - max-width: 0; - p { - margin: 0; - } -} diff --git a/docs/source/_templates/sections/header.html b/docs/source/_templates/sections/header.html deleted file mode 100644 index 80bc371c6..000000000 --- a/docs/source/_templates/sections/header.html +++ /dev/null @@ -1,39 +0,0 @@ - - - diff --git a/docs/source/api/summary.md b/docs/source/api/summary.md deleted file mode 100644 index 4b5cdd89d..000000000 --- a/docs/source/api/summary.md +++ /dev/null @@ -1,19 +0,0 @@ -# Summary - -## Video Generator - -```{autodoc2-summary} - fastvideo.VideoGenerator -``` - -## Initialization Configuration - -```{autodoc2-summary} - fastvideo.configs.pipelines.PipelineConfig -``` - -## Sampling Configuration - -```{autodoc2-summary} - fastvideo.configs.sample.SamplingParam -``` diff --git a/docs/source/autodoc2_docstring_parser.py b/docs/source/autodoc2_docstring_parser.py deleted file mode 100644 index 32f25d3c8..000000000 --- a/docs/source/autodoc2_docstring_parser.py +++ /dev/null @@ -1,22 +0,0 @@ -# type: ignore -# SPDX-License-Identifier: Apache-2.0 -from docutils import nodes -from myst_parser.parsers.sphinx_ import MystParser -from sphinx.ext.napoleon import docstring - - -class NapoleonParser(MystParser): - - def parse(self, input_string: str, document: nodes.document) -> None: - # Get the Sphinx configuration - config = document.settings.env.config - - parsed_content = str( - docstring.GoogleDocstring( - str(docstring.NumpyDocstring(input_string, config)), - config, - )) - return super().parse(parsed_content, document) - - -Parser = NapoleonParser diff --git a/docs/source/conf.py b/docs/source/conf.py deleted file mode 100644 index 12bd335d4..000000000 --- a/docs/source/conf.py +++ /dev/null @@ -1,275 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. - -import datetime -import logging -import os -import re -import sys -from pathlib import Path - -import requests - -logger = logging.getLogger(__name__) -REPO_ROOT = Path(__file__).resolve().parent.parent.parent -print(os.path.abspath(REPO_ROOT)) -sys.path.append(os.path.abspath(REPO_ROOT)) - -# -- Project information ----------------------------------------------------- - -project = 'FastVideo' -copyright = f'{datetime.datetime.now().year}, FastVideo Team' -author = 'the FastVideo Team' - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.napoleon", - "sphinx.ext.linkcode", - "sphinx.ext.intersphinx", - "sphinx_copybutton", - "autodoc2", - "myst_parser", - "sphinxarg.ext", - "sphinx_design", - "sphinx_togglebutton", -] -myst_enable_extensions = [ - "colon_fence", - "fieldlist", -] -autodoc2_packages = [ - { - "path": "../../fastvideo", - "exclude_dirs": ["__pycache__", "third_party"], - }, -] -autodoc2_output_dir = "api" -autodoc2_render_plugin = "myst" -autodoc2_hidden_objects = ["dunder", "private", "inherited"] -autodoc2_docstring_parser_regexes = [ - (".*", "docs.source.autodoc2_docstring_parser"), -] -autodoc2_sort_names = True -autodoc2_index_template = None -autodoc2_skip_module_regexes = [ - "fastvideo.dataset", - "fastvideo.distill", - "fastvideo.data_preprocess", - "fastvideo.models", - "fastvideo.sample", - "fastvideo.utils", - "fastvideo.distill_adv", - "fastvideo.train", -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns: list[str] = ["**/*.template.md", "**/*.inc.md"] - -# Exclude the prompt "$" when copying code -copybutton_prompt_text = r"\$ " -copybutton_prompt_is_regexp = True - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_title = project -html_theme = 'sphinx_book_theme' -html_logo = '../../assets/logos/icon_simple.svg' -html_theme_options = { - 'path_to_docs': 'docs/source', - 'repository_url': 'https://github.com/hao-ai-lab/FastVideo/', - 'use_repository_button': True, - 'use_edit_page_button': True, - # Prevents the full API being added to the left sidebar of every page. - # Reduces build time by 2.5x and reduces build size from ~225MB to ~95MB. - 'collapse_navbar': True, - # Makes API visible in the right sidebar on API reference pages. - 'show_toc_level': 3, -} -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] -html_js_files = ["custom.js"] -html_css_files = ["custom.css"] - -myst_url_schemes = { - 'http': None, - 'https': None, - 'mailto': None, - 'ftp': None, - "gh-issue": { - "url": - "https://github.com/hao-ai-lab/FastVideo/issues/{{path}}#{{fragment}}", - "title": "Issue #{{path}}", - "classes": ["github"], - }, - "gh-pr": { - "url": - "https://github.com/hao-ai-lab/FastVideo/pull/{{path}}#{{fragment}}", - "title": "Pull Request #{{path}}", - "classes": ["github"], - }, - "gh-dir": { - "url": "https://github.com/hao-ai-lab/FastVideo/tree/main/{{path}}", - "title": "{{path}}", - "classes": ["github"], - }, - "gh-file": { - "url": "https://github.com/hao-ai-lab/FastVideo/blob/main/{{path}}", - "title": "{{path}}", - "classes": ["github"], - }, -} - -# see https://docs.readthedocs.io/en/stable/reference/environment-variables.html # noqa -READTHEDOCS_VERSION_TYPE = os.environ.get('READTHEDOCS_VERSION_TYPE') -if READTHEDOCS_VERSION_TYPE == "tag": - # remove the warning banner if the version is a tagged release - header_file = os.path.join(os.path.dirname(__file__), - "_templates/sections/header.html") - # The file might be removed already if the build is triggered multiple times - # (readthedocs build both HTML and PDF versions separately) - if os.path.exists(header_file): - os.remove(header_file) - - -# Generate additional rst documentation here. -def setup(app): - from docs.source.generate_examples import generate_examples - generate_examples() - - -_cached_base: str = "" -_cached_branch: str = "" - - -def get_repo_base_and_branch(pr_number: str) -> tuple[str | None, str | None]: - global _cached_base, _cached_branch - if _cached_base and _cached_branch: - return _cached_base, _cached_branch - - url = f"https://api.github.com/repos/hao-ai-lab/FastVideo/pulls/{pr_number}" - response = requests.get(url) - if response.status_code == 200: - data = response.json() - _cached_base = data['head']['repo']['full_name'] - _cached_branch = data['head']['ref'] - return _cached_base, _cached_branch - else: - logger.error("Failed to fetch PR details: %s", response) - return None, None - - -def linkcode_resolve(domain, info): - if domain != 'py': - return None - if not info['module']: - return None - - # Get path from module name - file = Path(f"{info['module'].replace('.', '/')}.py") - path = REPO_ROOT / file - if not path.exists(): - path = REPO_ROOT / file.with_suffix("") / "__init__.py" - if not path.exists(): - return None - - # Get the line number of the object - with open(path) as f: - lines = f.readlines() - name = info['fullname'].split(".")[-1] - pattern = fr"^( {{4}})*((def|class) )?{name}\b.*" - for lineno, line in enumerate(lines, 1): - if not line or line.startswith("#"): - continue - if re.match(pattern, line): - break - - # If the line number is not found, return None - if lineno == len(lines): - return None - - # If the line number is found, create the URL - filename = path.relative_to(REPO_ROOT) - if "checkouts" in path.parts: - # a PR build on readthedocs - pr_number = REPO_ROOT.name - base, branch = get_repo_base_and_branch(pr_number) - if base and branch: - return f"https://github.com/{base}/blob/{branch}/{filename}#L{lineno}" - # Otherwise, link to the source file on the main branch - return f"https://github.com/hao-ai-lab/FastVideo/blob/main/{filename}#L{lineno}" - - -# Mock out external dependencies here, otherwise the autodoc pages may be blank. -autodoc_mock_imports = [ - "blake3", - "compressed_tensors", - "cpuinfo", - "cv2", - "torch", - "huggingface_hub", - "torchvision", - "transformers", - "psutil", - "prometheus_client", - "sentencepiece", - "vllm._C", - "PIL", - "numpy", - 'triton', - "tqdm", - "tensorizer", - "pynvml", - "outlines", - "xgrammar", - "librosa", - "soundfile", - "gguf", - "lark", - "decord", -] - -for mock_target in autodoc_mock_imports: - if mock_target in sys.modules: - logger.info( - "Potentially problematic mock target (%s) found; " - "autodoc_mock_imports cannot mock modules that have already " - "been loaded into sys.modules when the sphinx build starts.", - mock_target) - -intersphinx_mapping = { - "python": ("https://docs.python.org/3", None), - "typing_extensions": - ("https://typing-extensions.readthedocs.io/en/latest", None), - "aiohttp": ("https://docs.aiohttp.org/en/stable", None), - "pillow": ("https://pillow.readthedocs.io/en/stable", None), - "numpy": ("https://numpy.org/doc/stable", None), - "torch": ("https://pytorch.org/docs/stable", None), - "psutil": ("https://psutil.readthedocs.io/en/stable", None), -} - -navigation_with_keys = False diff --git a/docs/source/getting_started/installation.md b/docs/source/getting_started/installation.md deleted file mode 100644 index e8ec58705..000000000 --- a/docs/source/getting_started/installation.md +++ /dev/null @@ -1,18 +0,0 @@ -(installation-index)= - -# 🔧 Installation - -FastVideo supports the following hardware platforms: - -:::{toctree} -:maxdepth: 1 -:hidden: - -installation/gpu -installation/mps -::: - -- - - NVIDIA CUDA -- - - Apple silicon diff --git a/docs/source/getting_started/v1_api.md b/docs/source/getting_started/v1_api.md deleted file mode 100644 index 2fe3695c0..000000000 --- a/docs/source/getting_started/v1_api.md +++ /dev/null @@ -1,83 +0,0 @@ -# V1 API - -FastVideo's V1 API provides a streamlined interface for video generation tasks with powerful customization options. This page documents the primary components of the API. - -## Video Generator - -This class will be the primary Python API for generating videos and images. - -```{autodoc2-summary} - fastvideo.VideoGenerator -``` - -`````{py:class} VideoGenerator(fastvideo_args: fastvideo.fastvideo_args.FastVideoArgs, executor_class: type[fastvideo.worker.executor.Executor], log_stats: bool) -:canonical: fastvideo.entrypoints.video_generator.VideoGenerator - -```{autodoc2-docstring} fastvideo.entrypoints.video_generator.VideoGenerator -:parser: docs.source.autodoc2_docstring_parser -``` - -`VideoGenerator.from_pretrained()` should be the primary way of creating a new video generator. - -````{py:method} from_pretrained(model_path: str, device: typing.Optional[str] = None, torch_dtype: typing.Optional[torch.dtype] = None, pipeline_config: typing.Optional[typing.Union[str | fastvideo.configs.pipelines.PipelineConfig]] = None, **kwargs) -> fastvideo.entrypoints.video_generator.VideoGenerator -:canonical: fastvideo.entrypoints.video_generator.VideoGenerator.from_pretrained -:classmethod: - -```{autodoc2-docstring} fastvideo.entrypoints.video_generator.VideoGenerator.from_pretrained -:parser: docs.source.autodoc2_docstring_parser -``` - - -## Configuring FastVideo - -The follow two classes `PipelineConfig` and `SamplingParam` are used to configure initialization and sampling parameters, respectively. - -### PipelineConfig -```{autodoc2-summary} - fastvideo.PipelineConfig -``` - -`````{py:class} PipelineConfig -:canonical: fastvideo.configs.pipelines.base.PipelineConfig - -```{autodoc2-docstring} fastvideo.configs.pipelines.base.PipelineConfig -:parser: docs.source.autodoc2_docstring_parser -``` - -````{py:method} from_pretrained(model_path: str) -> fastvideo.configs.pipelines.base.PipelineConfig -:canonical: fastvideo.configs.pipelines.base.PipelineConfig.from_pretrained -:classmethod: - -```{autodoc2-docstring} fastvideo.configs.pipelines.base.PipelineConfig.from_pretrained -:parser: docs.source.autodoc2_docstring_parser -``` - - -````{py:method} dump_to_json(file_path: str) -:canonical: fastvideo.configs.pipelines.base.PipelineConfig.dump_to_json - -```{autodoc2-docstring} fastvideo.configs.pipelines.base.PipelineConfig.dump_to_json -:parser: docs.source.autodoc2_docstring_parser -``` - - -### SamplingParam - -```{autodoc2-summary} - fastvideo.SamplingParam -``` - -`````{py:class} SamplingParam -:canonical: fastvideo.configs.sample.base.SamplingParam - -```{autodoc2-docstring} fastvideo.configs.sample.base.SamplingParam -:parser: docs.source.autodoc2_docstring_parser -``` - -````{py:method} from_pretrained(model_path: str) -> fastvideo.configs.sample.base.SamplingParam -:canonical: fastvideo.configs.sample.base.SamplingParam.from_pretrained -:classmethod: - -```{autodoc2-docstring} fastvideo.configs.sample.base.SamplingParam.from_pretrained -:parser: docs.source.autodoc2_docstring_parser -``` diff --git a/docs/source/inference/support_matrix.md b/docs/source/inference/support_matrix.md deleted file mode 100644 index 63bc79b2f..000000000 --- a/docs/source/inference/support_matrix.md +++ /dev/null @@ -1,136 +0,0 @@ -(support-matrix)= -# Compatibility Matrix -The table below shows every supported model and optimizations supported for them. - -The symbols used have the following meanings: - -- ✅ = Full compatibility -- ❌ = No compatibility -- ⭕ = Does not apply to this model - -## Models x Optimization -The `HuggingFace Model ID` can be directly pass to `from_pretrained()` methods and FastVideo will use the optimal default parameters when initializing and generating videos. - -:::{raw} html - -::: - -:::{list-table} -:header-rows: 1 -:stub-columns: 3 -:widths: auto -:class: vertical-table-header - -- * Model Name - * HuggingFace Model ID - * Resolutions - * TeaCache - * Sliding Tile Attn - * Sage Attn - * Video Sparse Attention (VSA) -- * FastWan2.1 T2V 1.3B - * `FastVideo/FastWan2.1-T2V-1.3B-Diffusers` - * 480P - * ⭕ - * ⭕ - * ⭕ - * ✅ -- * FastWan2.2 TI2V 5B Full Attn* - * `FastVideo/FastWan2.2-TI2V-5B-FullAttn-Diffusers` - * 720P - * ⭕ - * ⭕ - * ⭕ - * ✅ -- * Wan2.2 TI2V 5B - * `Wan-AI/Wan2.2-TI2V-5B-Diffusers` - * 720P - * ⭕ - * ⭕ - * ✅ - * ⭕ -- * Wan2.2 T2V A14B - * `Wan-AI/Wan2.2-T2V-A14B-Diffusers` - * 480P
720P - * ❌ - * ❌ - * ✅ - * ⭕ -- * Wan2.2 I2V A14B - * `Wan-AI/Wan2.2-I2V-A14B-Diffusers` - * 480P
720P - * ❌ - * ❌ - * ✅ - * ⭕ -- * HunyuanVideo - * `hunyuanvideo-community/HunyuanVideo` - * 720px1280p
544px960p - * ❌ - * ✅ - * ✅ - * ⭕ -- * FastHunyuan - * `FastVideo/FastHunyuan-diffusers` - * 720px1280p
544px960p - * ❌ - * ✅ - * ✅ - * ⭕ -- * Wan2.1 T2V 1.3B - * `Wan-AI/Wan2.1-T2V-1.3B-Diffusers` - * 480P - * ✅ - * ✅* - * ✅ - * ⭕ -- * Wan2.1 T2V 14B - * `Wan-AI/Wan2.1-T2V-14B-Diffusers` - * 480P, 720P - * ✅ - * ✅* - * ✅ - * ⭕ -- * Wan2.1 I2V 480P - * `Wan-AI/Wan2.1-I2V-14B-480P-Diffusers` - * 480P - * ✅ - * ✅* - * ✅ - * ⭕ -- * Wan2.1 I2V 720P - * `Wan-AI/Wan2.1-I2V-14B-720P-Diffusers` - * 720P - * ✅ - * ✅ - * ✅ - * ⭕ -- * StepVideo T2V - * `FastVideo/stepvideo-t2v-diffusers` - * 768px768px204f
544px992px204f
544px992px136f - * ❌ - * ❌ - * ✅ - * ⭕ -::: - -**Note**: Wan2.2 TI2V 5B has some quality issues when performing I2V generation. We are working on fixing this issue. - -## Special requirements - -### StepVideo T2V -- The self-attention in text-encoder (step_llm) only supports CUDA capabilities sm_80 sm_86 and sm_90 - -### Sliding Tile Attention -- Currently only Hopper GPUs (H100s) are supported. diff --git a/docs/source/training/data_preprocess.md b/docs/training/data_preprocess.md similarity index 98% rename from docs/source/training/data_preprocess.md rename to docs/training/data_preprocess.md index ede86cbff..dd6c34990 100644 --- a/docs/source/training/data_preprocess.md +++ b/docs/training/data_preprocess.md @@ -1,4 +1,3 @@ -(v0-data-preprocess)= # 🧱 Data Preprocess diff --git a/docs/source/training/finetune.md b/docs/training/finetune.md similarity index 99% rename from docs/source/training/finetune.md rename to docs/training/finetune.md index 92636779c..390b20afd 100644 --- a/docs/source/training/finetune.md +++ b/docs/training/finetune.md @@ -1,4 +1,4 @@ -(v0-finetune)= + # 🧠 Finetune ## ⚡ Full Finetune Ensure your data is prepared and preprocessed in the format specified in [data_preprocess.md](#v0-data-preprocess). For convenience, we also provide a mochi preprocessed Black Myth Wukong data that can be downloaded directly: diff --git a/docs/source/video_sparse_attention/installation.md b/docs/video_sparse_attention/installation.md similarity index 98% rename from docs/source/video_sparse_attention/installation.md rename to docs/video_sparse_attention/installation.md index e436922b0..4da426b57 100644 --- a/docs/source/video_sparse_attention/installation.md +++ b/docs/video_sparse_attention/installation.md @@ -1,4 +1,3 @@ -(vsa-installation)= # 🔧 Installation You can install the Video Sparse Attention package using diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 000000000..b93756ec8 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,169 @@ +site_name: FastVideo +site_description: A unified inference and post-training framework for accelerated video generation +site_author: FastVideo Team +site_url: http://127.0.0.1:8000/ + +# Documentation directory +docs_dir: docs + +# Repository +repo_name: hao-ai-lab/FastVideo +repo_url: https://github.com/hao-ai-lab/FastVideo +edit_uri: edit/main/docs/ + +# Configuration +theme: + name: material + palette: + - scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to light mode + features: + - navigation.tabs + - navigation.instant + - navigation.tracking + - search.highlight + - search.share + - content.tabs.link + - content.code.copy + - content.code.annotate + icon: + logo: material/book-open-variant + font: + text: Roboto + code: Roboto Mono + +# Plugins +plugins: + - search: + lang: en + - mkdocs-simple-hooks: + hooks: + on_pre_build: "docs.generate_examples:on_pre_build_hook" + - autorefs + - api-autonav: + modules: ["fastvideo"] + api_root_uri: "api" + exclude: + - "re:fastvideo\\._.*" + - mkdocstrings: + handlers: + python: + paths: [.] + options: + docstring_style: google + show_source: true + show_root_heading: true + show_root_toc_entry: true + show_symbol_type_heading: true + show_object_full_path: true + show_category_heading: true + signature_crossrefs: true + show_if_no_docstring: false + show_signature_annotations: true + separate_signature: true + merge_init_into_class: true + show_submodules: true + show_bases: true + show_root_full_path: false + show_root_members_full_path: false + inventories: + - https://docs.python.org/3/objects.inv + + +# Markdown extensions +markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + - pymdownx.tabbed: + alternate_style: true + - pymdownx.emoji + - pymdownx.superfences + - pymdownx.arithmatex: + generic: true + - pymdownx.critic + - pymdownx.details + - pymdownx.highlight + - pymdownx.inlinehilite + - pymdownx.keys + - pymdownx.mark + - pymdownx.smartsymbols + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde + - toc: + permalink: true + +# Page tree +nav: + - Home: index.md + - Getting Started: + - Installation: getting_started/installation.md + - Quick Start: getting_started/quick_start.md + - V1 API: getting_started/v1_api.md + - Inference: + - Quick Start: inference/inference_quick_start.md + - Configuration: inference/configuration.md + - Optimizations: inference/optimizations.md + - ComfyUI: inference/comfyui.md + - Support Matrix: inference/support_matrix.md + - CLI: inference/cli.md + - Add Pipeline: inference/add_pipeline.md + - Examples: + - Basic: inference/examples/basic.md + - Optimizations: inference/examples/optimizations.md + - STA Mask Search: inference/examples/sta_mask_search.md + - Training: + - Data Preprocessing: training/data_preprocess.md + - Fine-tuning: training/finetune.md + - Examples: + - Training Index: training/examples/examples_training_index.md + - Wan T2V 1.3B: training/examples/wan_t2v_1.3B.md + - Wan I2V 14B 480p: training/examples/wan_i2v_14B_480p.md + - Wan2.1 Fun 1.3B InP: training/examples/Wan2.1-Fun-1.3B-InP.md + - Wan2.1 VSA: training/examples/Wan2.1-VSA.md + - Fine-tuning: training/examples/finetune.md + - Distillation: + - Data Preprocessing: distillation/data_preprocess.md + - DMD: distillation/dmd.md + - Sliding Tile Attention: + - Installation: sliding_tile_attention/installation.md + - Demo: sliding_tile_attention/demo.md + - Video Sparse Attention: + - Installation: video_sparse_attention/installation.md + - Design: + - Overview: design/overview.md + - Developer Guide: + - Overview: contributing/overview.md + - Developer Environment: + - Index: contributing/developer_env/index.md + - Docker: contributing/developer_env/docker.md + - RunPod: contributing/developer_env/runpod.md + - Profiling: contributing/profiling.md + - API Reference: + - FastVideo: api/fastvideo.md + + +# Extra +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/hao-ai-lab/FastVideo + version: + provider: mike + +# Custom CSS +extra_css: + - assets/custom.css \ No newline at end of file diff --git a/requirements-mkdocs.txt b/requirements-mkdocs.txt new file mode 100644 index 000000000..fa29dc8fe --- /dev/null +++ b/requirements-mkdocs.txt @@ -0,0 +1,13 @@ +mkdocs-simple-hooks>=0.1.5 +mkdocs-minify-plugin>=0.7.0 +mkdocs>=1.5.0 +mkdocs-material>=9.4.0 +mkdocstrings>=0.24.0 +mkdocstrings-python>=1.8.0 +mkdocs-mermaid2-plugin>=1.1.0 +mkdocs-git-revision-date-localized-plugin>=1.2.0 +mkdocs-git-committers-plugin-2>=1.1.0 +mkdocs-macros-plugin>=0.8.0 +pymdown-extensions>=10.0 +mkdocs-api-autonav +mkdocs-autorefs