Skip to content

My GPU and lite versions: pick your card, see what runs on it, run the quantized copies - #20

Merged
neuregex merged 7 commits into
mainfrom
vram-lite
Nov 26, 2026
Merged

neuregex merged 7 commits into
mainfrom
vram-lite

Conversation

@neuregex

@neuregex neuregex commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

A Reddit user with an RTX 5080 (16 GB) said he could not run most of the apps. This adds a My GPU picker and a
lite version of every app whose models have smaller copies, so people with less VRAM can see what runs on their
card and run the quantized version. Where no official 4-bit copy exists, Freefield makes its own and publishes it on
Hugging Face.

What changes

Lite versions (lite/)

  • lite/variants.json: which file is replaced by which smaller copy of the same model, in ComfyUI's own formats
    (nvfp4, mxfp8, w6a8, fp4 mixed, w4a8). The same loader nodes load them, so the workflows don't change and
    no new custom node is needed. 11 official copies (FLUX 3 Klein, LTX-2.5, Krea 2, Z-Image, Qwen 3 4B, SeedVR2,
    SCAIL-2, MiniMax H3 ×2 and its Qwen3-VL encoder, Qwen 2.5 VL) and 7 made here (an eighth, for Qwen-Image-Edit
    2509, did not pass the comparison below and is not used).
  • packs/<pack>-lite.json (generated by tools/catalog.py): download only what the lite version loads.
    FREEFIELD_PACKS=all-lite picks the lite pack wherever there is one.

Copies made here (tools/quantize.py, lab/lite_modal.py, lab/hf_publish_modal.py)

  • tools/quantize.py writes ComfyUI's asym_w4a8_int8 (4-bit Lloyd-Max codes, fp8 scales every 16 weights, a
    Hadamard rotation) with Comfy Kitchen, only on the layers the official int8/fp8 file quantized, and reports the
    weight error per layer. test/quantize_test.py checks it on a small fake model.
  • lab/lite_modal.py --step quantize made the 8 copies on Modal (20 to 55 s each on an L40S): LTX-2.5's transformer
    and Gemma 4 encoder, Wan 2.1 I2V, Wan 2.2 Fun Camera (high and low noise), Wan Animate 2, Qwen-Image-Edit 2509 and
    MiniMax Music 3's encoder. Reports in lite/reports/, real sizes in lite/variants.json (23.1 GB for LTX-2.5's
    two files instead of 36.9 GB in int8).
  • lab/hf_publish_modal.py uploads each repo from Modal: the files, the LICENSE of the model they come from and the
    card tools/lite_cards.py writes (lite/cards/). It stops if lite/variants.json downloads the repos from another
    account than the token's.

Measuring at card sizes (lab/lite_modal.py --step measure, docs/vram-measured.json)

  • ComfyUI capped to 8, 12, 16 and 24 GB on an L40S (--reserve-vram, a PyTorch memory cap,
    --disable-dynamic-vram), full and lite, with peak VRAM, peak RAM and whether it offloaded weights; 104 runs.
  • Each case runs in a freshly started ComfyUI. The first run kept every case of a card size in one ComfyUI and
    measured the leftovers of the case before (lite runs used more RAM than the full ones they followed); it is not
    used, and docs/vram-measured.json files of that kind (version 1) are ignored.
  • What it found: the lite versions use less RAM (h3-video 40–53 GB against 57–74, relight 19–25 against 43–52,
    LTX-2.5 image to video 33–42 against 50–61). Wan 2.2 Fun Camera runs on 8 to 16 GB only with our copies, and
    Wan Animate 2 runs on 24 GB only with ours. Motion transfer and video upscaling ran out of memory on 8 to 16 GB
    in both versions.
  • A run that kept everything in VRAM but showed more than the card's size in nvidia-smi (the CUDA context and
    kernels count there, outside the cap) counts as RAM offload: a real card that size could not hold it all.

Comparing copies (lab/lite_modal.py --step compare, lite/compare.json)

  • A case again with only some of its files swapped for the lite copies, on several seeds, to see which copy
    changes the result.

