Premium tools still have polish, but if you just want to prompt a scene and riff quickly, local is faster to loop and cheaper to keep. I set up LTX on my MacBook and a 4070 box. Here is the exact path so you can do the same without hunting through issues.
You have two parts to care about: a working Python environment with PyTorch, and the LTX-Video repo. GPU on Linux or Windows gives you speed. Apple Silicon runs too using MPS, slower but still useful for drafts.
First grab the code.
bash
git clone https://github.com/Lightricks/LTX-Video && cd LTX-Video
Create a virtual env and install PyTorch that matches your hardware. On an NVIDIA box use CUDA 12.1 wheels, then install the repo deps. If you are on Apple Silicon, install the latest PyTorch build with MPS support and skip CUDA.
Quick verify before you go further. Activate your venv and run a GPU check. If this prints True on NVIDIA, or does not crash on Apple with MPS, you are set for the full steps.
bash
python -c "import torch; print(torch.cuda.is_available())"
Stop here if you only needed proof your box is ready. The full guide covers per-OS setup, expected outputs, config tips like VRAM budgets and frame counts, and fixes for CUDA mismatches, OOM, and missing ffmpeg.
You have two parts to care about: a working Python environment with PyTorch, and the LTX-Video repo. GPU on Linux or Windows gives you speed. Apple Silicon runs too using MPS, slower but still useful for drafts.
First grab the code.
bash
git clone https://github.com/Lightricks/LTX-Video && cd LTX-Video
Create a virtual env and install PyTorch that matches your hardware. On an NVIDIA box use CUDA 12.1 wheels, then install the repo deps. If you are on Apple Silicon, install the latest PyTorch build with MPS support and skip CUDA.
Quick verify before you go further. Activate your venv and run a GPU check. If this prints True on NVIDIA, or does not crash on Apple with MPS, you are set for the full steps.
bash
python -c "import torch; print(torch.cuda.is_available())"
Setup
macOS (Apple Silicon)
- Install Homebrew (Homebrew is the macOS package manager).
- Install Python 3.10 or newer and ffmpeg.
bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install [email protected] ffmpeg
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install torch torchvision torchaudio
export PYTORCH_ENABLE_MPS_FALLBACK=1
Then install repo deps inside the cloned LTX-Video folder. If the repo provides a requirements.txt, use it. If it ships a setup.py, install editable.
bash
pip install -r requirements.txt || pip install -e .
Linux (Ubuntu 22.04 example, NVIDIA GPU)
- Install GPU drivers and CUDA runtime that matches the PyTorch wheel. CUDA 12.1 works well.
- Install ffmpeg.
bash
sudo apt update
sudo apt install -y ffmpeg python3-venv build-essential
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt || pip install -e .
Check your driver with nvidia-smi. If it prints your GPU and a CUDA version around 12, you are aligned.
bash
nvidia-smi
Windows 11 (NVIDIA GPU)
- Install Python 3.11 from python.org or the Store.
- Install ffmpeg with winget (winget is the Windows package manager).
bash
winget install Gyan.FFmpeg
py -m venv .venv
.\.venv\Scripts\activate
python -m pip install --upgrade pip
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt || pip install -e .
If you need xformers for speed and memory, match it to your CUDA wheel.
bash
pip install xformers==0.0.25.post1 --index-url https://download.pytorch.org/whl/cu121
Verify
Confirm PyTorch sees your accelerator.
bash
python - <<'PY'
import torch, platform
print('python', platform.python_version())
print('torch', torch.__version__)
if torch.cuda.is_available():
print('cuda', torch.version.cuda)
print('device', torch.cuda.get_device_name(0))
else:
print('cuda_unavailable')
try:
import xformers
print('xformers', xformers.__version__)
except Exception:
print('xformers_unavailable')
PY
Expected on Linux or Windows with NVIDIA:
- torch shows a cu121 suffix in its version.
- device prints your GPU name, for example GeForce RTX 4070.
Expected on Apple Silicon:
- cuda_unavailable is fine. MPS will run on Apple GPUs when you invoke the model.
Configuration tips
- VRAM budgets you can trust: 8 GB runs short 6 to 8 second drafts if you keep frames low. 12 GB does 8 to 12 seconds comfortably. 24 GB lets you push longer clips or higher resolution without paging.
- Frames vs VRAM: halving frames cuts memory roughly in half. Start with 16 frames at 512 by 288, then grow to 24 or 32 when stable.
- FPS vs motion: render at 8 fps for ideation. Upsample later to 24 fps with ffmpeg interpolation to keep GPU time down.
- Set CUDA allocator to avoid fragmentation during long runs.
bash
export PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:128
- Keep ffmpeg in path and stitch frames locally. If the repo provides per-frame outputs, encode yourself.
bash
ffmpeg -framerate 8 -i frames/%05d.png -pix_fmt yuv420p -crf 18 out.mp4
Troubleshooting
1) CUDA error: invalid device function
- Your torch wheel does not match your driver or CUDA runtime. Reinstall torch with the cu121 wheel and restart the venv. Update your NVIDIA driver if it is older than 535.
bash
pip uninstall -y torch torchvision torchaudio
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
2) Out of memory while sampling
- Drop frames and resolution. Close Chrome and any GPU apps. Set a smaller max split size and retry.
bash
export PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:64
On Windows, also raise the pagefile to System managed size and reboot.
3) ffmpeg not found
- Install it and ensure PATH is updated.
bash
# macOS
brew install ffmpeg
# Ubuntu
sudo apt install -y ffmpeg
# Windows PowerShell
winget install Gyan.FFmpeg
When it beats Veo 3
- Fast idea loops: you can prompt, tweak, and rerun with zero queue. Ten drafts in ten minutes on a 4070 is normal at low fps and short clips.
- Private footage: you keep your inputs and outputs on disk. No uploads, no third party storage.
- Offline travel kit: on a laptop with an eGPU or just Apple Silicon, you still get usable drafts on a flight or in bad hotel Wi‑Fi.
- Cost control: once your GPU is set, you pay nothing per render. That saves real money on daily iterations.
Sources
-
Want a hand?
Book a 30-min call.
Walk through your stack with us. We'll find the bottleneck and map out the exact wiring you need — free.