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

# LossGraphNode - ComfyUI Built-in Node Documentation

> Complete documentation for the LossGraphNode node in ComfyUI. Learn its inputs, outputs, parameters and usage.

> 本文档由 AI 生成。如果您发现任何错误或有改进建议，欢迎贡献！ [在 GitHub 上编辑](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/LossGraphNode/zh.md)

LossGraphNode 可创建训练损失值随时间变化的可视化图表，并将其保存为图像文件。该节点从训练过程中获取损失数据，并生成显示损失在训练步骤中变化情况的折线图。生成的图表包含坐标轴标签、最小/最大损失值，并会自动保存到临时输出目录并附带时间戳。

## 输入参数

| 参数                | 数据类型   | 必需 | 取值范围   | 描述                            |
| ----------------- | ------ | -- | ------ | ----------------------------- |
| `loss`            | LOSS   | 是  | 支持多种选项 | 包含要绘制的损失值的损失数据（默认值：空字典）       |
| `filename_prefix` | STRING | 是  | -      | 输出图像文件名的前缀（默认值："loss\_graph"） |

**注意：** `loss` 参数需要包含带有损失值的 "loss" 键的有效损失字典。该节点会自动缩放损失值以适应图表尺寸，并生成显示训练步骤中损失变化情况的折线图。

## 输出结果

| 输出名称        | 数据类型  | 描述                |
| ----------- | ----- | ----------------- |
| `ui.images` | IMAGE | 已保存到临时目录的生成损失图表图像 |