Server

  • The registry attaches each copy to its model; ?variant=lite on POST /api/apps/:id/run (and
    npm run app -- <id> --lite) swaps the file names in the workflow, in bound values, options and presets.
  • Each version has its own needs (its own pack); the history records variant: "lite".
  • Lite runs where the backend downloads its own packs (your own GPU, a pod). On Modal it needs the -lite packs in the
    volume and FREEFIELD_LITE=1; without them the run is refused with that message.
  • /api/gpu?device=1 also reports the machine's RAM.

VRAM map (docs/vram-map.*, tools/catalog.py)

  • For 8, 12, 16, 24, 32, 48 and 80 GB cards and each version: fits, or runs offloading part of the weights to RAM,
    with the RAM that needs. Estimates from the weight sizes until a version 2 docs/vram-measured.json replaces them.
  • README: a "Which apps run on your GPU" table.

Studio

  • My GPU chip in the top bar: VRAM 8 to 80 GB and RAM 16 to 128 GB. On your own GPU or a pod it reads the card and
    the RAM from the backend; on Modal you pick them by hand.
  • App cards say Lite, +RAM or Needs RAM for that card; the Apps page can show only what fits.
  • The form of an app with a lite version offers Full / Lite, with the size of each, what each does on your card and
    which one suits it. The How tab lists each lite copy and draws both versions in its VRAM card.
  • The VRAM map follows the card picked, with the counts per level and the lite bars.
  • The Models panel shows each lite pack under its full pack. Results made with the lite version say so.
  • tools/comfy_validate.py also checks each app's lite prompt (107 more prompts in CI).

The copies against the files they replace

Same workflow and seed on an L40S:

  • LTX-2.5 (image to video, 4 s): the same motion and framing; small differences in hair and skin.
  • Wan 2.1 I2V (Cakeify effect): the effect plays out the same way; the cut and the cake inside differ in detail.
  • Wan 2.2 Fun Camera (zoom-in through a library): the frames are almost identical.
  • Wan Animate 2: a coherent motion transfer; the original file runs out of memory in that workflow even on 24 GB,
    so there is no side by side.
  • Qwen-Image-Edit 2509 (relighting, seeds 42, 7 and 1234, one file swapped at a time): with our w4a8 the neon
    light the prompt asks for almost disappears (magenta on 2–3% of the pixels against 12–14%) and halos and grain
    appear; with the official nvfp4 Qwen 2.5 VL alone nothing visible changes. Our copy is out; the lite version
    keeps the official encoder.
  • MiniMax Music 3's encoder (a 10-second folk song with a female vocal, seeds 42, 7 and 1234): a different song
    each time, as different as two seeds of the full version; listened to side by side, they sound as good.

On Hugging Face

  • neuregex/LTX-2.5-w4a8-comfy, neuregex/Wan2.1-I2V-14B-480P-w4a8-comfy, neuregex/Wan2.2-Fun-A14B-Camera-w4a8-comfy,
    neuregex/Wan-Animate-2-w4a8-comfy and neuregex/MiniMax-Music-3-w4a8-comfy, each with the license of the model it
    comes from and a card with how it was made, how it was checked and its measured memory table. lite/variants.json
    downloads the copies from there.

How it was checked

  • npm test (73), npm run typecheck, npm run validate (120 apps), test/quantize_test.py,
    python tools/catalog.py all twice with the same output.
  • The measurement (2026-11-24, 104 runs, each in its own ComfyUI) and the comparison (18 runs, all finished); the
    MiniMax songs listened to side by side.
  • The catalog and the cards ignore the first run's docs/vram-measured.json; pulling that run again writes none of
    its 104 measurements.
  • The studio against a fake RTX 5080 (15.9 GiB, 31 GiB RAM) behind the real gateway: the chip reads 16 GB, the counts
    match docs/vram-map.json; the version switch, the filter, the Models panel and the VRAM map in Spanish, the VRAM map,
    the panel and a form in Russian; no console errors. A Modal-like backend, in English: picking by hand, no version
    switch, a lite run refused.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PgVaGwFeiCrXjWTRomMwRX

