Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
{
"group": "Black Forest Labs",
"pages": [
"tutorials/api-nodes/black-forest-labs/flux-1-1-pro-ultra-image"
"tutorials/api-nodes/black-forest-labs/flux-1-1-pro-ultra-image",
"tutorials/api-nodes/black-forest-labs/flux-1-kontext"
]
},
{
Expand Down Expand Up @@ -539,8 +540,7 @@
"group": "Flux",
"pages": [
"zh-CN/tutorials/flux/flux-1-text-to-image",
"zh-CN/tutorials/flux/flux-1-fill-dev",
"zh-CN/tutorials/flux/flux-1-controlnet"
"zh-CN/tutorials/flux/flux-1-fill-dev"
]
},
{
Expand Down Expand Up @@ -591,7 +591,8 @@
{
"group": "Black Forest Labs",
"pages": [
"zh-CN/tutorials/api-nodes/black-forest-labs/flux-1-1-pro-ultra-image"
"zh-CN/tutorials/api-nodes/black-forest-labs/flux-1-1-pro-ultra-image",
"zh-CN/tutorials/api-nodes/black-forest-labs/flux-1-kontext"
]
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 22 additions & 10 deletions snippets/tutorials/api-nodes/requirements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

To use API Nodes, the following requirements must be met:


### 1. ComfyUI Version Requirements

Please update your ComfyUI to the latest version, as we may add more API support in the future, and corresponding nodes will be updated, so please keep your ComfyUI up to date.
Expand All @@ -11,12 +12,30 @@ Please note the distinction between nightly and release versions. We recommend u
This refers to the development version and the stable version, and since we are still rapidly iterating, this document may not be updated promptly, so please pay attention to the version differences.
</Tip>

### 2. Network Environment Requirements
### 2. Account and Credits Requirements

You need to be logged into your ComfyUI with a [Comfy account](/zh-CN/interface/user) and have a credit balance of [credits](/zh-CN/interface/credits) greater than 0.

Log in via `Settings` -> `User`:

![ComfyUI User Interface](/images/interface/setting/user.jpg)

Go to `Settings` -> `Credits` to purchase credits
![Credits Interface](/images/interface/setting/purchase-1.jpg)

Please refer to the corresponding documentation for account and credits to ensure this requirement:
- [Comfy account](/zh-CN/interface/user): Find the `User` section in the settings menu to log in.
- [Credits](/zh-CN/interface/credits): After logging in, the settings interface will show a credits menu where you can purchase credits. We use a prepaid system, so there will be no unexpected charges.


### 3. Network Environment Requirements

API access requires that your current requests are based on a secure network environment. The current requirements for API access are as follows:

- Local networks only allow access from `127.0.0.1`. We do not support accessing via LAN IPs without `https` as it is insecure. This may mean that you cannot use API Nodes in a ComfyUI service launched with the `--listen` parameter in a LAN environment.
- You must be able to access our API services normally (in some regions, you may need to use a proxy service).
- The local network only allows access from `127.0.0.1` or `localhost`, and you can directly use the login function.
- If you are accessing from a local area network or a website that is not on the whitelist, please log in with an API Key. Please refer to [Log in with an API Key](/interface/user#logging-in-with-an-api-key).
- You should be able to access our API service normally (in some regions, you may need to use a proxy service).
- Access should be carried out in an `https` environment to ensure the security of the requests.

<Note>
Accessing in an insecure context poses significant risks, which may result in the following consequences:
Expand All @@ -26,13 +45,6 @@ Accessing in an insecure context poses significant risks, which may result in th
Even if we open this restriction in the future, we strongly advise against accessing API services through insecure network requests due to the high risks involved.
</Note>

### 3. Account and Credits Requirements

You need to be logged into your ComfyUI with a [Comfy account](/zh-CN/interface/user) and have a credit balance of [credits](/zh-CN/interface/credits) greater than 0.

Please refer to the corresponding documentation for account and credits to ensure this requirement:
- [Comfy account](/zh-CN/interface/user): Find the `User` section in the settings menu to log in.
- [Credits](/zh-CN/interface/credits): After logging in, the settings interface will show a credits menu where you can purchase credits. We use a prepaid system, so there will be no unexpected charges.

### 4. Using the Corresponding Nodes

Expand Down
26 changes: 13 additions & 13 deletions snippets/tutorials/api-nodes/supported-models.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
- Black Forest Labs: Flux 1.1[pro] Ultra, Flux .1[pro]
- Google: Veo2,Gemini 2.5 Pro, Gemini 2.5 Flash
- Ideogram: V3, V2, V1
- Kling: 2.0, 1.6, 1.5 & Various Effects
- Luma: Photon, Ray2, Ray1.6
- MiniMax: Text-to-Video, Image-to-Video
- OpenAI: o1,o1-pro,o3,gpt-4o,gpt-4.1,gpt-4.1-mini,gpt-4.1-nano, DALL·E 2, DALL·E 3,GPT-Image-1
- PixVerse: V4 & Effects
- Pika: 2.2
- Recraft: V3, V2 & Various Tools
- Rodin: 3D Generation
- Stability AI: Stable Image Ultra, Stable Diffusion 3.5 Large,Image Upscale
- Tripo: v1-4, v2.0, v2.5
- **Black Forest Labs**: Flux 1.1[pro] Ultra, Flux .1[pro], Flux .1 Kontext Pro, Flux .1 Kontext Max
- **Google**: Veo2, Gemini 2.5 Pro, Gemini 2.5 Flash
- **Ideogram**: V3, V2, V1
- **Kling**: 2.0, 1.6, 1.5 & Various Effects
- **Luma**: Photon, Ray2, Ray1.6
- **MiniMax**: Text-to-Video, Image-to-Video
- **OpenAI**: o1, o1-pro, o3, gpt-4o, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, DALL·E 2, DALL·E 3, GPT-Image-1
- **PixVerse**: V4 & Effects
- **Pika**: 2.2
- **Recraft**: V3, V2 & Various Tools
- **Rodin**: 3D Generation
- **Stability AI**: Stable Image Ultra, Stable Diffusion 3.5 Large, Image Upscale
- **Tripo**: v1-4, v2.0, v2.5
59 changes: 59 additions & 0 deletions snippets/tutorials/flux/prompt-techniques.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

## Flux Kontext Prompt Techniques

### 1. Basic Modifications
- Simple and direct: `"Change the car color to red"`
- Maintain style: `"Change to daytime while maintaining the same style of the painting"`

### 2. Style Transfer
**Principles:**
- Clearly name style: `"Transform to Bauhaus art style"`
- Describe characteristics: `"Transform to oil painting with visible brushstrokes, thick paint texture"`
- Preserve composition: `"Change to Bauhaus style while maintaining the original composition"`

### 3. Character Consistency
**Framework:**
- Specific description: `"The woman with short black hair"` instead of "she"
- Preserve features: `"while maintaining the same facial features, hairstyle, and expression"`
- Step-by-step modifications: Change background first, then actions

### 4. Text Editing
- Use quotes: `"Replace 'joy' with 'BFL'"`
- Maintain format: `"Replace text while maintaining the same font style"`

## Common Problem Solutions

### Character Changes Too Much
❌ Wrong: `"Transform the person into a Viking"`
✅ Correct: `"Change the clothes to be a viking warrior while preserving facial features"`

### Composition Position Changes
❌ Wrong: `"Put him on a beach"`
✅ Correct: `"Change the background to a beach while keeping the person in the exact same position, scale, and pose"`

### Style Application Inaccuracy
❌ Wrong: `"Make it a sketch"`
✅ Correct: `"Convert to pencil sketch with natural graphite lines, cross-hatching, and visible paper texture"`

## Core Principles

1. **Be Specific and Clear** - Use precise descriptions, avoid vague terms
2. **Step-by-step Editing** - Break complex modifications into multiple simple steps
3. **Explicit Preservation** - State what should remain unchanged
4. **Verb Selection** - Use "change", "replace" rather than "transform"

## Best Practice Templates

**Object Modification:**
`"Change [object] to [new state], keep [content to preserve] unchanged"`

**Style Transfer:**
`"Transform to [specific style], while maintaining [composition/character/other] unchanged"`

**Background Replacement:**
`"Change the background to [new background], keep the subject in the exact same position and pose"`

**Text Editing:**
`"Replace '[original text]' with '[new text]', maintain the same font style"`

> **Remember:** The more specific, the better. Kontext excels at understanding detailed instructions and maintaining consistency.
31 changes: 21 additions & 10 deletions snippets/zh/tutorials/api-nodes/requirements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,29 @@
也就是对应的开发版本和稳定版本,由于我们仍在快速地迭代中,此文档并不一定及时更新,所以请注意对应的版本差异。
</Tip>

### 2. 网络环境要求
### 2. 账号及账户余额要求

- 本地网络仅允许 `127.0.0.1` 或者 `localhost` 访问, 这可能意味着,你无法在局域网环境下使用带有`--listen` 参数启动的 ComfyUI 服务中中使用 API Nodes 节点
需要当前已经在 ComfyUI 中登录了 [Comfy账号](/zh-CN/interface/user),并且账户[积分](/zh-CN/interface/credits)大于 0

在 `设置` -> `用户` 中进行登录:

![ComfyUI 用户界面](/images/zh/interface/setting/user.jpg)

并在 `设置` -> `积分` 中购买积分:

![ComfyUI 积分界面](/images/zh/interface/setting/menu-credits.jpg)


请参考对应的账号及积分部分的文档来确保这一要求:
- [Comfy账号](/zh-CN/interface/user): 在设置菜单中找到`用户`部分,进行登录
- [积分](/zh-CN/interface/credits): 登录后设置界面会出现积分菜单,您可以在`设置` → `积分`中购买积分,我们使用预付费,不会有意外的费用

### 3. 网络环境要求

- 本地网络仅允许 `127.0.0.1` 或者 `localhost` 访问可以直接使用登录功能
- 如果是局域网或者非白名单网站访问请使用 API Key 登录,请参考[使用 API Key 进行登录](/zh-CN/interface/user#使用-api-key-进行登录)
- 能够正常访问我们的 API 服务(在某些地区可能需要使用代理服务)
- 要求在 `https` 环境下访问,保证请求的安全性

<Note>
不安全的上下文访问会有巨大的风险可能会有以下后果:
Expand All @@ -24,14 +43,6 @@
就算是后期我们开放了这一限制,我们依然强烈建议你不要通过不安全的网络请求访问 API 服务,因为这一风险极大.
</Note>

### 3. 账号及账户余额要求

需要当前已经在 ComfyUI 中登录了 [Comfy账号](/zh-CN/interface/user),并且账户[积分](/zh-CN/interface/credits)大于 0

请参考对应的账号及积分部分的文档来确保这一要求:
- [Comfy账号](/zh-CN/interface/user): 在设置菜单中找到`用户`部分,进行登录
- [积分](/zh-CN/interface/credits): 登录后设置界面会出现积分菜单,您可以在`设置` → `积分`中购买积分,我们使用预付费,不会有意外的费用

### 4. 使用对应节点

**添加到工作流**:将 API 节点添加到您的工作流中,就像使用其他节点一样
Expand Down
59 changes: 59 additions & 0 deletions snippets/zh/tutorials/flux/prompt-techniques.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

## Flux Kontext 提示词技巧

### 1. 基础修改
- 简单直接:`"Change the car color to red"`
- 保持风格:`"Change to daytime while maintaining the same style of the painting"`

### 2. 风格转换
**原则:**
- 明确命名风格:`"Transform to Bauhaus art style"`
- 描述特征:`"Transform to oil painting with visible brushstrokes, thick paint texture"`
- 保留构图:`"Change to Bauhaus style while maintaining the original composition"`

### 3. 角色一致性
**框架:**
- 具体描述:`"The woman with short black hair"`而非`"she"`
- 保留特征:`"while maintaining the same facial features, hairstyle, and expression"`
- 分步修改:先改背景,再改动作

### 4. 文本编辑
- 使用引号:`"Replace 'joy' with 'BFL'"`
- 保持格式:`"Replace text while maintaining the same font style"`

## 常见问题解决

### 角色变化过大
❌ 错误:`"Transform the person into a Viking"`
✅ 正确:`"Change the clothes to be a viking warrior while preserving facial features"`

### 构图位置改变
❌ 错误:`"Put him on a beach"`
✅ 正确:`"Change the background to a beach while keeping the person in the exact same position, scale, and pose"`

### 风格应用不准确
❌ 错误:`"Make it a sketch"`
✅ 正确:`"Convert to pencil sketch with natural graphite lines, cross-hatching, and visible paper texture"`

## 核心原则

1. **具体明确** - 使用精确描述,避免模糊词汇
2. **分步编辑** - 复杂修改分为多个简单步骤
3. **明确保留** - 说明哪些要保持不变
4. **动词选择** - 用"change"、"replace"而非"transform"

## 最佳实践模板

**对象修改:**
`"Change [object] to [new state], keep [content to preserve] unchanged"`

**风格转换:**
`"Transform to [specific style], while maintaining [composition/character/other] unchanged"`

**背景替换:**
`"Change the background to [new background], keep the subject in the exact same position and pose"`

**文本编辑:**
`"Replace '[original text]' with '[new text]', maintain the same font style"`

> **记住:** 越具体越好,Kontext 擅长理解详细指令并保持一致性。
73 changes: 73 additions & 0 deletions tutorials/api-nodes/black-forest-labs/flux-1-kontext.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: "ComfyUI Flux.1 Kontext Pro Image API Node Official Example"
description: "This guide will show you how to use the Flux.1 Kontext Pro Image API node in ComfyUI to perform image editing"
sidebarTitle: "Flux.1 Kontext"
---

import ReqHint from "/snippets/tutorials/api-nodes/req-hint.mdx";
import PromptTechniques from "/snippets/tutorials/flux/prompt-techniques.mdx";

FLUX.1 Kontext is a professional image-to-image editing model developed by Black Forest Labs, focusing on intelligent understanding of image context and precise editing.
It can perform various editing tasks without complex descriptions, including object modification, style transfer, background replacement, character consistency editing, and text editing.
The core advantage of Kontext lies in its excellent context understanding ability and character consistency maintenance, ensuring that key elements such as character features and composition layout remain stable even after multiple iterations of editing.

Currently, ComfyUI has supported two models of Flux.1 Kontext:

* **Kontext Pro** is ideal for editing, composing, and remixing.
* **Kontext Max** pushes the limits on typography, prompt precision, and speed.

In this guide, we will briefly introduce how to use the Flux.1 Kontext API nodes to perform image editing through corresponding workflows.

<ReqHint/>

## Flux.1 Kontext Pro Image API Node Workflow

### 1. Workflow File Download

The `metadata` of the image below contains the workflow information. Please download and drag it into ComfyUI to load the corresponding workflow.

![ComfyUI Flux.1 Kontext Pro Image API Node Workflow](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/api_nodes/bfl/flux_1_kontext_pro_image.png)

Download the image below for input or use your own image:

![ComfyUI Flux.1 Kontext Pro Image API Node Workflow](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/api_nodes/bfl/flux_1_kontext_pro_image_input.png)

### 2. Complete the Workflow Step by Step

![ComfyUI Flux.1 Kontext Pro Image API Node Workflow Steps](/images/tutorial/api_nodes/bfl/flux_1_kontext_pro_image_step_guide.jpg)

You can follow the numbered steps in the image to complete the workflow:
1. Load the image you want to edit in the `Load Image` node
2. Modify the necessary parameters in `Flux.1 Kontext Pro Image`:
- `prompt` Enter the prompt for the image you want to edit
- `aspect_ratio` Set the aspect ratio of the original image, which must be between 1:4 and 4:1
- `prompt_upsampling` Set whether to use prompt upsampling. If enabled, it will automatically modify the prompt to get richer results, but the results are not reproducible
3. Click the `Run` button or use the shortcut `Ctrl(cmd) + Enter` to execute the image editing
4. After waiting for the API to return results, you can view the edited image in the `Save Image` node, and the corresponding image will also be saved to the `ComfyUI/output/` directory

## Flux.1 Kontext Max Image API Node Workflow

### 1. Workflow File Download

The `metadata` of the image below contains the workflow information. Please download and drag it into ComfyUI to load the corresponding workflow.

![ComfyUI Flux.1 Kontext Max Image API Node Workflow](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/api_nodes/bfl/flux_1_kontext_max_image.png)

Download the image below for input or use your own image for demonstration:

![ComfyUI Flux.1 Kontext Max Image API Node Workflow](https://raw.githubusercontent.com/Comfy-Org/example_workflows/main/api_nodes/bfl/flux_1_kontext_max_image_input.png)

### 2. Complete the Workflow Step by Step

![ComfyUI Flux.1 Kontext Max Image API Node Workflow Steps](/images/tutorial/api_nodes/bfl/flux_1_kontext_max_image_step_guide.jpg)

You can follow the numbered steps in the image to complete the workflow:
1. Load the image you want to edit in the `Load Image` node
2. Modify the necessary parameters in `Flux.1 Kontext Max Image`:
- `prompt` Enter the prompt for the image you want to edit
- `aspect_ratio` Set the aspect ratio of the original image, which must be between 1:4 and 4:1
- `prompt_upsampling` Set whether to use prompt upsampling. If enabled, it will automatically modify the prompt to get richer results, but the results are not reproducible
3. Click the `Run` button or use the shortcut `Ctrl(cmd) + Enter` to execute the image editing
4. After waiting for the API to return results, you can view the edited image in the `Save Image` node, and the corresponding image will also be saved to the `ComfyUI/output/` directory

<PromptTechniques/>
2 changes: 2 additions & 0 deletions tutorials/api-nodes/pricing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ The following table lists the pricing of the current API Nodes. All prices are i
| BFL | flux-pro-1.1-ultra | $0.06 |
| BFL | flux-pro-1.1-pro | $0.05 |
| BFL | flux tools (edit, fill, expand, canny) | $0.05 |
| BFL | flux.1 Kontext Pro Image | $0.08 |
| BFL | flux.1 Kontext Max Image | $0.08 |
| Gemini | gemini-2.5-pro-preview-05-06, Output Audio Tokens | $35 / 1M Tokens |
| Gemini | gemini-2.5-pro-preview-05-06, Output Image Tokens | $35 / 1M Tokens |
| Gemini | gemini-2.5-pro-preview-05-06, Input Audio Tokens | $7 / 1M Tokens |
Expand Down
Loading
Loading