Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/contributing/coding_agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ Action:
- Clone the official repo under the project root (e.g., `FastVideo/LTX-2/`).
- If a Diffusers-format HF repo already exists, you can skip manual weight
handling and download it directly with
`scripts/huggingface/download_hf.py`.
`examples/huggingface/download_hf.py`.

!!! note
This step is best done manually because large downloads can time out.
Example:
```bash
python scripts/huggingface/download_hf.py \
python examples/huggingface/download_hf.py \
--repo_id Wan-AI/Wan2.1-T2V-1.3B-Diffusers \
--local_dir official_weights/Wan2.1-T2V-1.3B-Diffusers \
--repo_type model
Expand Down Expand Up @@ -194,7 +194,7 @@ Action:
!!! note
If a Diffusers-format HF repo already exists and loads correctly, you can
skip conversion entirely (no conversion script needed) and just download it
with `scripts/huggingface/download_hf.py`. Otherwise, you may need a
with `examples/huggingface/download_hf.py`. Otherwise, you may need a
conversion script + a `converted_weights/<model>/` staging directory.

Example (key renaming via arch config mapping, Wan2.1‑style):
Expand Down Expand Up @@ -418,7 +418,7 @@ If the model does **not** have a Diffusers-format repo:
In both cases, parity testing is required to validate correctness.

If you want to publish a Diffusers‑style repo after conversion, use
`scripts/checkpoint_conversion/create_hf_repo.py` to assemble a HuggingFace‑ready
`examples/checkpoint_conversion/create_hf_repo.py` to assemble a HuggingFace‑ready
directory before uploading.

## FAQ
Expand Down
6 changes: 3 additions & 3 deletions docs/distillation/data_preprocess.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ For Wan2.1 T2V distillation, we use the **FastVideo 480P Synthetic Wan dataset**

```bash
# Download the preprocessed dataset
python scripts/huggingface/download_hf.py \
python examples/huggingface/download_hf.py \
--repo_id "FastVideo/Wan-Syn_77x448x832_600k" \
--local_dir "FastVideo/Wan-Syn_77x448x832_600k" \
--repo_type "dataset"
Expand All @@ -23,7 +23,7 @@ For Wan2.2 TI2V distillation, we use the crush_smol dataset which includes both

```bash
# Download dataset
python scripts/huggingface/download_hf.py \
python examples/huggingface/download_hf.py \
--repo_id=FastVideo/mini_i2v_dataset \
--local_dir=data/mini_i2v_dataset \
--repo_type=dataset
Expand All @@ -35,7 +35,7 @@ The preprocessing steps are identical to training. Run the appropriate preproces

```bash
# For Wan2.1 T2V
bash scripts/preprocess/v1_preprocess_wan_data_t2v
bash examples/preprocessing/v1_preprocess_wan_data_t2v

# For Wan2.2 TI2V
bash examples/distill/Wan2.2-TI2V-5B-Diffusers/crush_smol/preprocess_wan_data_ti2v_5b.sh
Expand Down
4 changes: 2 additions & 2 deletions docs/distillation/dmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Both models are trained on **61×448×832** resolution but support generating vi
First install [VSA](../attention/vsa/index.md). Set `MODEL_BASE` to your own model path and run:

```bash
bash scripts/inference/v1_inference_wan_dmd.sh
bash examples/inference/cli/v1_inference_wan_dmd.sh
```

