> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Lens：ComfyUI 中的 3.8B 开源文生图模型

> 在 ComfyUI 中运行微软开源的 3.8B 文生图模型 Lens，提供标准与 Turbo 工作流，基于双流 MMDiT 和 FLUX.2 语义 VAE。

**Lens** 是 **微软** 开源的文生图模型，采用 MIT 许可证。拥有 **38亿** 参数，采用 **双流 MMDiT** 架构，配合 **GPT-OSS-20B** 文本编码器特征和 **FLUX.2 语义 VAE**，以远少于大模型的训练算力实现了具有竞争力的图像质量。

**模型亮点**：

* **双流 MMDiT 架构** — 图像和文本联合处理，生成更连贯
* **GPT-OSS-20B 多层文本特征** — 强大的文本理解能力，精准遵循提示
* **FLUX.2 语义 VAE** — 高保真潜在空间表示
* **混合分辨率训练** — 支持多种宽高比，无需裁切
* **38亿参数紧凑模型** — 在 24 GB 显存的消费级 GPU 上即可运行

**相关链接**：

* [论文 (arXiv)](https://arxiv.org/abs/2605.21573)
* [GitHub](https://github.com/microsoft/Lens)
* [Hugging Face (微软)](https://huggingface.co/microsoft/Lens)
* [Hugging Face (Comfy-Org)](https://huggingface.co/Comfy-Org/Lens)

## Lens 文生图工作流

标准版和 Turbo 版均使用 **Subgraph** 节点管理文生图生成流程。你可以打开子图查看或自定义内部节点。

> [card] [了解 Subgraph](https://docs.comfy.org/zh/interface/features/subgraph.md)
>
> 本工作流使用 Subgraph 节点实现模块化处理。查看 Subgraph 文档了解如何自定义和扩展工作流。

### Lens：文生图

输入文本提示并选择分辨率和宽高比。使用高效的 Lens 文生图模型生成高质量图像。

![Lens 文生图工作流预览](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/image_lens_t2i-1.webp)

> [card] [下载工作流](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_lens_t2i.json)
>
> 下载 JSON 或在模板库中搜索 "Lens"

**示例输出**

![Lens 文生图示例输出](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/image_lens_t2i.png)

> [!TIP]
>
> > [tab] 本地用户
> >
> > 请确保你的 ComfyUI 已经更新。
> >
> > * [ComfyUI 下载](https://www.comfy.org/download)
> > * [ComfyUI 更新教程](https://docs.comfy.org/zh/installation/update_comfyui.md)
> >
> > 本指南里的工作流可以在[工作流模板](https://docs.comfy.org/zh/interface/features/template.md)中找到。如果找不到，可能是 ComfyUI 没有更新。
> >
> > 如果加载工作流时有节点缺失，可能原因有：
> >
> > 1. 你用的不是最新版（每夜版）。
> > 2. 启动时有些节点导入失败。
>
> > [tab] 云端用户
> >
> > * [Cloud](https://cloud.comfy.org) 会在 ComfyUI 稳定版本发布后更新。
> >
> > 所以，如果你发现本文档中有任何核心节点缺失，可能是因为新核心节点尚未在最新稳定版中发布。请等待下一个稳定版发布。

#### 开始使用

1. 更新 ComfyUI 到最新版本
2. 前往 **模板** 并搜索 **Lens**
3. 选择 **Lens** 工作流
4. 下载缺失的模型（见 [模型下载](#模型下载)），输入提示词，然后点击 **队列运行**

### Lens Turbo：文生图

输入文本提示，选择分辨率、宽高比和推理步数。使用 Lens 文生图模型生成高质量图像。

![Lens Turbo 文生图工作流预览](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/image_lens_turbo_t2i-1.webp)

> [card] [下载工作流](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_lens_turbo_t2i.json)
>
> 下载 JSON 或在模板库中搜索 "Lens Turbo"

**示例输出**

![Lens Turbo 文生图示例输出](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/image_lens_turbo_t2i.png)

#### 开始使用

1. 更新 ComfyUI 到最新版本
2. 前往 **模板** 并搜索 **Lens Turbo**
3. 选择 **Lens Turbo** 工作流
4. 下载缺失的模型（见 [模型下载](#模型下载)），输入提示词，然后点击 **队列运行**

## 模型下载

所有模型文件可在 Hugging Face 上的 [Comfy-Org/Lens](https://huggingface.co/Comfy-Org/Lens) 找到。

> [card] [lens\_bf16.safetensors](https://huggingface.co/Comfy-Org/Lens/blob/main/diffusion_models/lens_bf16.safetensors)
>
> Lens 扩散模型 (BF16)

> [card] [lens\_turbo\_bf16.safetensors](https://huggingface.co/Comfy-Org/Lens/blob/main/diffusion_models/lens_turbo_bf16.safetensors)
>
> Lens Turbo 扩散模型 (BF16)

> [card] [gpt\_oss\_20b\_nvfp4.safetensors](https://huggingface.co/Comfy-Org/Lens/blob/main/text_encoders/gpt_oss_20b_nvfp4.safetensors)
>
> Lens 和 Lens Turbo 共用的文本编码器 (GPT-OSS-20B)

> [card] [flux2-vae.safetensors](https://huggingface.co/Comfy-Org/Lens/blob/main/vae/flux2-vae.safetensors)
>
> Lens 和 Lens Turbo 共用的 VAE (FLUX.2)

**模型存放路径**

```
📂 ComfyUI/
├── 📂 models/
│   ├── 📂 diffusion_models/
│   │   ├── lens_bf16.safetensors（或 lens_mxfp8.safetensors）
│   │   └── lens_turbo_bf16.safetensors（或 lens_turbo_mxfp8.safetensors）
│   ├── 📂 text_encoders/
│   │   └── gpt_oss_20b_nvfp4.safetensors
│   └── 📂 vae/
│       └── flux2-vae.safetensors
```

## 可用模型

| 模型 | 描述 | 推理步数 | 链接 |
| - | - | - | - |
| Lens | 标准 3.8B 模型 — 更高质量，更多步数 | \~50 | [Hugging Face](https://huggingface.co/microsoft/Lens) |
| Lens Turbo | 蒸馏版 — 更少步数，更快生成 | \~8 | [Hugging Face](https://huggingface.co/microsoft/Lens) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.