Skip to content

Commit 737dbe2

Browse files
authored
Merge pull request Lightricks#44 from Lightricks/feature/linux
Linux support
2 parents bddf887 + f5f03b5 commit 737dbe2

32 files changed

Lines changed: 286 additions & 110 deletions

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
python-embed
3+
dist
4+
dist-electron
5+
release
6+
backend/.venv
7+
backend/outputs
8+
backend/models
9+
.git

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
runner: macos-latest
6060
- os: windows
6161
runner: windows-latest
62+
- os: linux
63+
runner: ubuntu-latest
6264
defaults:
6365
run:
6466
working-directory: backend

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ LTX Desktop is an Electron app for AI video generation using LTX models. Three-l
2121
| `pnpm typecheck:py` | Python pyright only |
2222
| `pnpm backend:test` | Run Python pytest tests |
2323
| `pnpm build:frontend` | Vite frontend build only |
24-
| `pnpm build:mac` / `pnpm build:win` | Full platform builds |
25-
| `pnpm setup:dev:mac` / `pnpm setup:dev:win` | One-time dev environment setup |
24+
| `pnpm build` | Full platform build (auto-detects platform) |
25+
| `pnpm setup:dev` | One-time dev environment setup (auto-detects platform) |
2626

2727
Run a single backend test file via pnpm: `pnpm backend:test -- tests/test_ic_lora.py`
2828

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LTX Desktop
22

3-
LTX Desktop is an open-source desktop app for generating videos with LTX models — locally on supported Windows NVIDIA GPUs, with an API mode for unsupported hardware and macOS.
3+
LTX Desktop is an open-source desktop app for generating videos with LTX models — locally on supported Windows/Linux NVIDIA GPUs, with an API mode for unsupported hardware and macOS.
44

55
> **Status: Beta.** Expect breaking changes.
66
> Frontend architecture is under active refactor; large UI PRs may be declined for now (see [`CONTRIBUTING.md`](docs/CONTRIBUTING.md)).
@@ -32,8 +32,9 @@ LTX Desktop is an open-source desktop app for generating videos with LTX models
3232
| --- | --- | --- |
3333
| Windows + CUDA GPU with **≥32GB VRAM** | Local generation | Downloads model weights locally |
3434
| Windows (no CUDA, <32GB VRAM, or unknown VRAM) | API-only | **LTX API key required** |
35+
| Linux + CUDA GPU with **≥32GB VRAM** | Local generation | Downloads model weights locally |
36+
| Linux (no CUDA, <32GB VRAM, or unknown VRAM) | API-only | **LTX API key required** |
3537
| macOS (Apple Silicon builds) | API-only | **LTX API key required** |
36-
| Linux | Not officially supported | No official builds |
3738

3839
In API-only mode, available resolutions/durations may be limited to what the API supports.
3940

@@ -46,6 +47,14 @@ In API-only mode, available resolutions/durations may be limited to what the API
4647
- 16GB+ RAM (32GB recommended)
4748
- **160GB+ free disk space** (for model weights, Python environment, and outputs)
4849

50+
### Linux (local generation)
51+
52+
- Ubuntu 22.04+ or similar distro (x64 or arm64)
53+
- NVIDIA GPU with CUDA support and **≥32GB VRAM** (more is better)
54+
- NVIDIA driver installed (PyTorch bundles the CUDA runtime)
55+
- 16GB+ RAM (32GB recommended)
56+
- Plenty of free disk space for model weights and outputs
57+
4958
### macOS (API-only)
5059

5160
- Apple Silicon (arm64)
@@ -64,6 +73,7 @@ LTX Desktop stores app data (settings, models, logs) in:
6473

