Instructions to use cszhilu1998/LiveWorld with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use cszhilu1998/LiveWorld with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("cszhilu1998/LiveWorld", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Download LiveWorld-Code/setup/install_test_env.sh from cszhilu1998/LiveWorld: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/cszhilu1998/LiveWorld/resolve/main/LiveWorld-Code/setup/install_test_env.sh
- Command line
-
hf download hf://cszhilu1998/LiveWorld/LiveWorld-Code/setup/install_test_env.sh
-
curl -L -o install_test_env.sh https://huggingface.co/cszhilu1998/LiveWorld/resolve/main/LiveWorld-Code/setup/install_test_env.sh
1.62 kB
| # Run inside an activated Python 3.11 environment; no model downloads. | |
| set -euo pipefail | |
| cd "$(dirname "$0")/.." | |
| python - <<'PY' | |
| import sys | |
| if sys.version_info[:2] != (3, 11): | |
| raise SystemExit('Use Python 3.11: conda create -n liveworld python=3.11 ffmpeg -c conda-forge -y') | |
| PY | |
| if ! command -v ffmpeg >/dev/null || ! command -v ffprobe >/dev/null; then | |
| echo 'Install FFmpeg first: conda install -c conda-forge ffmpeg -y' >&2 | |
| exit 1 | |
| fi | |
| if ! python - <<'PY' | |
| import torch, torchvision, torchaudio | |
| assert torch.__version__.startswith('2.9.1') and torch.version.cuda == '12.8' | |
| assert torchvision.__version__.startswith('0.24.1') | |
| assert torchaudio.__version__.startswith('2.9.1') | |
| PY | |
| then | |
| python -m pip install torch==2.9.1 torchvision==0.24.1 torchaudio==2.9.1 \ | |
| --index-url https://download.pytorch.org/whl/cu128 | |
| fi | |
| python -m pip install -r setup/requirements_inference.txt | |
| python -m pip install ninja packaging psutil wheel setuptools | |
| if ! python - <<'PY' | |
| import flash_attn | |
| assert flash_attn.__version__ == '2.8.3' | |
| PY | |
| then | |
| MAX_JOBS="${MAX_JOBS:-4}" python -m pip install flash_attn==2.8.3 --no-build-isolation --no-deps --force-reinstall | |
| fi | |
| python -m pip install --no-deps --no-build-isolation -e . -e misc/sam3 | |
| python - <<'PY' | |
| from pathlib import Path | |
| import site | |
| root=Path.cwd().resolve() | |
| (Path(site.getsitepackages()[0])/'stream3r.pth').write_text(str(root/'misc/STream3R')+'\n') | |
| from sam3.model_builder import build_sam3_video_predictor | |
| from stream3r.models.stream3r import STream3R | |
| from pano_inference.dataset import PanoDataset | |
| print('LiveWorld K1/K21 environment imports passed.') | |
| PY | |