Skip to content

Commit 4616784

Browse files
authored
Update Flux kontext docs (#132)
* Update price * backup * Update docs * Update kontext API Node docs * Update flux 1 kontext docs * Refine docs * Refine docs
1 parent 40cd89b commit 4616784

File tree

13 files changed

+331
-38
lines changed

13 files changed

+331
-38
lines changed

docs.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@
143143
{
144144
"group": "Black Forest Labs",
145145
"pages": [
146-
"tutorials/api-nodes/black-forest-labs/flux-1-1-pro-ultra-image"
146+
"tutorials/api-nodes/black-forest-labs/flux-1-1-pro-ultra-image",
147+
"tutorials/api-nodes/black-forest-labs/flux-1-kontext"
147148
]
148149
},
149150
{
@@ -539,8 +540,7 @@
539540
"group": "Flux",
540541
"pages": [
541542
"zh-CN/tutorials/flux/flux-1-text-to-image",
542-
"zh-CN/tutorials/flux/flux-1-fill-dev",
543-
"zh-CN/tutorials/flux/flux-1-controlnet"
543+
"zh-CN/tutorials/flux/flux-1-fill-dev"
544544
]
545545
},
546546
{
@@ -591,7 +591,8 @@
591591
{
592592
"group": "Black Forest Labs",
593593
"pages": [
594-
"zh-CN/tutorials/api-nodes/black-forest-labs/flux-1-1-pro-ultra-image"
594+
"zh-CN/tutorials/api-nodes/black-forest-labs/flux-1-1-pro-ultra-image",
595+
"zh-CN/tutorials/api-nodes/black-forest-labs/flux-1-kontext"
595596
]
596597
},
597598
{
500 KB
Loading
613 KB
Loading
579 KB
Loading

snippets/tutorials/api-nodes/requirements.mdx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

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

5+
56
### 1. ComfyUI Version Requirements
67

78
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.
@@ -11,12 +12,30 @@ Please note the distinction between nightly and release versions. We recommend u
1112
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.
1213
</Tip>
1314

14-
### 2. Network Environment Requirements
15+
### 2. Account and Credits Requirements
16+
17+
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.
18+
19+
Log in via `Settings` -> `User`:
20+
21+
![ComfyUI User Interface](/images/interface/setting/user.jpg)
22+
23+
Go to `Settings` -> `Credits` to purchase credits
24+
![Credits Interface](/images/interface/setting/purchase-1.jpg)
25+
26+
Please refer to the corresponding documentation for account and credits to ensure this requirement:
27+
- [Comfy account](/zh-CN/interface/user): Find the `User` section in the settings menu to log in.
28+
- [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.
29+
30+
31+
### 3. Network Environment Requirements
1532

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

18-
- 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.
19-
- You must be able to access our API services normally (in some regions, you may need to use a proxy service).
35+
- The local network only allows access from `127.0.0.1` or `localhost`, and you can directly use the login function.
36+
- 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).
37+
- You should be able to access our API service normally (in some regions, you may need to use a proxy service).
38+
- Access should be carried out in an `https` environment to ensure the security of the requests.
2039

2140
<Note>
2241
Accessing in an insecure context poses significant risks, which may result in the following consequences:
@@ -26,13 +45,6 @@ Accessing in an insecure context poses significant risks, which may result in th
2645
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.
2746
</Note>
2847

29-
### 3. Account and Credits Requirements
30-
31-
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.
32-
33-
Please refer to the corresponding documentation for account and credits to ensure this requirement:
34-
- [Comfy account](/zh-CN/interface/user): Find the `User` section in the settings menu to log in.
35-
- [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.
3648

3749
### 4. Using the Corresponding Nodes
3850

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
- Black Forest Labs: Flux 1.1[pro] Ultra, Flux .1[pro]
2-
- Google: Veo2,Gemini 2.5 Pro, Gemini 2.5 Flash
3-
- Ideogram: V3, V2, V1
4-
- Kling: 2.0, 1.6, 1.5 & Various Effects
5-
- Luma: Photon, Ray2, Ray1.6
6-
- MiniMax: Text-to-Video, Image-to-Video
7-
- 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
8-
- PixVerse: V4 & Effects
9-
- Pika: 2.2
10-
- Recraft: V3, V2 & Various Tools
11-
- Rodin: 3D Generation
12-
- Stability AI: Stable Image Ultra, Stable Diffusion 3.5 Large,Image Upscale
13-
- Tripo: v1-4, v2.0, v2.5
1+
- **Black Forest Labs**: Flux 1.1[pro] Ultra, Flux .1[pro], Flux .1 Kontext Pro, Flux .1 Kontext Max
2+
- **Google**: Veo2, Gemini 2.5 Pro, Gemini 2.5 Flash
3+
- **Ideogram**: V3, V2, V1
4+
- **Kling**: 2.0, 1.6, 1.5 & Various Effects
5+
- **Luma**: Photon, Ray2, Ray1.6
6+
- **MiniMax**: Text-to-Video, Image-to-Video
7+
- **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
8+
- **PixVerse**: V4 & Effects
9+
- **Pika**: 2.2
10+
- **Recraft**: V3, V2 & Various Tools
11+
- **Rodin**: 3D Generation
12+
- **Stability AI**: Stable Image Ultra, Stable Diffusion 3.5 Large, Image Upscale
13+
- **Tripo**: v1-4, v2.0, v2.5
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
## Flux Kontext Prompt Techniques
3+
4+
### 1. Basic Modifications
5+
- Simple and direct: `"Change the car color to red"`
6+
- Maintain style: `"Change to daytime while maintaining the same style of the painting"`
7+
8+
### 2. Style Transfer
9+
**Principles:**
10+
- Clearly name style: `"Transform to Bauhaus art style"`
11+
- Describe characteristics: `"Transform to oil painting with visible brushstrokes, thick paint texture"`
12+
- Preserve composition: `"Change to Bauhaus style while maintaining the original composition"`
13+
14+
### 3. Character Consistency
15+
**Framework:**
16+
- Specific description: `"The woman with short black hair"` instead of "she"
17+
- Preserve features: `"while maintaining the same facial features, hairstyle, and expression"`
18+
- Step-by-step modifications: Change background first, then actions
19+
20+
### 4. Text Editing
21+
- Use quotes: `"Replace 'joy' with 'BFL'"`
22+
- Maintain format: `"Replace text while maintaining the same font style"`
23+
24+
## Common Problem Solutions
25+
26+
### Character Changes Too Much
27+
❌ Wrong: `"Transform the person into a Viking"`
28+
✅ Correct: `"Change the clothes to be a viking warrior while preserving facial features"`
29+
30+
### Composition Position Changes
31+
❌ Wrong: `"Put him on a beach"`
32+
✅ Correct: `"Change the background to a beach while keeping the person in the exact same position, scale, and pose"`
33+
34+
### Style Application Inaccuracy
35+
❌ Wrong: `"Make it a sketch"`
36+
✅ Correct: `"Convert to pencil sketch with natural graphite lines, cross-hatching, and visible paper texture"`
37+
38+
## Core Principles
39+
40+
1. **Be Specific and Clear** - Use precise descriptions, avoid vague terms
41+
2. **Step-by-step Editing** - Break complex modifications into multiple simple steps
42+
3. **Explicit Preservation** - State what should remain unchanged
43+
4. **Verb Selection** - Use "change", "replace" rather than "transform"
44+
45+
## Best Practice Templates
46+
47+
**Object Modification:**
48+
`"Change [object] to [new state], keep [content to preserve] unchanged"`
49+
50+
**Style Transfer:**
51+
`"Transform to [specific style], while maintaining [composition/character/other] unchanged"`
52+
53+
**Background Replacement:**
54+
`"Change the background to [new background], keep the subject in the exact same position and pose"`
55+
56+
**Text Editing:**
57+
`"Replace '[original text]' with '[new text]', maintain the same font style"`
58+
59+
> **Remember:** The more specific, the better. Kontext excels at understanding detailed instructions and maintaining consistency.

snippets/zh/tutorials/api-nodes/requirements.mdx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,29 @@
1111
也就是对应的开发版本和稳定版本,由于我们仍在快速地迭代中,此文档并不一定及时更新,所以请注意对应的版本差异。
1212
</Tip>
1313

14-
### 2. 网络环境要求
14+
### 2. 账号及账户余额要求
1515

16-
- 本地网络仅允许 `127.0.0.1` 或者 `localhost` 访问, 这可能意味着,你无法在局域网环境下使用带有`--listen` 参数启动的 ComfyUI 服务中中使用 API Nodes 节点
16+
需要当前已经在 ComfyUI 中登录了 [Comfy账号](/zh-CN/interface/user),并且账户[积分](/zh-CN/interface/credits)大于 0
17+
18+
`设置` -> `用户` 中进行登录:
19+
20+
![ComfyUI 用户界面](/images/zh/interface/setting/user.jpg)
21+
22+
并在 `设置` -> `积分` 中购买积分:
23+
24+
![ComfyUI 积分界面](/images/zh/interface/setting/menu-credits.jpg)
25+
26+
27+
请参考对应的账号及积分部分的文档来确保这一要求:
28+
- [Comfy账号](/zh-CN/interface/user): 在设置菜单中找到`用户`部分,进行登录
29+
- [积分](/zh-CN/interface/credits): 登录后设置界面会出现积分菜单,您可以在`设置``积分`中购买积分,我们使用预付费,不会有意外的费用
30+
31+
### 3. 网络环境要求
32+
33+
- 本地网络仅允许 `127.0.0.1` 或者 `localhost` 访问可以直接使用登录功能
34+
- 如果是局域网或者非白名单网站访问请使用 API Key 登录,请参考[使用 API Key 进行登录](/zh-CN/interface/user#使用-api-key-进行登录)
1735
- 能够正常访问我们的 API 服务(在某些地区可能需要使用代理服务)
36+
- 要求在 `https` 环境下访问,保证请求的安全性
1837

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

27-
### 3. 账号及账户余额要求
28-
29-
需要当前已经在 ComfyUI 中登录了 [Comfy账号](/zh-CN/interface/user),并且账户[积分](/zh-CN/interface/credits)大于 0
30-
31-
请参考对应的账号及积分部分的文档来确保这一要求:
32-
- [Comfy账号](/zh-CN/interface/user): 在设置菜单中找到`用户`部分,进行登录
33-
- [积分](/zh-CN/interface/credits): 登录后设置界面会出现积分菜单,您可以在`设置``积分`中购买积分,我们使用预付费,不会有意外的费用
34-
3546
### 4. 使用对应节点
3647

3748
**添加到工作流**:将 API 节点添加到您的工作流中,就像使用其他节点一样
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
## Flux Kontext 提示词技巧
3+
4+
### 1. 基础修改
5+
- 简单直接:`"Change the car color to red"`
6+
- 保持风格:`"Change to daytime while maintaining the same style of the painting"`
7+
8+
### 2. 风格转换
9+
**原则:**
10+
- 明确命名风格:`"Transform to Bauhaus art style"`
11+
- 描述特征:`"Transform to oil painting with visible brushstrokes, thick paint texture"`
12+
- 保留构图:`"Change to Bauhaus style while maintaining the original composition"`
13+
14+
### 3. 角色一致性
15+
**框架:**
16+
- 具体描述:`"The woman with short black hair"`而非`"she"`
17+
- 保留特征:`"while maintaining the same facial features, hairstyle, and expression"`
18+
- 分步修改:先改背景,再改动作
19+
20+
### 4. 文本编辑
21+
- 使用引号:`"Replace 'joy' with 'BFL'"`
22+
- 保持格式:`"Replace text while maintaining the same font style"`
23+
24+
## 常见问题解决
25+
26+
### 角色变化过大
27+
❌ 错误:`"Transform the person into a Viking"`
28+
✅ 正确:`"Change the clothes to be a viking warrior while preserving facial features"`
29+
30+
### 构图位置改变
31+
❌ 错误:`"Put him on a beach"`
32+
✅ 正确:`"Change the background to a beach while keeping the person in the exact same position, scale, and pose"`
33+
34+
### 风格应用不准确
35+
❌ 错误:`"Make it a sketch"`
36+
✅ 正确:`"Convert to pencil sketch with natural graphite lines, cross-hatching, and visible paper texture"`
37+
38+
## 核心原则
39+
40+
1. **具体明确** - 使用精确描述,避免模糊词汇
41+
2. **分步编辑** - 复杂修改分为多个简单步骤
42+
3. **明确保留** - 说明哪些要保持不变
43+
4. **动词选择** - 用"change"、"replace"而非"transform"
44+
45+
## 最佳实践模板
46+
47+
**对象修改:**
48+
`"Change [object] to [new state], keep [content to preserve] unchanged"`
49+
50+
**风格转换:**
51+
`"Transform to [specific style], while maintaining [composition/character/other] unchanged"`
52+
53+
**背景替换:**
54+
`"Change the background to [new background], keep the subject in the exact same position and pose"`
55+
56+
**文本编辑:**
57+
`"Replace '[original text]' with '[new text]', maintain the same font style"`
58+
59+
> **记住:** 越具体越好,Kontext 擅长理解详细指令并保持一致性。
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: "ComfyUI Flux.1 Kontext Pro Image API Node Official Example"
3+
description: "This guide will show you how to use the Flux.1 Kontext Pro Image API node in ComfyUI to perform image editing"
4+
sidebarTitle: "Flux.1 Kontext"
5+
---
6+
7+
import ReqHint from "/snippets/tutorials/api-nodes/req-hint.mdx";
8+
import PromptTechniques from "/snippets/tutorials/flux/prompt-techniques.mdx";
9+
10+
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.
11+
It can perform various editing tasks without complex descriptions, including object modification, style transfer, background replacement, character consistency editing, and text editing.
12+
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.
13+
14+
Currently, ComfyUI has supported two models of Flux.1 Kontext:
15+
16+
* **Kontext Pro** is ideal for editing, composing, and remixing.
17+
* **Kontext Max** pushes the limits on typography, prompt precision, and speed.
18+
19+
In this guide, we will briefly introduce how to use the Flux.1 Kontext API nodes to perform image editing through corresponding workflows.
20+
21+
<ReqHint/>
22+
23+
## Flux.1 Kontext Pro Image API Node Workflow
24+
25+
### 1. Workflow File Download
26+
27+
The `metadata` of the image below contains the workflow information. Please download and drag it into ComfyUI to load the corresponding workflow.
28+
29+
![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)
30+
31+
Download the image below for input or use your own image:
32+
33+
![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)
34+
35+
### 2. Complete the Workflow Step by Step
36+
37+
![ComfyUI Flux.1 Kontext Pro Image API Node Workflow Steps](/images/tutorial/api_nodes/bfl/flux_1_kontext_pro_image_step_guide.jpg)
38+
39+
You can follow the numbered steps in the image to complete the workflow:
40+
1. Load the image you want to edit in the `Load Image` node
41+
2. Modify the necessary parameters in `Flux.1 Kontext Pro Image`:
42+
- `prompt` Enter the prompt for the image you want to edit
43+
- `aspect_ratio` Set the aspect ratio of the original image, which must be between 1:4 and 4:1
44+
- `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
45+
3. Click the `Run` button or use the shortcut `Ctrl(cmd) + Enter` to execute the image editing
46+
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
47+
48+
## Flux.1 Kontext Max Image API Node Workflow
49+
50+
### 1. Workflow File Download
51+
52+
The `metadata` of the image below contains the workflow information. Please download and drag it into ComfyUI to load the corresponding workflow.
53+
54+
![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)
55+
56+
Download the image below for input or use your own image for demonstration:
57+
58+
![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)
59+
60+
### 2. Complete the Workflow Step by Step
61+
62+
![ComfyUI Flux.1 Kontext Max Image API Node Workflow Steps](/images/tutorial/api_nodes/bfl/flux_1_kontext_max_image_step_guide.jpg)
63+
64+
You can follow the numbered steps in the image to complete the workflow:
65+
1. Load the image you want to edit in the `Load Image` node
66+
2. Modify the necessary parameters in `Flux.1 Kontext Max Image`:
67+
- `prompt` Enter the prompt for the image you want to edit
68+
- `aspect_ratio` Set the aspect ratio of the original image, which must be between 1:4 and 4:1
69+
- `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
70+
3. Click the `Run` button or use the shortcut `Ctrl(cmd) + Enter` to execute the image editing
71+
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
72+
73+
<PromptTechniques/>

0 commit comments

Comments
 (0)