6574
- **Windows:** `%LOCALAPPDATA%\LTXDesktop\`
6675
- **macOS:** `~/Library/Application Support/LTXDesktop/`
76+
- **Linux:** `$XDG_DATA_HOME/LTXDesktop/` (default: `~/.local/share/LTXDesktop/`)
6777

6878
Model weights are downloaded into the `models/` subfolder (this can be large and may take time).
6979

@@ -84,7 +94,7 @@ The LTX API is used for:
8494
- API-based video generations (required on macOS and on unsupported Windows hardware) — paid
8595
- Retake — paid
8696

87-
An LTX API key is required in API-only mode, but optional on Windows local mode if you enable the Local Text Encoder.
97+
An LTX API key is required in API-only mode, but optional on Windows/Linux local mode if you enable the Local Text Encoder.
8898

8999
Generate a FREE API key at the [LTX Console](https://console.ltx.video/). Text encoding is free; video generation API usage is paid. [Read more](https://ltx.io/model/model-blog/ltx-2-better-control-for-real-workflows).
90100

@@ -137,11 +147,7 @@ Prereqs:
137147
Setup:
138148

139149
```bash
140-
# macOS
141-
pnpm setup:dev:mac
142-
143-
# Windows
144-
pnpm setup:dev:win
150+
pnpm setup:dev
145151
```
146152

147153
Run:

backend/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dependencies = [
2727
"uvicorn[standard]>=0.30.0",
2828
"python-multipart>=0.0.9",
2929
"triton-windows; sys_platform == 'win32'",
30+
"triton; sys_platform == 'linux'",
3031
]
3132

3233
[[tool.uv.index]]

backend/runtime_config/runtime_policy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def decide_force_api_generations(system: str, cuda_available: bool, vram_gb: int
88
if system == "Darwin":
99
return True
1010

11-
if system == "Windows":
11+
if system in ("Windows", "Linux"):
1212
if not cuda_available:
1313
return True
1414
if vram_gb is None:

backend/tests/test_runtime_policy_decision.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,21 @@ def test_windows_with_required_vram_allows_local_mode() -> None:
2626
assert decide_force_api_generations(system="Windows", cuda_available=True, vram_gb=31) is False
2727

2828

29+
def test_linux_without_cuda_forces_api() -> None:
30+
assert decide_force_api_generations(system="Linux", cuda_available=False, vram_gb=24) is True
31+
32+
33+
def test_linux_with_low_vram_forces_api() -> None:
34+
assert decide_force_api_generations(system="Linux", cuda_available=True, vram_gb=30) is True
35+
36+
37+
def test_linux_with_unknown_vram_forces_api() -> None:
38+
assert decide_force_api_generations(system="Linux", cuda_available=True, vram_gb=None) is True
39+
40+
41+
def test_linux_with_required_vram_allows_local_mode() -> None:
42+
assert decide_force_api_generations(system="Linux", cuda_available=True, vram_gb=31) is False
43+
44+
2945
def test_other_systems_fail_closed() -> None:
30-
assert decide_force_api_generations(system="Linux", cuda_available=True, vram_gb=48) is True
46+
assert decide_force_api_generations(system="FreeBSD", cuda_available=True, vram_gb=48) is True

backend/uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/CONTRIBUTING.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ Prereqs:
1414
Setup:
1515

1616
```bash
17-
# macOS
18-
pnpm setup:dev:mac
19-
20-
# Windows
21-
pnpm setup:dev:win
17+
pnpm setup:dev
2218
```
2319

2420
Run:

docs/INSTALLER.md

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ This guide explains how to build a distributable installer for **LTX Desktop**.
1010
The installer includes:
1111
- **Electron app** (React frontend + Electron shell)
1212
- **Embedded Python** (version from [`backend/.python-version`](../backend/.python-version)) with all dependencies pre-installed:
13-
- PyTorch (CUDA on Windows, MPS on macOS)
13+
- PyTorch (CUDA on Windows/Linux, MPS on macOS)
1414
- FastAPI, Diffusers, Transformers
1515
- LTX-2 inference packages
1616
- All other required libraries
1717
- **Backend Python code**
1818

1919
**NOT bundled** (downloaded at runtime):
2020
- Model weights (downloaded on first run; can be large) from Hugging Face
21+
- On **Linux** and **Windows**: the Python environment itself is downloaded on first launch (keeps installer small)
2122

2223
The embedded Python is **fully isolated** from the target system's Python — it lives inside `{install_dir}/resources/python/` and never modifies system settings.
2324

@@ -35,67 +36,43 @@ Before building, ensure you have:
3536

3637
- **Windows**: PowerShell 5.1+ (comes with Windows 10/11)
3738
- **macOS**: Xcode Command Line Tools (`xcode-select --install`)
39+
- **Linux**: `build-essential` (or equivalent) for native extensions
3840

3941
## Quick Build
4042

41-
### macOS
4243
```bash
43-
pnpm build:mac
44-
```
45-
46-
### Windows
47-
```powershell
48-
pnpm build:win
44+
pnpm build
4945
```
5046

51-
This will:
47+
This auto-detects your platform and will:
5248
1. Download a standalone Python distribution (version from [`backend/.python-version`](../backend/.python-version))
53-
2. Install all Python dependencies (~10GB on Windows with CUDA, ~2-3GB on macOS with MPS)
49+
2. Install all Python dependencies (~10GB on Windows/Linux with CUDA, ~2-3GB on macOS with MPS)
5450
3. Build the frontend
5551
4. Package everything with electron-builder
56-
5. Create a DMG (macOS) or NSIS installer (Windows) in the `release/` folder
52+
5. Create a DMG (macOS), AppImage + deb (Linux), or NSIS installer (Windows) in the `release/` folder
5753

5854
## Build Options
5955

60-
### macOS
61-
6256
```bash
6357
# Full build
64-
pnpm build:mac
58+
pnpm build
6559

