Instructions to use mlx-community/Lens-Turbo-3.8B-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Lens-Turbo-3.8B-4bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download mlx-community/Lens-Turbo-3.8B-4bit --local-dir Lens-Turbo-3.8B-4bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Download README.md from mlx-community/Lens-Turbo-3.8B-4bit: direct link, hf CLI and curl.
- Browser
- Download file 1.61 kB
-
https://huggingface.co/mlx-community/Lens-Turbo-3.8B-4bit/resolve/main/README.md
- Command line
-
hf download hf://mlx-community/Lens-Turbo-3.8B-4bit/README.md
-
curl -L -o README.md https://huggingface.co/mlx-community/Lens-Turbo-3.8B-4bit/resolve/main/README.md
license: mit
library_name: mlx
pipeline_tag: text-to-image
tags:
- mlx
- text-to-image
- diffusion
- lens
- lens-turbo
- apple-silicon
base_model: microsoft/Lens-Turbo
Lens-Turbo-3.8B-4bit (MLX)
Apple MLX conversion of microsoft/Lens-Turbo — the distilled 4-step sibling of Lens (identical 3.8B DiT architecture; sample at 4 steps, guidance 1.0). int4 (group_size 64, keeping in/out/time at bf16), ~2.35 GB. DiT-only (MIT); the GPT-OSS-20B encoder (Apache-2.0) and FLUX.2 VAE load from source. Architecture is byte-identical to base Lens, which is parity-locked vs the PT reference (DiT cosine 0.999999); this variant inherits that port.
Usage
from lens_mlx.pipeline_mlx import LensPipeline # github.com/xocialize/lens-mlx
# `base` = a microsoft/Lens snapshot (tokenizer + GPT-OSS encoder + FLUX.2 VAE).
pipe = LensPipeline.from_pretrained(base, dit_repo="mlx-community/Lens-Turbo-3.8B-4bit")
img = pipe("A serene lake below snow-capped mountains, golden hour.",
height=1024, width=1024, num_inference_steps=4, guidance_scale=1.0, seed=42)
img.save("out.png")
Tip: page weights into memory before the first forward (
mx.evalthe params) when loading from slow/external storage, to avoid a Metal command-buffer watchdog timeout at large sizes.
License
DiT weights MIT (from microsoft/Lens-Turbo) · GPT-OSS-20B encoder Apache-2.0 (not re-hosted) · FLUX.2 VAE under its own terms (not re-hosted). Upstream: microsoft/Lens-Turbo.