neuregex and others added 7 commits November 23, 2026 14:16
…e quantized copies

A Reddit user with an RTX 5080 (16 GB) could not run most apps. Now:

- lite/variants.json: smaller copies of the same models in ComfyUI's native formats
  (nvfp4, mxfp8, w6a8, fp4 mixed), loaded by the same loader nodes. 11 official copies
  for now; 107 apps get a lite version. packs/<pack>-lite.json downloads only what it loads.
- server: the registry attaches each copy to its model, the runner swaps the file names
  (POST /api/apps/:id/run?variant=lite, npm run app -- <id> --lite), each version has its
  own needs; lite runs where the backend downloads its own packs (your GPU, a pod) or on
  Modal with FREEFIELD_LITE=1. /api/gpu?device=1 reports the RAM too.
- docs/vram-map: per card size (8 to 80 GB) and version, fits / offload, and the RAM an
  offload needs; docs/vram-measured.json overrides the estimates once the lab measures.
- studio: a "My GPU" chip (picked by hand, or read from your own GPU or pod) with VRAM and
  RAM sizes; every card says lite / +RAM / needs RAM, the Apps page filters what fits, the
  form offers Full / Lite with what each does on your card, the VRAM map follows the pick,
  the Models panel shows each lite pack under its full pack, results made lite say so.
- comfy_validate also checks each app's lite prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgVaGwFeiCrXjWTRomMwRX
…Modal, Hugging Face publishing

- tools/quantize.py: a bf16 model file to ComfyUI's asym_w4a8_int8 with Comfy Kitchen, quantizing
  exactly the layers the model's official int8/fp8 file quantized (embeddings keep the reference's
  own int8 tensors), with a per-layer weight-error report. Checked against ComfyUI's own loader.
- lite/quantize.json: the eight files without an official 4-bit copy (LTX-2.5 transformer and Gemma
  encoder, Wan 2.1 I2V, Wan 2.2 Fun Camera high/low, Wan Animate 2, Qwen-Image-Edit 2509, MiniMax
  Music 3's encoder), their bf16 sources and references; lite/variants.json points to them (sizes
  are estimates until they are made).
- lab/lite_modal.py: quantize on L40S into the models volume, then a smoke test, then every base
  model of lite/measure.json at 8/12/16/24 GB in its full and lite versions (ComfyUI with
  --reserve-vram, a hard PyTorch cap and --disable-dynamic-vram), recording peak VRAM, peak RAM and
  whether it offloaded; lab/review.py --tiers writes docs/vram-measured.json, which the catalog
  already reads (and now its RAM peaks too).
- lab/hf_publish_modal.py: whoami and one repo per model with its card and license (lite/licenses).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgVaGwFeiCrXjWTRomMwRX
… each measured case in its own ComfyUI

The first measurement on Modal (2026-11-23) ran every case of a card size one after another in one ComfyUI. The
/free the lab sends between cases is only a flag ComfyUI reads between prompts, and offloaded weights stay in
pinned RAM, so a run also carried the models of the one before: the lite runs, which followed the full ones,
used more RAM than them (h3-video at 16 GB: 130 GB against 82 GB) and offloaded at 24 GB where full did not.

- lab/lite_modal.py: every measured case starts its own capped ComfyUI and stops it after; results carry
  own_comfyui, and lab/review.py --tiers keeps only those. docs/vram-measured.json is now version 2;
  tools/catalog.py and tools/lite_cards.py ignore older files. That run is not committed.
- lite/reports/: what tools/quantize.py reported for the 8 copies (all quantized on an L40S in 20 to 55 s;
  weight error per layer ‖W − Ŵ‖/‖W‖ 0.073 everywhere, as expected after the Hadamard rotation).
- lite/variants.json: real sizes. Gemma 4 12B weighs 10.6 GB, not 9.1: its embedding table stays bf16.
  The VRAM map and the LTX-2.5 lite pack follow.
