quickstart.md 1.46 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
22
# Install again separately to bypass the version conflict check
# 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.
23
24
pip install transformers==4.45.2

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

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

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

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

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