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

# RecraftV4TextToImageNode - ComfyUI Built-in Node Documentation

> Recraft V4 文本到图像

Recraft V4 文本到图像

此节点使用 Recraft V4 和 V4.1 AI 模型，根据文本描述生成图像。它将您的提示词发送到外部 API，并返回生成的图像。您可以通过指定模型、图像尺寸、图像数量以及可选样式（以已保存的样式 ID 或参考图像的形式）来控制输出。

## 输入

### 通用输入

| 参数                 | 描述                                                                                                             | 数据类型           | 必填 | 范围                                                                                                                                                                                                   |
| ------------------ | -------------------------------------------------------------------------------------------------------------- | -------------- | -- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model`            | 用于生成的模型。recraftv4\_styles 模型专为风格一致性生成而构建，始终需要 style\_id 或 style\_references。                                   | DYNAMIC\_COMBO | 是  | "recraftv4\_1"<br />"recraftv4\_1\_utility"<br />"recraftv4\_1\_pro"<br />"recraftv4\_1\_utility\_pro"<br />"recraftv4"<br />"recraftv4\_pro"<br />"recraftv4\_styles"<br />"recraftv4\_styles\_pro" |
| `prompt`           | 图像生成的提示词。最多 10,000 个字符。                                                                                        | STRING         | 是  | 1 到 10000 characters                                                                                                                                                                                 |
| `negative_prompt`  | 此输入会被忽略：Recraft V4 和 V4.1 模型不支持负向提示词。                                                                          | STRING         | 是  | N/A                                                                                                                                                                                                  |
| `n`                | 要生成的图像数量（默认值：1）。                                                                                               | INT            | 是  | 1 到 6                                                                                                                                                                                                |
| `seed`             | 用于确定节点是否应重新运行的种子；无论种子如何，实际结果都是不确定的（默认值：0）。                                                                     | INT            | 是  | 0 到 18446744073709551615                                                                                                                                                                             |
| `recraft_controls` | 通过 Recraft Controls 节点对生成过程的可选附加控制。                                                                            | CUSTOM         | 否  | N/A                                                                                                                                                                                                  |
| `style_id`         | 要应用的 Recraft V4 样式的 UUID，例如来自 Recraft V4 Create Style 节点或先前运行的 style\_id 输出。不能与 style\_references 组合使用（默认值：空）。 | STRING         | 否  | Valid UUID string                                                                                                                                                                                    |
| `style_match`      | 对样式的遵循程度：precise 会精细复现样式，flexible 会匹配大致外观。仅在提供样式时使用（默认值："precise"）。                                            | COMBO          | 否  | "precise"<br />"flexible"                                                                                                                                                                            |

### recraftv4\_1、recraftv4\_1\_utility、recraftv4 和 recraftv4\_styles 输入

这些模型共享相同的 `size` 参数。

| 参数     | 描述                        | 数据类型  | 必填 | 范围                                                                           |
| ------ | ------------------------- | ----- | -- | ---------------------------------------------------------------------------- |
| `size` | 生成图像的尺寸（默认值："1024x1024"）。 | COMBO | 是  | Multiple options available (standard Recraft V4 sizes, includes "1024x1024") |

### recraftv4\_1\_pro、recraftv4\_1\_utility\_pro、recraftv4\_pro 和 recraftv4\_styles\_pro 输入

这些模型共享相同的 `size` 参数。

| 参数     | 描述                        | 数据类型  | 必填 | 范围                                                                      |
| ------ | ------------------------- | ----- | -- | ----------------------------------------------------------------------- |
| `size` | 生成图像的尺寸（默认值："2048x2048"）。 | COMBO | 是  | Multiple options available (pro Recraft V4 sizes, includes "2048x2048") |

### 参考输入

| 参数                 | 描述                                                                                                                                   | 数据类型  | 必填 | 范围                                                                                                               |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ----- | -- | ---------------------------------------------------------------------------------------------------------------- |
| `style_references` | 用于即时创建样式的参考图像，计费在生成费用之上。创建的样式会作为 style\_id 返回以供复用。不能与 style\_id 组合使用。可增长插槽：连接 1..N 张图像（style\_reference\_1、style\_reference\_2、...）。 | IMAGE | 否  | 0 to the maximum number of reference images allowed by the Recraft API; total encoded size must not exceed 10 MB |

**注意：** `size` 参数是一个动态输入，其可用选项会根据所选 `model` 而变化。`recraftv4_styles` 和 `recraftv4_styles_pro` 模型始终需要样式：连接参考样式图像或提供 `style_id`。`style_id` 和 `style_references` 输入互斥——只能提供其中一个。`style_id` 必须是有效的 UUID。`style_match` 输入仅在提供样式时使用。参考样式图像的计费在生成费用之上，且其总编码大小不得超过 10 MB。`seed` 值不能保证图像输出的可复现性。如果您使用来自 Infinite Style Library 的样式 ID，请确保它不是 Vector art 样式，因为这可能会返回 SVG 数据而不是图像。

## 输出

| 输出名称       | 描述                                                      | 数据类型   |
| ---------- | ------------------------------------------------------- | ------ |
| `output`   | 生成的图像或图像批次。                                             | IMAGE  |
| `style_id` | 本次生成使用或创建的样式 ID。当提供参考样式图像时，这里会返回创建的样式以供复用；未使用样式时返回空字符串。 | STRING |

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

***

**Source fingerprint (SHA-256):** `af5c1f68e59ca282cdca7c32cd50f0438b743fdda27d9d22e59b2d1343f45e26`
