> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-chore-sync-comfy-api-v2-spec.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Qwen-Image-2.1 ComfyUI 原生工作流示例

> 在 ComfyUI 中运行 Qwen-Image-2.1：一个模型即可完成图像生成与编辑，原生 2K 输出，专业级文字排版，并支持透明度通道。

**Qwen-Image-2.1** 是阿里 Qwen 团队 Qwen-Image 系列中最新发布的开放权重版本。单一模型同时涵盖文生图生成和基于指令的图像编辑，原生支持 2K 输出、专业排版，并具备用于透明背景的 alpha 通道。

**主要特性**：

* **生成与编辑合一**：同一套权重既可用于文生图提示词，也可用于编辑指令，因此工作流无需切换模型
* **原生 2K 输出**：直接生成最高 2048x2048 的图像，而无需对较小结果进行图像放大
* **专业排版**：密集的小号文字和复杂版式依然清晰，适用于信息图、幻灯片、UI 原型图、海报和包装设计
* **Alpha 通道支持**：VAE 携带四个通道，因此可以直接生成和编辑透明背景图像，而无需事后再进行抠图
* **多图像编辑**：参考图像按槽位顺序拼接到文本编码器中。节点提供 `image_1` 到 `image_16` 槽位，提示词通过索引引用它们，例如 `image_1` 写作 `<image1>`
* **局部编辑**：描述要更改的对象或区域，图像的其余部分保持不变

**相关链接**：

