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

# 连线

> 了解 ComfyUI 中的连接链接

## 连线连接节点

在 ComfyUI 中，节点之间绘制的线条或曲线称为 ***连线***（有时也称为 ***连接*** 或导线）。它们将数据从一个节点的输出传输到另一个节点的输入，从而定义工作流的流程。

连线可以以多种视觉样式显示：曲线、直角线、直线或完全隐藏。

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/AWlvySb8fGWTMD_I/images/interface/link/link_styles.jpg?fit=max&auto=format&n=AWlvySb8fGWTMD_I&q=85&s=bc9a260ef6e1b7d3c254d86269ae052e" alt="连线样式" width="1589" height="917" data-path="images/interface/link/link_styles.jpg" />

要更改连线样式，请转到 **设置菜单** → **显示（Lite Graph）** → **画面（Graph）** → **连线渲染模式（Link Render Mode）**。

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/AWlvySb8fGWTMD_I/images/interface/link/render_mode.jpg?fit=max&auto=format&n=AWlvySb8fGWTMD_I&q=85&s=5c21c9bf2dc5f71cecc4136b138dc4cc" alt="渲染模式设置" width="1066" height="764" data-path="images/interface/link/render_mode.jpg" />

你也可以从 **画布菜单（Canvas Menu）** 临时隐藏所有连线。

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/AWlvySb8fGWTMD_I/images/interface/link/canvas_menu.jpg?fit=max&auto=format&n=AWlvySb8fGWTMD_I&q=85&s=0c69ddcde767907ef4272829a96957c9" alt="画布菜单" width="272" height="620" data-path="images/interface/link/canvas_menu.jpg" />

<Tip>
  在学习、分享或调试工作流时，显示连线尤其有用——它们可以让你一目了然地看到数据流。对于不打算编辑的已完成工作流，隐藏连线可以减少视觉杂乱。
</Tip>

### 重新路由节点

当工作流变得复杂时，连接线可能会重叠或被节点遮挡，导致难以阅读。**重新路由**节点允许你在二维图空间中手动重定向连线，从而保持布局的整洁和清晰。

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/AWlvySb8fGWTMD_I/images/interface/link/reroute.jpg?fit=max&auto=format&n=AWlvySb8fGWTMD_I&q=85&s=2554b1f73acb5faff676717dc7733df6" alt="ComfyUI 重新路由节点" width="900" height="365" data-path="images/interface/link/reroute.jpg" />

ComfyUI 在图画布中还内置了原生的重新路由功能。对于新的工作流，我们建议使用此功能。

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/AWlvySb8fGWTMD_I/images/interface/link/native_reroute.jpg?fit=max&auto=format&n=AWlvySb8fGWTMD_I&q=85&s=d8f6942e769ced0e70065f95a92a1191" alt="ComfyUI 原生重新路由" width="463" height="315" data-path="images/interface/link/native_reroute.jpg" />

## 颜色编码

ComfyUI 中的每种数据类型都有独特的颜色。节点的输入和输出端口，以及连接它们的链接线，都遵循此配色方案。**只能连接相同颜色的端口**——这确保了工作流中的类型安全。

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/CGwBmVmarMLEBk3u/images/concepts/node/data_type.jpg?fit=max&auto=format&n=CGwBmVmarMLEBk3u&q=85&s=be8c100347bc9f655fe19aaab61ab537" alt="ComfyUI 节点数据类型" width="685" height="356" data-path="images/concepts/node/data_type.jpg" />

| 数据类型       | 颜色   |
| ---------- | ---- |
| 扩散模型       | 薰衣草色 |
| CLIP 模型    | 黄色   |
| VAE 模型     | 玫瑰色  |
| 条件化        | 橙色   |
| 潜在图像       | 粉色   |
| 像素图像       | 蓝色   |
| 蒙版         | 绿色   |
| 数字（整数或浮点数） | 灰色   |
| 网格         | 亮绿色  |
