Looking Ahead: Modeling Future Evolution in Autoregressive Video Generation
Add conda + pip installation support.
HELLORPGade984bbb31d
diff --git a/.gitignore b/.gitignoreindex 4060e12..0e6eaab 100644--- a/.gitignore+++ b/.gitignore@@ -1,6 +1,9 @@.venv/.uv-venv/.uv-cache/+.conda-env/+.conda-pkgs/+.pip-cache/__pycache__/.pytest_cache/.ruff_cache/diff --git a/README.md b/README.mdindex 87dbc07..43cd97c 100644--- a/README.md+++ b/README.md@@ -40,6 +40,7 @@ We provide training and inference code, along with weights for 1.3B and 5B autor## 🔥 News+- **2026-10-26:** [Conda + pip installation](#conda--pip) is now available.- **2026-10-22:** Our paper is now available on [arXiv](https://arxiv.org/abs/2610.29989)! If you find our work helpful, please consider giving it an upvote on [HF Daily](https://huggingface.co/papers/2610.29989).- **2026-10-21:** Our [model weights](https://huggingface.co/TencentARC/Looking-Ahead) and [demo dataset](https://huggingface.co/datasets/TencentARC/Looking-Ahead) are now available on Hugging Face!- **2026-10-21:** Our [project page](https://hellorpg.github.io/looking-ahead/) and code are now available! Visit the project page for more demos.@@ -48,11 +49,10 @@ We provide training and inference code, along with weights for 1.3B and 5B autorWe are continuing to improve this project and explore new directions. Watch this repository to stay up to date with our progress. The documentation is also evolving: if you have any questions about using the project, please open an issue. Where helpful, we will incorporate clarifications into future documentation updates.-- Add conda + pip installation instructions.## ⚙️ Setup-We tested this project on Linux with an NVIDIA H200 GPU, Python 3.12.3 and PyTorch 2.10.0+cu128 (CUDA 12.8); compatibility with other environments has not been tested.+Tested on Linux with Python 3.12 and PyTorch 2.10.0+cu128 (CUDA 12.8).You can set up the environment using any of the following methods.@@ -79,7 +79,22 @@ source .venv/bin/activate### conda + pip-> 🚧 **TODO:** Installation instructions will be added here.+Run the following commands from the repository root:++```bash+conda create -n looking-ahead python=3.12 pip "ffmpeg=7.1.*" -c conda-forge -y+conda activate looking-ahead++python -m pip install torch==2.10.0 torchvision==0.25.0 \+ --index-url https://download.pytorch.org/whl/cu128+python -m pip install -r requirements.txt+```++Activate `looking-ahead` before training or inference. `run.sh` automatically+uses the activated environment. A compatible NVIDIA driver and a C++ compiler+(`g++` / `c++`) are required.++`requirements.txt` pins dependencies from `uv.lock`.diff --git a/docs/inference.md b/docs/inference.mdindex 57ad5cd..b94e01b 100644--- a/docs/inference.md+++ b/docs/inference.md@@ -2,8 +2,8 @@This guide covers text-and-image-to-video (TI2V) generation and text-and-video-to-video (TV2V) continuation. TI2V conditions on text and a supplied first frame, while TV2V conditions on text and a supplied video segment.-Run the commands from the repository root after preparing the environment and-model assets described in the [README](../README.md). The examples use `uv run python`; `python` also works when the project environment is already activated.+Run the commands from the repository root after activating the project environment+and preparing the model assets described in the [README](../README.md).## Contents@@ -113,7 +113,7 @@ transform but do not currently emit this per-image JSON report.This example continues the milk-pouring input with the 5B FCP EMA model:```bash-uv run python inference.py \+python inference.py \--config fcp_wan22_ti2v_5b \--checkpoint_path weights/Looking-Ahead/fcp_wan22_ti2v_5b/model_ema.pt \--use_ema \@@ -134,7 +134,7 @@ continuation frames.The same MP4 can be used directly with 1.3B:```bash-uv run python inference.py \+python inference.py \--config fcp_wan21_t2v_1.3b \--checkpoint_path weights/Looking-Ahead/fcp_wan21_t2v_1.3b/model_ema.pt \--use_ema \@@ -150,7 +150,7 @@ by 67 continuation frames. No separately converted input file is required.To override sampling settings for this TV2V example:```bash-uv run python inference.py \+python inference.py \--config fcp_wan22_ti2v_5b \--checkpoint_path weights/Looking-Ahead/fcp_wan22_ti2v_5b/model_ema.pt \--use_ema \@@ -226,7 +226,7 @@ silently shortened. Use a new output directory when changing this setting.#### Single image and prompt```bash-uv run python inference.py \+python inference.py \--config fcp_wan21_t2v_1.3b \--checkpoint_path weights/Looking-Ahead/fcp_wan21_t2v_1.3b/model_ema.pt \--use_ema \@@ -262,7 +262,7 @@ examples/inference/i2v_batch/``````bash-uv run python inference.py \+python inference.py \--config fcp_wan21_t2v_1.3b \--checkpoint_path weights/Looking-Ahead/fcp_wan21_t2v_1.3b/model_ema.pt \--use_ema --i2v \diff --git a/pyproject.toml b/pyproject.tomlindex 94ed16f..c1114e8 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -49,7 +49,3 @@ extend-exclude = ["src/wan", "src/wan22"][tool.ruff.lint]select = ["E", "F", "I", "B", "C4", "UP", "W"]ignore = ["E501"]--[tool.pytest.ini_options]-testpaths = ["tests"]-pythonpath = ["."]diff --git a/requirements.txt b/requirements.txtnew file mode 100644index 0000000..4635c9f--- /dev/null+++ b/requirements.txt@@ -0,0 +1,107 @@+# This file was autogenerated by uv via the following command:+# uv export --frozen --no-dev --no-emit-project --no-hashes --no-annotate --output-file requirements.txt+accelerate==1.15.0+annotated-doc==0.0.5+annotated-types==0.8.0+antlr4-python3-runtime==4.9.3+anyio==4.15.1+apache-tvm-ffi==0.1.14.post1+braceexpand==0.1.7+certifi==2026.7.22+charset-normalizer==3.5.2+click==8.5.0+colorama==0.4.6 ; sys_platform == 'win32'+contourpy==1.4.0+cuda-bindings==12.9.4+cuda-pathfinder==1.8.3+cycler==0.12.1+diffusers==0.40.0+einops==0.8.2+filelock==4.0.11+flash-attn-4==4.0.0b33+fonttools==4.66.1+fsspec==2026.9.0+ftfy==6.3.1+googleapis-common-protos==1.75.5+h11==0.16.0+hf-xet==1.6.0 ; platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'+httpcore==1.0.9+httpx==0.28.1+huggingface-hub==1.33.0+idna==3.20+importlib-metadata==9.0.1+jinja2==3.1.6+kiwisolver==1.5.1+markdown-it-py==4.2.0+markupsafe==3.0.4+matplotlib==3.11.2+mdurl==0.1.2+mpmath==1.3.0+networkx==3.7+numpy==2.5.3+nvidia-cublas-cu12==12.8.4.1 ; sys_platform == 'linux'+nvidia-cuda-cupti-cu12==12.8.90 ; sys_platform == 'linux'+nvidia-cuda-nvrtc-cu12==12.8.93 ; sys_platform == 'linux'+nvidia-cuda-runtime-cu12==12.8.90 ; sys_platform == 'linux'+nvidia-cudnn-cu12==9.10.2.21 ; sys_platform == 'linux'+nvidia-cufft-cu12==11.3.3.83 ; sys_platform == 'linux'+nvidia-cufile-cu12==1.13.1.3 ; sys_platform == 'linux'+nvidia-curand-cu12==10.3.9.90 ; sys_platform == 'linux'+nvidia-cusolver-cu12==11.7.3.90 ; sys_platform == 'linux'+nvidia-cusparse-cu12==12.5.8.93 ; sys_platform == 'linux'+nvidia-cusparselt-cu12==0.7.1 ; sys_platform == 'linux'+nvidia-cutlass-dsl==4.8.0+nvidia-cutlass-dsl-libs-base==4.8.0+nvidia-cutlass-dsl-libs-core==4.8.0+nvidia-cutlass-dsl-libs-cu12==4.8.0+nvidia-nccl-cu12==2.27.5 ; sys_platform == 'linux'+nvidia-nvjitlink-cu12==12.8.93 ; sys_platform == 'linux'+nvidia-nvshmem-cu12==3.4.5 ; sys_platform == 'linux'+nvidia-nvtx-cu12==12.8.90 ; sys_platform == 'linux'+omegaconf==2.3.1+opentelemetry-api==1.45.0+opentelemetry-exporter-http-transport==0.66b0+opentelemetry-exporter-otlp-common==0.66b0+opentelemetry-exporter-otlp-proto-common==1.45.0+opentelemetry-exporter-otlp-proto-http==1.45.0+opentelemetry-proto==1.45.0+opentelemetry-sdk==1.45.0+opentelemetry-semantic-conventions==0.66b0+packaging==26.3+pillow==12.3.0+platformdirs==4.12.3+protobuf==7.36.2+psutil==7.2.2+pydantic==2.13.5+pydantic-core==2.46.5+pygments==2.21.0+pyparsing==3.3.3+python-dateutil==2.9.0.post0+pyyaml==6.0.3+quack-kernels==0.6.5+regex==2026.9.29+requests==2.34.2+rich==15.0.0+safetensors==0.8.0+sentencepiece==0.2.2+setuptools==84.0.0+shellingham==1.5.4+six==1.17.0+sympy==1.14.0+tokenizers==0.23.2+torch==2.10.0+cu128+torch-c-dlpack-ext==0.1.5+torchcodec==0.10.0+torchvision==0.25.0+cu128+tqdm==4.70.1+transformers==5.18.0+triton==3.6.0 ; sys_platform == 'linux'+typer==0.27.2+typing-extensions==4.16.0+typing-inspection==0.4.4+urllib3==2.8.0+wandb==0.30.0+wcwidth==0.9.2+webdataset==1.0.2+xxhash==4.0.1+zipp==4.1.1diff --git a/run.sh b/run.shindex e3729e4..aafc503 100644--- a/run.sh+++ b/run.sh@@ -21,6 +21,34 @@ fishift 2extra_args=("$@")+# Use the activated conda/venv interpreter throughout, including torchrun.+# Without an activated environment, retain the uv-managed project default.+runtime="${LOOKING_AHEAD_ENV:-auto}"+if [[ "$runtime" == auto ]]; then+ if [[ -n "${CONDA_PREFIX:-}" || -n "${VIRTUAL_ENV:-}" ]]; then+ runtime=active+ else+ runtime=uv+ fi+fi+case "$runtime" in+ active)+ if [[ -z "${CONDA_PREFIX:-}" && -z "${VIRTUAL_ENV:-}" ]]; then+ echo 'Activate your conda or virtual environment before using LOOKING_AHEAD_ENV=active.' >&2+ exit 1+ fi+ python_cmd=(python) ;;+ uv)+ if ! command -v uv &>/dev/null; then+ echo 'Activate the project conda/virtual environment, or install uv.' >&2+ exit 1+ fi+ python_cmd=(uv run python) ;;+ *)+ echo 'LOOKING_AHEAD_ENV must be auto, active or uv.' >&2+ exit 1 ;;+esac+get_num_gpus() {if [[ -n "${CUDA_VISIBLE_DEVICES:-}" ]]; thenlocal devices@@ -103,9 +131,9 @@ for arg in "${extra_args[@]}"; docase "$arg" in-h|--help|--dry_run)if [[ "$action" == train ]]; then- exec uv run python "${cmd[@]}"+ exec "${python_cmd[@]}" "${cmd[@]}"else- exec uv run python -m src.utils.launcher_entry "$action" \+ exec "${python_cmd[@]}" -m src.utils.launcher_entry "$action" \--config_path "$config" "${extra_args[@]}"fi ;;esac@@ -125,15 +153,15 @@ fiif [[ "$action" == train ]]; thenTRAIN_LOG_DIR="$(WORLD_SIZE=$(( WORLD_SIZE * NUM_GPUS )) RANK="$RANK" \- uv run python -m src.utils.train_cli --config_path "$config" "${extra_args[@]}")"+ "${python_cmd[@]}" -m src.utils.train_cli --config_path "$config" "${extra_args[@]}")"exec > >(tee -- "$TRAIN_LOG_DIR/launcher.log") 2>&1echo "Training launcher logs: $TRAIN_LOG_DIR"echo "Node rank: $RANK; nodes: $WORLD_SIZE; GPUs per node: $NUM_GPUS"- exec uv run torchrun "${torch_args[@]}" --redirects 3 --tee 3 \+ exec "${python_cmd[@]}" -m torch.distributed.run "${torch_args[@]}" --redirects 3 --tee 3 \--log-dir "$TRAIN_LOG_DIR" "${cmd[@]}"elseif [[ "$DEBUG" != 1 ]]; thentorch_args+=(--redirects 3 --tee 3 --log-dir .torchrun_logs)fi- exec uv run torchrun "${torch_args[@]}" "${cmd[@]}"+ exec "${python_cmd[@]}" -m torch.distributed.run "${torch_args[@]}" "${cmd[@]}"fi