Agnes-AI's picture
Add inference code
fc3971e verified
|
Raw History Blame Contribute Delete
3.27 kB
# Agnes-Video-2.0-MoE Inference Code
This folder contains the inference implementation for Agnes-Video-2.0-MoE. It does not contain model checkpoints or third-party model weights.
## Contents
- `inference/test_infer_seedance.py`: standard inference entry point.
- `crown/infer_entry.py`: optional elastic-width inference entry point.
- `inference/`: DiT, generation pipeline, checkpoint loading, and runtime utilities.
- `configs/config_template.json`: configuration template. Update all local paths before running.
- `infer.bat`: Windows CMD launcher for standard inference.
- `infer.sh`: Linux launcher.
## Required model files
Obtain the compatible Agnes-Video-2.0-MoE checkpoint and required auxiliary assets separately. Configure the paths in `configs/config_template.json`:
- `engine_config.load`: DiT/base checkpoint directory. The inference entry also accepts `--ckpt_dir` for a `.pt` checkpoint.
- `evaluation_config.txt_model_path`: T5Gemma text encoder.
- `evaluation_config.vae_model_path`: Wan2.2-TI2V-5B video VAE/model files required by this pipeline.
- `evaluation_config.omnivae_audio_ckpt_dir`: OmniVAE audio decoder checkpoint.
- OmniVAE source code: set `OMNIVAE_CODE_ROOT` to the local OmniVAE `vae` package root.
External components and their weights are not included in this code package. Obtain them from their respective official sources and follow their license terms.
## Environment
Use a Linux environment with a CUDA-capable NVIDIA GPU. This inference entry initializes CUDA/NCCL and is not supported on CPU or Windows native CMD. Windows users can invoke it from WSL/Linux; `infer.bat` is provided as a convenience wrapper for environments where Python and the CUDA runtime are available.
Install a PyTorch build compatible with your CUDA runtime first. Then install the Python dependencies listed in `requirements-inference.txt`. Dependency versions must match the release environment and compatible upstream components.
## Inference
Edit `configs/config_template.json` and replace all `C:/models/...` paths with local paths. From this folder, run in CMD/PowerShell:
```bat
python inference\test_infer_seedance.py --config-load-path configs\config_template.json --generate --prompt "A cinematic scene of a quiet lake at sunrise." --seconds 5 --save_path_prefix outputs\sample
```
Outputs are written with the selected prefix. The entry point supports additional options such as `--seed`, `--num_inference_steps`, `--br_width`, and `--br_height`; run `python inference\test_infer_seedance.py --help` to see available arguments.
For elastic-width checkpoints, use a compatible checkpoint/config and run the elastic entry point in the supported Linux/CUDA environment:
```bash
ELASTIC=1 bash infer.sh --config-load-path configs/config_template.json --generate --prompt "A cinematic scene of a quiet lake at sunrise." --seconds 5 --save_path_prefix outputs/sample
```
The elastic entry requires checkpoint metadata supported by `crown/infer_entry.py`. The standard entry point is for regular inference.
## License
The CROWN inference code is provided under Apache License 2.0. External models, libraries, and their weights are subject to their respective licenses. See `LICENSE` and the upstream license notices for details.