Local Ai
We applied BitNet-style ternary quantization to a super-resolution transformer. The whole model is 668 KB gzipped and runs in the browser.
Everyone's been doing 1.58-bit for LLMs, so we tried it on a vision transformer: Swin2SR (lightweight ×2 variant, 1.01M params), quantized so every weight is −1, 0, or +1 with a small per-group scale
Everyone's been doing 1.58-bit for LLMs, so we tried it on a vision transformer: Swin2SR (lightweight ×2 variant, 1.01M params), quantized so every weight is −1, 0, or +1 with a small per-group scale (~2.18 effective bits/weight including scales). Results on Set5 ×2 (RGB PSNR): Method PSNR Bicubic 31.79 dB Ternary 1.58-bit 34.44 dB +2.66 dB over bicubic from a model whose gzipped ONNX is 668 KB - it downloads faster than most of the images it upscales. Runs client-side with ONNX Runtime Web, so nothing gets uploaded anywhere. Also ships as safetensors for Transformers. Honest limitations, because this sub can smell marketing a mile away: ×2 clean upscaling only — it's not going to rescue a heavily JPEG'd 240p meme Non-generative: it sharpens what's there, doesn't invent detail Ternary trades some peak fidelity vs the FP32 original for the ~7× smaller download Apache 2.0, derived from caidas/swin2SR-lightweight-x2-64 (mv-lab's Swin2SR). Model: https://huggingface.co/clark-labs/clark-swin2sr-lightweight-x2-1.58bit Happy to answer questions about the quantization recipe. https://preview.redd.it/0b4evzso2jgh1.png?width=1120&format=png&auto=webp&s=b1a3b35406fbd03358919ad8499c87aa295b1676 submitted by /u/Any_Tie_1861 [link] [comments]
Source: r/StableDiffusion | 2026-07-31