Skip to content

Resident FLUX 3 and LTX streaming; image models in a 10.5 GiB GPU budget - #80

Merged
TroyHernandez merged 9 commits into
mainfrom
feat/image-budget
Oct 31, 2026
Merged

TroyHernandez merged 9 commits into
mainfrom
feat/image-budget

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Serving work for small and shared GPUs: the resident handle covers FLUX 3 and the small-card LTX-2.5 placement, and FLUX.2 klein, Z-Image, FLUX 3 and LTX-2.5 each fit a ~10.5 GiB GPU budget (a 16 GB card with a speech pair resident beside them). Contains all of feat/resident-ltx-stream (0.2.2.23) plus the image-budget work (0.2.2.24).

0.2.2.23: resident LTX streaming, FLUX 3, decode

  • resident_load("ltx", stream_text = TRUE) streams Gemma 4 layers; resident_gb passes through, and pinned_bytes counts the streamed blocks, connector sets and encoder layers.
  • resident_load(stage_from = "disk") stages the Gemma 4 encoder from disk too (refuses a non-Gemma 4 text encoder).
  • LTX decode copies the video to the R array 8 frames at a time (.ltx23_video_array), so the host high-water is about 1.3x the result instead of several full-size float copies.
  • resident_load("flux3") serves FLUX 3 Image Klein; flux3_load_pipeline(text_dir =, support_dir =) reads the text encoder, VAE and tokenizer from given directories so every file can come from an offline mount.

0.2.2.24: image models in a 10.5 GiB budget

  • flux2_load_pipeline(stream_text = TRUE) and zimage_load_pipeline(stream_text = TRUE) stream the bf16 Qwen3 layers through the encode; resident_load() passes stream_text to flux2, flux3 and zimage.
  • zimage_load_pipeline(resident_gb =) keeps that many GB of fp8 linears resident and streams the rest, as FLUX 3 does.
  • Z-Image's transformer runs a minor gc after each block (diffuseR.block_gc); each block left 2-3 GB of temporaries until R collected them.
  • A streamed fp8 LTX linear copies its weight into a persistent per-shape device buffer.

Measured (16 GB card held to 10.5 GiB free, expandable segments, 1024x1024)

Model Plan Allocated peak Render
FLUX.2 klein stream_text 6.2 GiB 9-10 s
Z-Image stream_text, all resident 9.9 GiB 16-18 s
Z-Image resident_gb = 4 8.3 GiB 18 s
FLUX 3 8 GB plan 4.5 GiB 26-28 s
LTX-2.5 960x960x145 resident_gb = 4.38, disk 8.3 GiB 242 s

A 3990-byte prompt: FLUX.2 klein unchanged, Z-Image resident_gb = 4 8.8 GiB, FLUX 3 8 GB plan 6.3 GiB / 31 s. FLUX 3 on the 12 GB plan runs out of memory in this budget. Full numbers in NEWS.md.

Tests

Run with tinytest::run_test_file() on the touched areas, all passing: resident 47, sdxl 65, sd21 25, resident_ltx_stream 8, resident_flux3 14, dit_zimage 9, fp8_ltx23 20, txt2img_flux2 5, txt2img_zimage 5, zimage_transformer 6, zimage_revision 4, quantize_zimage 10, ltx23_video_array 9. The full suite was not run.

resident_load("ltx") already forwards resident_gb to ltx23_load_pipeline;
stream_text passes stream to the Gemma 4 loader, so a serving entry can
use the recommend("ltx25") placement on 8-12 GB cards. pinned_bytes now
counts the streamed transformer blocks and encoder layers, which keep
their staging outside the handle's set.
Below 7 GB resident the text connectors stream too, and their sets live
on the connector modules, outside the handle's staging. Disk-staged
pairs, which hold no host copy, count as zero.
@TroyHernandez
TroyHernandez merged commit 27d016b into main Oct 31, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the feat/image-budget branch October 31, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant