Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d13a554
fix(ltx2): use pure source latents as i2v denoise-mask target
jdilley Apr 20, 2026
b4ed487
feat(chain): add core wire types and request normalisation
jdilley Apr 20, 2026
0328e76
feat(core): MoldClient chain methods
jdilley Apr 20, 2026
e89826f
feat(ltx2): ChainTail type and latent-tail extraction helper
jdilley Apr 21, 2026
e917210
feat(ltx2): staged latent conditioning bypasses VAE encode
jdilley Apr 21, 2026
14801c7
feat(ltx2): chain orchestrator with motion-tail carryover loop
jdilley Apr 21, 2026
350d27e
docs(chain): render-chain-v1 context handoff for resuming work
jdilley Apr 21, 2026
1c142e3
feat(ltx2): Ltx2Engine chain stage renderer with pre-VAE latent tail …
jdilley Apr 21, 2026
548f2fc
feat(server): chain render endpoint with SSE streaming
jdilley Apr 21, 2026
6ed6b59
feat(cli): chain rendering for --frames above clip cap
jdilley Apr 21, 2026
6211182
docs(chain): ltx2 guide, api endpoint, changelog, and skill updates
jdilley Apr 21, 2026
766322e
fix(cli): pass owned String to create_engine in local chain path
jdilley Apr 21, 2026
41e85f7
fix(sd3): truncate CLIP token sequences to 77 with EOS preserved
jdilley Apr 21, 2026
adf1ff6
fix(multi-gpu): stop LTX-2 and upscaler from nuking GPU 0's CUDA context
jdilley Apr 21, 2026
24437ee
feat(web): hide-mode toggle + multi-select delete in gallery
jdilley Apr 21, 2026
ae7ae98
fix(multi-gpu): restore queueing and worker affinity
jdilley Apr 21, 2026
2ff127d
merge: bring multi-gpu queue and affinity fixes into feat/render-chai…
jdilley Apr 21, 2026
2c88463
style: apply rustfmt to ltx2 runtime new_deferred_cuda
jdilley Apr 21, 2026
9f0a5cc
fix(flux): accept flux-krea GGUFs as reference for city96 fine-tunes
jdilley Apr 21, 2026
3fe8839
feat(web): auto-promote long LTX-2 distilled video requests to chain …
jdilley Apr 21, 2026
63471b1
fix(ltx2): cache prompt encoding across chain stages + serialize chai…
jdilley Apr 21, 2026
5fe4f05
feat(web): resource tray, persistent queue, output-format on composer…
jdilley Apr 21, 2026
7760edd
fix(ltx2): stabilize chain seed across stages, bump motion-tail defau…
jdilley Apr 21, 2026
4430fab
docs: add SD3 CLIP 77-token truncation handoff note
jdilley Apr 21, 2026
95a1af9
chore: ignore .worktrees/ directory
jdilley Apr 21, 2026
398f65e
build: speed up local and CI builds
jdilley Apr 21, 2026
60a4ead
merge: bring build-speed improvements into feat/render-chain-v1
jdilley Apr 21, 2026
bd8974d
fix(ltx2): stabilize chain video transitions across all stages
jdilley Apr 21, 2026
77c2e69
fix(web): scroll header on /generate and pin resource tray edge-to-edge
jdilley Apr 21, 2026
65b89a1
Fix soft anchor token retention in LTX-2 chains
jdilley Apr 21, 2026
589cce1
style(ltx2): satisfy cargo fmt on runtime.rs tensor literal
jdilley Apr 22, 2026
6ef6834
ci: tolerate sccache/GHA cache outages
jdilley Apr 22, 2026
ecae6d8
fix(server): satisfy clippy on test-only locking and module order
jdilley Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[alias]
build-dev = "build --profile dev-fast"
run-dev = "run --profile dev-fast"

[build]
incremental = true

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
18 changes: 17 additions & 1 deletion .claude/skills/mold/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ mold run ltx-2-19b-distilled:fp8 "lantern-lit cave entrance" --camera-control do

**Models:** `ltx-2-19b-dev:fp8`, `ltx-2-19b-distilled:fp8`, `ltx-2.3-22b-dev:fp8`, `ltx-2.3-22b-distilled:fp8`