6660
# Skip Python setup (if already prepared)
67-
pnpm build:mac:skip-python
61+
pnpm build:skip-python
6862

6963
# Fast rebuild (unpacked, skip Python + pnpm install)
70-
pnpm build:fast:mac
64+
pnpm build:fast
7165

7266
# Just prepare Python environment
73-
pnpm prepare:python:mac
67+
pnpm prepare:python
7468
```
7569

76-
### Windows
77-
78-
```powershell
79-
# Full build
80-
pnpm build:win
81-
82-
# Skip Python setup (if already prepared)
83-
pnpm build:win:skip-python
84-
85-
# Just prepare Python environment
86-
pnpm prepare:python:win
87-
88-
# Fast rebuild (unpacked, skip Python + pnpm install)
89-
pnpm build:fast:win
90-
91-
# Clean build
92-
powershell -File scripts/local-build.ps1 -Clean
93-
```
70+
All commands auto-detect the current platform (macOS, Linux, or Windows).
9471

9572
### Build Script Options
9673

97-
The `local-build.sh` script accepts:
98-
- `--platform mac|win` — Target platform (auto-detected if omitted)
74+
The underlying `local-build.sh` / `local-build.ps1` scripts also accept:
75+
- `--platform mac|linux|win` — Target platform (auto-detected if omitted)
9976
- `--skip-python` — Use existing `python-embed/` directory
10077
- `--clean` — Remove build artifacts before starting
10178
- `--unpack` — Build unpacked app only (faster, no installer/DMG)
@@ -108,6 +85,15 @@ release/
10885
└── LTX Desktop-<version>-arm64.dmg
10986
```
11087

88+
### Linux
89+
```
90+
release/
91+
├── LTX Desktop-x86_64.AppImage
92+
├── LTX Desktop-amd64.deb
93+
├── LTX Desktop-arm64.AppImage
94+
└── LTX Desktop-arm64.deb
95+
```
96+
11197
### Windows
11298
```
11399
release/
@@ -118,7 +104,7 @@ release/
118104

119105
Place icon files in `resources/` before building:
120106
- `icon.ico` — Windows (multi-size ICO: 256x256, 128x128, 64x64, 48x48, 32x32, 16x16)
121-
- `icon.png` — macOS (1024x1024 recommended)
107+
- `icon.png` — macOS and Linux (1024x1024 recommended)
122108

123109
## Troubleshooting
124110

@@ -137,6 +123,7 @@ xattr -dr com.apple.quarantine /Applications/LTX\ Desktop.app
137123
### Installer is too large
138124
Expected installer sizes (does not include model weights):
139125
- **Windows**: ~10GB (PyTorch CUDA ~2.5GB + ML libraries ~5GB + Python ~200MB + Electron ~100MB)
126+
- **Linux**: ~10GB (similar to Windows; PyTorch CUDA variant)
140127
- **macOS**: ~2-3GB (PyTorch MPS is much smaller than CUDA variant)
141128

142129
### Runtime / first-run issues
@@ -156,10 +143,28 @@ pnpm install
156143
pnpm build:frontend
157144

158145
# 4. Build DMG
159-
npx electron-builder --mac
146+
pnpm exec electron-builder --mac
147+
148+
# Or build unpacked app (faster, for testing)
149+
pnpm exec electron-builder --mac --dir
150+
```
151+
152+
### Linux
153+
```bash
154+
# 1. Prepare Python environment
155+
bash scripts/prepare-python.sh
156+
157+
# 2. Install dependencies
158+
pnpm install
159+
160+
# 3. Build frontend
161+
pnpm build:frontend
162+
163+
# 4. Build AppImage + deb
164+
pnpm exec electron-builder --linux
160165

161166
# Or build unpacked app (faster, for testing)
162-
npx electron-builder --mac --dir
167+
pnpm exec electron-builder --linux --dir
163168
```
164169

165170
### Windows
@@ -174,5 +179,5 @@ pnpm install
174179
pnpm build:frontend
175180
176181
# 4. Build installer
177-
npx electron-builder --win
182+
pnpm exec electron-builder --win
178183
```

0 commit comments

Comments
 (0)