* [GitHub 仓库](https://github.com/QwenLM/Qwen-Image)
* [Hugging Face（ComfyUI 模型）](https://huggingface.co/Comfy-Org/Qwen-Image-2.1)
* [Comfy 上的 Qwen Image 2.1](https://comfy.org/qwen-image-2.1/)

## Qwen-Image-2.1 工作流

<Tip>
  <Tabs>
    <Tab title="本地用户">
      请确保你的 ComfyUI 已经更新。

      * [ComfyUI 下载](https://www.comfy.org/download)
      * [ComfyUI 更新教程](/zh/installation/update_comfyui)

      本指南里的工作流可以在[工作流模板](/zh/interface/features/template)中找到。如果找不到，可能是 ComfyUI 没有更新。

      如果加载工作流时有节点缺失，可能原因有：

      1. 你用的不是最新版（每夜版）。
      2. 启动时有些节点导入失败。
    </Tab>

    <Tab title="云端用户">
      * [Cloud](https://cloud.comfy.org) 会在 ComfyUI 稳定版本发布后更新。

      所以，如果你发现本文档中有任何核心节点缺失，可能是因为新核心节点尚未在最新稳定版中发布。请等待下一个稳定版发布。
    </Tab>
  </Tabs>
</Tip>

<h3 id="image_qwen_image_2_1_t2i">
  Qwen Image 2.1 文本到图像
</h3>

根据您选择的宽高比和百万像素目标，从文本提示生成图像。

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/image_qwen_image_2_1_t2i-1.webp" alt="Qwen-Image-2.1 文本到图像工作流预览" />

<CardGroup cols={2}>
  <Card title="下载工作流" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_qwen_image_2_1_t2i.json">
    下载 JSON 或在模板库中搜索 “Qwen-Image-2.1”
  </Card>

  <Card title="在 Comfy Cloud 上运行" icon="cloud" href="https://cloud.comfy.org/?template=image_qwen_image_2_1_t2i&utm_source=docs&utm_medium=referral&utm_campaign=qwen-image-2-1">
    零设置在线运行 ComfyUI
  </Card>
</CardGroup>

**示例输出**

![Qwen-Image-2.1 文本到图像示例输出](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/Qwen_image_2.1.png)

<h3 id="image_qwen_image_2_1_image_edit">
  Qwen Image 2.1 图像编辑
</h3>

使用指令编辑图像。当编辑需要源图像中不存在的内容时，添加参考图像，例如将第二张照片中的服装穿到第一张照片中的人物身上。

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/image_qwen_image_2_1_image_edit-1.webp" alt="Qwen-Image-2.1 图像编辑工作流预览" />

<CardGroup cols={2}>
  <Card title="下载工作流" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_qwen_image_2_1_image_edit.json">
    下载 JSON 或在模板库中搜索 “Qwen-Image-2.1”
  </Card>

  <Card title="在 Comfy Cloud 上运行" icon="cloud" href="https://cloud.comfy.org/?template=image_qwen_image_2_1_image_edit&utm_source=docs&utm_medium=referral&utm_campaign=qwen-image-2-1">
    零设置在线运行 ComfyUI
  </Card>
</CardGroup>

**输入材料**

将这些文件上传到匹配的 `LoadImage` 节点：

<CardGroup cols={2}>
  <Card title="portrait_model_denim.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/portrait_model_denim.png">
    `LoadImage` 节点 470 · `portrait_model_denim.png`
  </Card>

  <Card title="clothing_light_blue_denim_shirt.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/clothing_light_blue_denim_shirt.png">
    `LoadImage` 节点 475 · `clothing_light_blue_denim_shirt.png`
  </Card>
</CardGroup>

**示例输出**

<div style={{display: 'grid', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))', gap: '1rem', alignItems: 'start'}}>
  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/portrait_model_denim.png" alt="输入图像" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />

  <img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/image_qwen_image_2_1_image_edit.png" alt="Qwen-Image-2.1 图像编辑示例输出" style={{width: '100%', height: 'auto', objectFit: 'contain'}} />
</div>

<h3 id="image_qwen_image_2_1_background_removal">
  移除背景：Qwen Image 2.1
</h3>

使用编辑指令移除照片的背景。该工作流复用图像编辑子图，提示词为 `Remove the background, and output a PNG image`，并将结果与原始图像进行对比。

<img src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/image_qwen_image_2_1_background_removal-1.webp" alt="Qwen-Image-2.1 移除背景工作流预览" />

<CardGroup cols={2}>
  <Card title="下载工作流" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_qwen_image_2_1_background_removal.json">
    下载 JSON 或在模板库中搜索 “Qwen-Image-2.1”
  </Card>

  <Card title="在 Comfy Cloud 上运行" icon="cloud" href="https://cloud.comfy.org/?template=image_qwen_image_2_1_background_removal&utm_source=docs&utm_medium=referral&utm_campaign=qwen-image-2-1">
    零设置在线运行 ComfyUI
  </Card>
</CardGroup>

**输入材料**

将此文件上传到匹配的 `LoadImage` 节点：

<Card title="angry_broccoli.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/angry_broccoli.png">
  `LoadImage` 节点 470 · `angry_broccoli.png`
</Card>

## 模型下载

三个工作流加载相同的文件。三者默认都使用 int8 版本的扩散模型和文本编码器。

**text\_encoders**

* [qwen3vl\_8b\_int8\_convrot.safetensors](https://huggingface.co/Comfy-Org/Qwen-Image-2.1/blob/main/text_encoders/qwen3vl_8b_int8_convrot.safetensors)（模板默认加载，内存占用更低）
* [qwen3vl\_8b\_bf16.safetensors](https://huggingface.co/Comfy-Org/Qwen-Image-2.1/blob/main/text_encoders/qwen3vl_8b_bf16.safetensors)（完整精度，需要更多内存）

**diffusion\_models**

* [qwen\_image\_2.1\_int8\_convrot.safetensors](https://huggingface.co/Comfy-Org/Qwen-Image-2.1/blob/main/diffusion_models/qwen_image_2.1_int8_convrot.safetensors)（模板默认加载，内存占用更低）
* [qwen\_image\_2.1\_bf16.safetensors](https://huggingface.co/Comfy-Org/Qwen-Image-2.1/blob/main/diffusion_models/qwen_image_2.1_bf16.safetensors)（完整精度，需要更多内存）

**vae**

* [qwen\_image\_2.1\_vae\_bf16.safetensors](https://huggingface.co/Comfy-Org/Qwen-Image-2.1/blob/main/vae/qwen_image_2.1_vae_bf16.safetensors)

**模型保存位置**

```
📂 ComfyUI/
├── 📂 models/
│   ├── 📂 text_encoders/
│   │      ├── qwen3vl_8b_int8_convrot.safetensors
│   │      └── qwen3vl_8b_bf16.safetensors
│   ├── 📂 diffusion_models/
│   │      ├── qwen_image_2.1_int8_convrot.safetensors
│   │      └── qwen_image_2.1_bf16.safetensors
│   └── 📂 vae/
│          └── qwen_image_2.1_vae_bf16.safetensors
```

## 工作流设置

### Sampler 设置

三个工作流均使用 `steps` 25、`cfg` 1、`euler` sampler 和 `simple` scheduler 进行采样。

### 分辨率

**文本到图像**：**分辨率选择器**节点设置宽高比和百万像素目标，其中 1.0 MP 约为 1024x1024。Qwen-Image-2.1 原生生成 2K 图像，因此对于 2048x2048 的方形输出，将目标设置为约 4.0 MP。

**图像编辑**：输出会遵循第一张参考图像的宽高比，缩放为约 `resolution` x `resolution` 像素（默认 1024）。将 `resolution` 设为 0 可让每张参考图像保持自身尺寸。开启 `custom_size` 则改用**分辨率选择器**画布，并尽量接近调整后的参考图尺寸，否则编辑可能偏移。

### 图像编辑提示

参考图像按插槽顺序拼接到文本编码器中，提示词通过索引指向每张图像：

```
Keep the character and pose in <image1> unchanged, put this light blue denim shirt from <image2> on the character, preserve the original facial features, hair, body shape and pose
```

### KV 缓存

编辑工作流包含 **Qwen Image 2.1 Cache** 节点，用于在采样步骤之间保留缓存的文本与参考前缀。模板默认设置适用于大多数情况。