## 🗂️ Dataset
Expand All @@ -27,7 +27,7 @@ We use the **FastVideo 480P Synthetic Wan dataset** ([FastVideo/Wan-Syn_77x448x8

```bash
# Download the preprocessed dataset
python scripts/huggingface/download_hf.py \
python examples/huggingface/download_hf.py \
--repo_id "FastVideo/Wan-Syn_77x448x832_600k" \
--local_dir "FastVideo/Wan-Syn_77x448x832_600k" \
--repo_type "dataset"
Expand Down
3 changes: 1 addition & 2 deletions docs/inference/inference_quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ python example.py

The generated video will be saved in the current directory under `my_videos/`

More inference scripts and recipes can be found in `examples/inference/` and
`scripts/inference/`.
More inference example scripts can be found in `examples/inference/cli/`

## Available Models

Expand Down
4 changes: 2 additions & 2 deletions docs/training/data_preprocess.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Download the sample dataset and run preprocessing:

```bash
# Download the crush-smol dataset
python scripts/huggingface/download_hf.py \
python examples/huggingface/download_hf.py \
--repo_id "wlsaidhi/crush-smol-merged" \
--local_dir "data/crush-smol" \
--repo_type "dataset"
Expand Down Expand Up @@ -93,7 +93,7 @@ Use `--preprocess.dataset_type hf` and point `--preprocess.dataset_path` to a Hu
If you have raw videos and captions in separate files, generate the `videos2caption.json`:

```bash
python scripts/dataset_preparation/prepare_json_file.py \
python examples/preprocessing/prepare_json_file.py \
--data_folder path/to/your_raw_data/ \
--output path/to/output_folder
```
Expand Down
6 changes: 3 additions & 3 deletions docs/training/finetune.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ FastVideo provides tools to extract LoRA adapters from finetuned models and merg
Extract a LoRA adapter by comparing a finetuned model to its base:

```bash
python scripts/lora_extraction/extract_lora.py \
python examples/lora_extraction/extract_lora.py \
--base Wan-AI/Wan2.1-T2V-1.3B-Diffusers \
--ft path/to/your/finetuned_model \
--out adapter_r32.safetensors \
Expand All @@ -125,7 +125,7 @@ python scripts/lora_extraction/extract_lora.py \
Merge an adapter back into a base model:

```bash
python scripts/lora_extraction/merge_lora.py \
python examples/lora_extraction/merge_lora.py \
--base Wan-AI/Wan2.1-T2V-1.3B-Diffusers \
--adapter adapter_r32.safetensors \
--ft path/to/your/finetuned_model \
Expand All @@ -144,7 +144,7 @@ python scripts/lora_extraction/merge_lora.py \
Compare the merged model against the original finetuned model:

```bash
python scripts/lora_extraction/lora_inference_comparison.py \
python examples/lora_extraction/lora_inference_comparison.py \
--base merged_model \
--ft path/to/your/finetuned_model \
--adapter NONE \
Expand Down
6 changes: 3 additions & 3 deletions docs/utilities/lora.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tools for extracting and merging LoRA adapters for FastVideo models.
## Extract LoRA Adapter

```bash
python scripts/lora_extraction/extract_lora.py \
python examples/lora_extraction/extract_lora.py \
--base Wan-AI/Wan2.2-TI2V-5B-Diffusers \
--ft FastVideo/FastWan2.2-TI2V-5B-FullAttn-Diffusers \
--out adapter_r32.safetensors \
Expand All @@ -23,7 +23,7 @@ python scripts/lora_extraction/extract_lora.py \
## Merge Adapter

```bash
python scripts/lora_extraction/merge_lora.py \
python examples/lora_extraction/merge_lora.py \
--base Wan-AI/Wan2.2-TI2V-5B-Diffusers \
--adapter adapter_r32.safetensors \
--ft FastVideo/FastWan2.2-TI2V-5B-FullAttn-Diffusers \
Expand All @@ -40,7 +40,7 @@ python scripts/lora_extraction/merge_lora.py \
## Validate Quality (Optional)

```bash
python scripts/lora_extraction/lora_inference_comparison.py \
python examples/lora_extraction/lora_inference_comparison.py \
--base merged_model \
--ft FastVideo/FastWan2.2-TI2V-5B-FullAttn-Diffusers \
--adapter NONE \
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def main():
print(f"\nDone! Converted weights saved to: {args.output_dir}")
print(f"\nNext steps:")
print(f" 1. Use create_hf_repo.py to create a complete diffusers repo:")
print(f" python scripts/checkpoint_conversion/create_hf_repo.py \\")
print(f" python examples/checkpoint_conversion/create_hf_repo.py \\")
print(f" --repo_id Wan-AI/Wan2.1-T2V-1.3B-Diffusers \\")
print(f" --local_dir /tmp/turbodiffusion-wan \\")
print(f" --checkpoint_dir {args.output_dir} \\")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
4. Updates config files to point to native model

Usage:
python scripts/checkpoint_conversion/longcat_to_fastvideo.py \
python examples/checkpoint_conversion/longcat_to_fastvideo.py \
--source /path/to/LongCat-Video/weights/LongCat-Video \
--output weights/longcat-native \
--validate
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/distill/SFWan2.1-T2V/download_dataset.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

python scripts/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
python examples/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

python scripts/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x448x832_600k" --local_dir "FastVideo/Wan-Syn_77x448x832_600k" --repo_type "dataset"
python examples/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x448x832_600k" --local_dir "FastVideo/Wan-Syn_77x448x832_600k" --repo_type "dataset"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

python scripts/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
python examples/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This script runs LongCat T2V inference using the fastvideo CLI.
#
# Usage:
# bash scripts/inference/v1_inference_longcat.sh
# bash examples/inference/cli/v1_inference_longcat.sh
#
# Prerequisites:
# - Install fastvideo: pip install -e .
Expand All @@ -21,7 +21,7 @@ export MODEL_BASE=FastVideo/LongCat-Video-T2V-Diffusers

# Option 2: Local weights (uncomment if you have local weights)
# For local weights, convert the official weights to FastVideo native format
# conversion method: python scripts/checkpoint_conversion/longcat_to_fastvideo.py
# conversion method: python examples/checkpoint_conversion/longcat_to_fastvideo.py
# --source /path/to/LongCat-Video/weights/LongCat-Video
# --output weights/longcat-native
# export MODEL_BASE=weights/longcat-native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Uses the distilled LoRA for faster generation.
#
# Usage:
# bash scripts/inference/v1_inference_longcat_distill.sh
# bash examples/inference/cli/v1_inference_longcat_distill.sh
#
# Prerequisites:
# - Install fastvideo: pip install -e .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# LongCat I2V takes an input image and generates a video from it.
#
# Usage:
# bash scripts/inference/v1_inference_longcat_i2v.sh
# bash examples/inference/cli/v1_inference_longcat_i2v.sh
#
# Prerequisites:
# - Install fastvideo: pip install -e .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Run v1_inference_longcat_distill.sh first to generate the 480p video.
#
# Usage:
# bash scripts/inference/v1_inference_longcat_refine_fromvideo.sh
# bash examples/inference/cli/v1_inference_longcat_refine_fromvideo.sh
#
# Prerequisites:
# - Install fastvideo: pip install -e .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# LongCat VC takes an input video and generates a continuation of it.
#
# Usage:
# bash scripts/inference/v1_inference_longcat_vc.sh
# bash examples/inference/cli/v1_inference_longcat_vc.sh
#
# Prerequisites:
# - Install fastvideo: pip install -e .
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Extract FastVideo-style LoRA adapters from a fine-tuned model by SVDing (FT - base).

Usage:
python scripts/lora_extraction/extract_lora.py \\
python examples/lora_extraction/extract_lora.py \\
--base <base_model> --ft <fine_tuned_model> --out adapter.safetensors --rank 16

Example for models with architectural differences (fallback is automatic):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ for node_id in {0..7}; do
start_file=$((node_id * 8 + 1))

echo "Launching text-only node $node_id with files v2m_${start_file}.txt to v2m_$((start_file + 7)).txt"
echo "sbatch --job-name=text-${node_id} --output=preprocess_output_text/preprocess-text-node-${node_id}.out --error=preprocess_output_text/preprocess-text-node-${node_id}.err scripts/preprocess/syn_text.slurm $start_file $node_id"
echo "sbatch --job-name=text-${node_id} --output=preprocess_output_text/preprocess-text-node-${node_id}.out --error=preprocess_output_text/preprocess-text-node-${node_id}.err examples/preprocessing/syn_text.slurm $start_file $node_id"

sbatch --job-name=text-${node_id} \
--output=preprocess_output_text/preprocess-text-node-${node_id}.out \
--error=preprocess_output_text/preprocess-text-node-${node_id}.err \
scripts/preprocess/syn_text.slurm $start_file $node_id
examples/preprocessing/syn_text.slurm $start_file $node_id
done

echo "All 8 text-only nodes launched successfully!"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

python scripts/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
python examples/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@


# 480P dataset
python scripts/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x448x832_600k" --local_dir "data/Wan-Syn_77x448x832_600k" --repo_type "dataset"
python examples/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x448x832_600k" --local_dir "data/Wan-Syn_77x448x832_600k" --repo_type "dataset"
# 720P dataset
python scripts/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x768x1280_250k" --local_dir "data/Wan-Syn_77x768x1280_250k" --repo_type "dataset"
python examples/huggingface/download_hf.py --repo_id "FastVideo/Wan-Syn_77x768x1280_250k" --local_dir "data/Wan-Syn_77x768x1280_250k" --repo_type "dataset"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

python scripts/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
python examples/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

python scripts/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
python examples/huggingface/download_hf.py --repo_id "wlsaidhi/crush-smol-merged" --local_dir "data/crush-smol" --repo_type "dataset"
4 changes: 2 additions & 2 deletions fastvideo/tests/lora_extraction/test_lora_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import sys
from pathlib import Path

# Add scripts/lora_extraction to path for imports
# Add examples/lora_extraction to path for imports
repo_root = Path(__file__).parents[3]
lora_scripts = repo_root / "scripts" / "lora_extraction"
lora_scripts = repo_root / "examples" / "lora_extraction"
sys.path.insert(0, str(lora_scripts))

# Import the core functions
Expand Down