**Important flags:** `--audio`, `--no-audio`, `--audio-file`, `--video`, repeatable `--keyframe`, repeatable `--lora`, `--pipeline`, `--retake`, `--camera-control`, `--spatial-upscale`, `--temporal-upscale`
**Important flags:** `--audio`, `--no-audio`, `--audio-file`, `--video`, repeatable `--keyframe`, repeatable `--lora`, `--pipeline`, `--retake`, `--camera-control`, `--spatial-upscale`, `--temporal-upscale`, `--clip-frames`, `--motion-tail`

**Chained (arbitrary-length) video output:** for LTX-2 19B and 22B distilled models, `--frames` above the 97-frame per-clip cap automatically renders multiple clips with a motion-tail of latents carried across each clip boundary, then stitches them into a single MP4. The CLI picks this path transparently — `mold run ltx-2-19b-distilled:fp8 "a cat walking" --frames 400` produces one 400-frame MP4 from 5 chained stages. Advanced callers can override the per-clip length via `--clip-frames N` (must be `8k+1`, clamped to the model cap) and the overlap via `--motion-tail N` (default 4 pixel frames, 0 disables carryover). Chains fail closed on mid-stage failure (no partial output) and run on a single GPU. Other model families reject `--frames > 97` with an actionable error.

**Current constraints:** `x2` spatial upscaling is wired across the family, `x1.5` spatial upscaling is wired for `ltx-2.3-*`, and `x2` temporal upscaling is wired in the native runtime. Camera-control preset aliases currently auto-resolve the published LTX-2 19B LoRAs only. The family runs through the native Rust stack in `mold-inference`, with CUDA as the supported backend for real local generation, CPU as a correctness-only fallback, and Metal unsupported. On 24 GB Ada GPUs such as the RTX 4090, the validated path stays on the compatible `fp8-cast` mode rather than Hopper-only `fp8-scaled-mm`. The native CUDA matrix is validated across 19B/22B text+audio-video, image-to-video, audio-to-video, keyframe, retake, public IC-LoRA, spatial upscale (`x1.5` / `x2` where published), and temporal upscale (`x2`). When requests go through `mold serve`, the built-in body limit is `64 MiB`, which is enough for common inline source-video and source-audio workflows.

