quickstart.md 1.38 KB
Newer Older
helloyongyang's avatar
helloyongyang committed
1
# Quick Start
helloyongyang's avatar
helloyongyang committed
2

helloyongyang's avatar
helloyongyang committed
3
## Prepare Environment
4

helloyongyang's avatar
helloyongyang committed
5
We recommend using a docker environment. Here is the [dockerhub](https://hub.docker.com/r/lightx2v/lightx2v/tags) for lightx2v. Please select the tag with the latest date, for example, 25061301.
6
7

```shell
helloyongyang's avatar
helloyongyang committed
8
docker pull lightx2v/lightx2v:25061301
helloyongyang's avatar
helloyongyang committed
9
docker run --gpus all -itd --ipc=host --name [container_name] -v [mount_settings]  --entrypoint /bin/bash [image_id]
10
11
```

helloyongyang's avatar
helloyongyang committed
12
If you want to set up the environment yourself using conda, you can refer to the following steps:
helloyongyang's avatar
helloyongyang committed
13
14

```shell
helloyongyang's avatar
helloyongyang committed
15
# clone repo and submodules
16
17
18
19
20
git clone https://github.com/ModelTC/lightx2v.git lightx2v && cd lightx2v

conda create -n lightx2v python=3.11 && conda activate lightx2v
pip install -r requirements.txt

helloyongyang's avatar
helloyongyang committed
21
# The Hunyuan model needs to run under this version of transformers. If you do not need to run the Hunyuan model, you can ignore this step.
helloyongyang's avatar
helloyongyang committed
22
# pip install transformers==4.45.2
23

helloyongyang's avatar
helloyongyang committed
24
# install flash-attention 2
helloyongyang's avatar
helloyongyang committed
25
26
git clone https://github.com/Dao-AILab/flash-attention.git --recursive
cd flash-attention && python setup.py install
27

helloyongyang's avatar
helloyongyang committed
28
# install flash-attention 3, only if hopper
helloyongyang's avatar
helloyongyang committed
29
cd flash-attention/hopper && python setup.py install
30
31
```

helloyongyang's avatar
helloyongyang committed
32
## Infer
33
34

```shell
helloyongyang's avatar
helloyongyang committed
35
# Modify the path in the script
helloyongyang's avatar
helloyongyang committed
36
bash scripts/wan/run_wan_t2v.sh
37
38
```

helloyongyang's avatar
helloyongyang committed
39
In addition to the existing input arguments in the script, there are also some necessary parameters in the `wan_t2v.json` file specified by `--config_json`. You can modify them as needed.