Instructions to use microsoft/Lens with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use microsoft/Lens with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("microsoft/Lens", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -356,13 +356,18 @@ python inference.py \
|
|
| 356 |
```bash
|
| 357 |
python inference.py \
|
| 358 |
--repo_id "microsoft/Lens" \
|
|
|
|
| 359 |
--prompt "a red fox in snow|a glass greenhouse at night"
|
| 360 |
```
|
| 361 |
|
| 362 |
**A100 / V100 (no MXFP4 kernels)** — dequantize the GPT-OSS encoder to bf16:
|
| 363 |
|
| 364 |
```bash
|
| 365 |
-
python inference.py
|
|
|
|
|
|
|
|
|
|
|
|
|
| 366 |
```
|
| 367 |
|
| 368 |
### Options
|
|
|
|
| 356 |
```bash
|
| 357 |
python inference.py \
|
| 358 |
--repo_id "microsoft/Lens" \
|
| 359 |
+
--steps 20 --cfg 5.0 \
|
| 360 |
--prompt "a red fox in snow|a glass greenhouse at night"
|
| 361 |
```
|
| 362 |
|
| 363 |
**A100 / V100 (no MXFP4 kernels)** — dequantize the GPT-OSS encoder to bf16:
|
| 364 |
|
| 365 |
```bash
|
| 366 |
+
python inference.py \
|
| 367 |
+
--repo_id "microsoft/Lens" \
|
| 368 |
+
--steps 20 --cfg 5.0 \
|
| 369 |
+
--prompt "a cat" \
|
| 370 |
+
--disable_mxfp4 --offload
|
| 371 |
```
|
| 372 |
|
| 373 |
### Options
|