> ## 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.

# WeVisOne-VL：ComfyUI 文本提示分割与检测

> 在 ComfyUI 中使用 WeVisOne-VL 对图像进行分割、检测、计数和 OCR：输入一句简短的文本查询，即可输出透明度蒙版、边界框、点或原始答案。

WeVisOne-VL 是一个紧凑的视觉语言模型，它以形状而非文字段落来给出答案。给它一张图像和一段简短的文本查询，它就能在一次推理中返回边框、点，或每个实例的 alpha 遮罩：无需标注，也无需逐对象提示。

在 ComfyUI 中，它以 **WeVisOne-VL Detect** 节点运行。下面的模板将它封装在一个子图中，并预览遮罩、绘制在来源图像上的边框，以及前景和背景抠图，因此该遮罩可以直接接入背景移除、蒙版或合成流程。

权重为腾讯发布的 Apache-2.0 版本，已在 [Comfy-Org/WeVisOne-VL](https://huggingface.co/Comfy-Org/WeVisOne-VL) 中为 ComfyUI 重新打包。支持已随 [ComfyUI #17632](https://github.com/Comfy-Org/ComfyUI/pull/17632) 合入，该模板需要 ComfyUI 0.45.0 或更高版本。

> [!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 稳定版本发布后更新。
> >
> > 所以，如果你发现本文档中有任何核心节点缺失，可能是因为新核心节点尚未在最新稳定版中发布。请等待下一个稳定版发布。

## 图像分割：WeVisOne-VL

在 `query` 中输入想要抠出的内容并运行。使用默认的 `segmentation` 任务和查询 `human` 时，画面会返回一张把找到的人合并在一起的遮罩，以及他们的盒子。若要为人各生成一张遮罩，请在节点上打开 `individual_masks`。

![WeVisOne-VL 分割工作流预览，包含蒙版、盒子和抠图](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/utility_image_segment_wevisone_vl-1.webp)

> [card] [下载工作流](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/utility_image_segment_wevisone_vl.json)
>
> 下载 JSON，或在模板库中搜索 "图像分割：WeVisOne-VL"

**输入素材**

> [card] [utility\_image\_segment\_wevisone\_vl\_input.png](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/utility_image_segment_wevisone_vl_input.png)
>
> 加载到 `LoadImage` 节点中

## 任务

`task` 控件会将查询改写为 checkpoint 训练时所使用的指令。每种任务接受的查询形式略有不同：

| `task` | 查询形式 | 返回 |
| :- | :- | :- |
| `segmentation` | 一个简短的名词短语，例如 `human` | 透明度遮罩和盒子（未开启 `individual_masks` 时为一张合并遮罩） |
| `detection` | 每行一个标签 | 仅盒子 |
| `referring` | 一个描述性短语，例如 `the cup on the left` | 盒子 |
| `point` | 每行一个标签 | 以 JSON 表示的中心点 |
| `count_box` | 要计数的对象 | 一个计数，每个实例带一个盒子 |
| `count_point` | 要计数的对象 | 一个计数，每个实例带一个点 |
| `ocr` | 无 | 图像中每个单词上的盒子 |
| `ocr_grounding` | 要查找的精确字符串 | 该字符串周围的盒子 |
| `visual_prompt` | 无，使用 `bboxes` 输入 | 与参考盒子相似的对象的盒子 |
| `freeform` | 任意内容 | 原始回答，查询作为完整 prompt |

保持查询简短。完整句子会让 `segmentation` 输出冗长，而直接点明目标的短语比对其进行描述效果更好。

## 模型

该工作流加载的是 2B INT8 文本编码器。其余三个文件可直接替换 `CLIPLoader` 节点中的 `clip_name`（类型为 `stable_diffusion`）：两个 4B 文件体积更大、速度更慢，而 BF16 文件则以体积换取精度。

> [card] [2B INT8（本工作流）](https://huggingface.co/Comfy-Org/WeVisOne-VL/resolve/main/text_encoders/wevisone_vl_2b_int8_convrot.safetensors)
>
> wevisone\_vl\_2b\_int8\_convrot.safetensors → ComfyUI/models/text\_encoders/

> [card] [2B BF16](https://huggingface.co/Comfy-Org/WeVisOne-VL/resolve/main/text_encoders/wevisone_vl_2b_bf16.safetensors)
>
> wevisone\_vl\_2b\_bf16.safetensors → ComfyUI/models/text\_encoders/

> [card] [4B INT8](https://huggingface.co/Comfy-Org/WeVisOne-VL/resolve/main/text_encoders/wevisone_vl_4b_int8_convrot.safetensors)
>
> wevisone\_vl\_4b\_int8\_convrot.safetensors → ComfyUI/models/text\_encoders/

> [card] [4B BF16](https://huggingface.co/Comfy-Org/WeVisOne-VL/resolve/main/text_encoders/wevisone_vl_4b_bf16.safetensors)
>
> wevisone\_vl\_4b\_bf16.safetensors → ComfyUI/models/text\_encoders/

## 对节点进行更多控制

* **`individual_masks`**：on 时，每个边界框一个遮罩；off 时，每帧一个并集遮罩
* **`max_length`**：回答长度上限，默认为 4096 个 token，最高为 32768 个 token
* **输出**：`masks`、`bboxes`、`points`（包含 x、y、label 和 frame 的 JSON）以及 `text`（原始回答）


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