- tools/lite_cards.py and lite/cards/: sizes against the bf16 weights, what was compared before publishing
  (lite/quantize.json "checked"), the ComfyUI commit they ran on; no memory section until a version 2 run.
- lab/hf_publish_modal.py: --only takes several repos, --cards uploads only README.md and LICENSE, and it
  stops if lite/variants.json downloads the repos from another account than the token's. Without --publish
  it lists what it would upload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgVaGwFeiCrXjWTRomMwRX
…ty token

A secret created with an empty HF_TOKEN reached Hugging Face as "Authorization: Bearer " and failed deep in
httpx with "Illegal header value". The token is now stripped of the spaces and line breaks a paste brings, and
an empty one stops with how to create the secret again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgVaGwFeiCrXjWTRomMwRX
…copies

The first lab run gave relight-neon a much weaker neon light with halos in its lite version, which swaps
two files at once (our w4a8 Qwen-Image-Edit 2509 and the official nvfp4 Qwen 2.5 VL), and ref-song a
different song, all on one seed. lab/lite_modal.py --step compare runs lite/compare.json: each case per
variant (none, some or all of its files swapped) and per seed (42, 7, 1234), in one ComfyUI on one GPU
without a memory cap, and downloads the runs and review.html like --step pull.

- lab/core.py: a case's "swap" lists the full files its lite variant replaces, in the prompt and in the
  files it downloads; results carry "compare" and "swap".
- relight-neon: full, dit-w4a8, encoder-nvfp4, lite; ref-song: full, lite (it swaps only the encoder).
- --step pull also takes a compare run's id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgVaGwFeiCrXjWTRomMwRX
…Edit 2509 copy is out

docs/vram-measured.json (version 2) is lab/lite_modal.py --step measure from 2026-11-24: 26 runs on each of
8, 12, 16 and 24 GB, every one in a freshly started ComfyUI. The lite runs now use less RAM than the full ones
(h3-video 40-53 GB against 57-74, relight 19-25 against 43-52). Wan 2.2 Fun Camera runs on 8 to 16 GB only with
our copies, and Wan Animate 2 runs on 24 GB only with ours; motion-transfer and upscale-video ran out of memory
on 8 to 16 GB in both versions.

- tools/catalog.py: a run that kept everything in VRAM but used more than the card's size in nvidia-smi (the
  CUDA context and kernels count there, outside the PyTorch cap) is RAM offload on a real card that size.
  The VRAM map, the README table (now with a failed-in-the-lab column) and the studio follow the measurements.
- tools/lite_cards.py: the memory table says runs or out of memory, with time and RAM, not the peak VRAM of
  the bigger GPU.
- lab/lite_modal.py --step compare (2026-11-24, seeds 42, 7 and 1234): with our w4a8 Qwen-Image-Edit 2509
  alone, relight lost almost all of its neon light (magenta on 2-3% of the pixels against 12-14%) and got
  halos and grain; with the official nvfp4 Qwen 2.5 VL alone it did not change. The copy leaves
  lite/variants.json and is marked publish: false; lab/hf_publish_modal.py and the cards skip it.
- test/mygpu.test.ts: Z-Image and LTX-2.5 follow their measured levels instead of the estimates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgVaGwFeiCrXjWTRomMwRX
…says how it was checked

The compare run of 2026-11-24 (ref-song, seeds 42, 7 and 1234) made a different song with the w4a8
encoder than with the int8 one, about as different as another seed makes it. Listened to side by side,
the songs sound as good, so neuregex/MiniMax-Music-3-w4a8-comfy gets published, and its card gets the
"Checked" line the video repos have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PgVaGwFeiCrXjWTRomMwRX
@neuregex
neuregex marked this pull request as ready for review November 26, 2026 04:23
@neuregex neuregex mentioned this pull request Nov 26, 2026
@neuregex
neuregex merged commit 4dc2e55 into main Nov 26, 2026
6 checks passed
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