Instructions to use mlx-community/Lens-3.8B-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Lens-3.8B-bf16 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir Lens-3.8B-bf16 mlx-community/Lens-3.8B-bf16
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
Card: show loading the published converted weights via dit_repo
Browse files
README.md
CHANGED
|
@@ -35,18 +35,15 @@ Generates a 1024×1024 image in ~33 s on Apple Silicon (20 steps, ~39 GB peak).
|
|
| 35 |
## Usage
|
| 36 |
|
| 37 |
```python
|
| 38 |
-
import mlx.core as mx
|
| 39 |
from lens_mlx.pipeline_mlx import LensPipeline # github.com/xocialize-code/lens-mlx
|
| 40 |
|
| 41 |
-
|
|
|
|
| 42 |
img = pipe("A serene lake below snow-capped mountains, golden hour.",
|
| 43 |
height=1024, width=1024, num_inference_steps=20, seed=42)
|
| 44 |
img.save("out.png")
|
| 45 |
```
|
| 46 |
|
| 47 |
-
The `lens-mlx` package wires this DiT together with the GPT-OSS encoder (reuse
|
| 48 |
-
`mlx-community/gpt-oss-20b-MXFP4-Q4`) and the FLUX.2 VAE.
|
| 49 |
-
|
| 50 |
## Conversion
|
| 51 |
|
| 52 |
Converted from `microsoft/Lens` with `recipes/convert_lens.py` (lens-mlx). The DiT is pure
|
|
|
|
| 35 |
## Usage
|
| 36 |
|
| 37 |
```python
|
|
|
|
| 38 |
from lens_mlx.pipeline_mlx import LensPipeline # github.com/xocialize-code/lens-mlx
|
| 39 |
|
| 40 |
+
# `base` = a microsoft/Lens snapshot providing the tokenizer, GPT-OSS encoder, and FLUX.2 VAE.
|
| 41 |
+
pipe = LensPipeline.from_pretrained(base, dit_repo="mlx-community/Lens-3.8B-bf16")
|
| 42 |
img = pipe("A serene lake below snow-capped mountains, golden hour.",
|
| 43 |
height=1024, width=1024, num_inference_steps=20, seed=42)
|
| 44 |
img.save("out.png")
|
| 45 |
```
|
| 46 |
|
|
|
|
|
|
|
|
|
|
| 47 |
## Conversion
|
| 48 |
|
| 49 |
Converted from `microsoft/Lens` with `recipes/convert_lens.py` (lens-mlx). The DiT is pure
|