Expand Down Expand Up @@ -535,6 +537,20 @@ MOLD_HOST=http://gpu-host:7680 mold run "a cat"
MOLD_OUTPUT_DIR=/srv/mold/output mold serve
```

### HTTP API Endpoints

Core endpoints exposed by `mold serve` (full list + schemas at `/api/docs`):

- `POST /api/generate` — image/video generation, raw bytes response
- `POST /api/generate/stream` — SSE progress + base64 complete event
- `POST /api/generate/chain` — chained arbitrary-length video (LTX-2 distilled); body is `mold_core::chain::ChainRequest` (canonical `stages[]` or auto-expand `prompt`+`total_frames`+`clip_frames`)
- `POST /api/generate/chain/stream` — same as above, SSE progress with per-stage `denoise_step` events
- `POST /api/expand` — LLM prompt expansion
- `GET /api/models` · `POST /api/models/load` · `POST /api/models/pull` · `DELETE /api/models/unload`
- `GET /api/gallery` · `GET /api/gallery/image/:name` · `GET /api/gallery/thumbnail/:name` · `DELETE /api/gallery/image/:name`
- `POST /api/upscale` · `POST /api/upscale/stream`
- `GET /api/status` · `GET /health` · `GET /api/capabilities`

### Prometheus Metrics

When built with the `metrics` feature flag (included in Docker images and Nix builds), the server exposes a `GET /metrics` endpoint in Prometheus text exposition format. This endpoint is excluded from auth and rate limiting for monitoring scrapers.
Expand Down
95 changes: 49 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "1"

# Note: CUDA builds are not run in CI — they require a GPU host with NixOS + CUDA.
# CI only checks non-CUDA compilation, lints, and tests.
Expand Down Expand Up @@ -56,60 +57,76 @@ jobs:
working-directory: web
run: bun run build

fmt:
rust:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
components: rustfmt,clippy
- name: Install Rust build deps
run: sudo apt-get update && sudo apt-get install -y clang lld nasm libwebp-dev
- uses: mozilla-actions/sccache-action@v0.0.7
- name: Probe sccache (disable on cache outage)
shell: bash
run: |
set +e
printf 'fn main() {}\n' > /tmp/sccache_probe.rs
sccache rustc --edition 2021 -- /tmp/sccache_probe.rs -o /tmp/sccache_probe
status=$?
rm -f /tmp/sccache_probe /tmp/sccache_probe.rs
if [ $status -ne 0 ]; then
echo "sccache probe failed — disabling RUSTC_WRAPPER for this job"
echo "RUSTC_WRAPPER=" >> "$GITHUB_ENV"
sccache --stop-server >/dev/null 2>&1 || true
fi
- uses: Swatinem/rust-cache@v2
with:
shared-key: workspace-default
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Format
run: cargo fmt --all -- --check
- name: Check
run: cargo check --workspace

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: workspace-default
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Clippy
run: cargo clippy --workspace -- -D warnings

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: workspace-default
save-if: ${{ github.ref == 'refs/heads/main' }}
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Test
run: cargo test --workspace
- name: Check with all optional features
run: cargo check -p mold-ai --features preview,discord,expand,tui,webp,mp4

coverage:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v6

- uses: dtolnay/rust-toolchain@stable

- name: Install Rust build deps
run: sudo apt-get update && sudo apt-get install -y clang lld nasm libwebp-dev

- uses: mozilla-actions/sccache-action@v0.0.7

- name: Probe sccache (disable on cache outage)
shell: bash
run: |
set +e
printf 'fn main() {}\n' > /tmp/sccache_probe.rs
sccache rustc --edition 2021 -- /tmp/sccache_probe.rs -o /tmp/sccache_probe
status=$?
rm -f /tmp/sccache_probe /tmp/sccache_probe.rs
if [ $status -ne 0 ]; then
echo "sccache probe failed — disabling RUSTC_WRAPPER for this job"
echo "RUSTC_WRAPPER=" >> "$GITHUB_ENV"
sccache --stop-server >/dev/null 2>&1 || true
fi

- uses: Swatinem/rust-cache@v2
with:
shared-key: workspace-llvm-cov
Expand All @@ -127,17 +144,3 @@ jobs:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false

check-features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: workspace-all-features
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install system deps for optional features
run: sudo apt-get update && sudo apt-get install -y nasm libwebp-dev
- name: Check with all features (preview, discord, expand, tui, webp, mp4)
run: cargo check -p mold-ai --features preview,discord,expand,tui,webp,mp4
26 changes: 22 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ concurrency:
jobs:
build-macos:
runs-on: macos-14
env:
CARGO_INCREMENTAL: "1"
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v6

- uses: dtolnay/rust-toolchain@stable

- uses: mozilla-actions/sccache-action@v0.0.7

- uses: Swatinem/rust-cache@v2
with:
key: macos-release
Expand All @@ -39,11 +45,15 @@ jobs:
# Ada Lovelace (RTX 40-series, sm_89)
build-linux-sm89:
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "1"
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v6

- name: Install nasm (required by openh264 source build for mp4 feature)
run: sudo apt-get update && sudo apt-get install -y nasm
- name: Install build deps
run: sudo apt-get update && sudo apt-get install -y clang lld nasm

- uses: Jimver/cuda-toolkit@v0.2.35
with:
Expand All @@ -53,6 +63,8 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: mozilla-actions/sccache-action@v0.0.7

- uses: Swatinem/rust-cache@v2
with:
key: linux-cuda-sm89-release
Expand All @@ -75,11 +87,15 @@ jobs:
# Blackwell (RTX 50-series, sm_120)
build-linux-sm120:
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: "1"
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v6

- name: Install nasm (required by openh264 source build for mp4 feature)
run: sudo apt-get update && sudo apt-get install -y nasm
- name: Install build deps
run: sudo apt-get update && sudo apt-get install -y clang lld nasm

- uses: Jimver/cuda-toolkit@v0.2.35
with:
Expand All @@ -89,6 +105,8 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- uses: mozilla-actions/sccache-action@v0.0.7

- uses: Swatinem/rust-cache@v2
with:
key: linux-cuda-sm120-release
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Claude Code
.claude/worktrees/
.claude/scheduled_tasks.lock
.worktrees/
.playwright-mcp/
.direnv/

Expand Down
Loading
Loading