|
| 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 | + |
| 30 | + |
| 31 | +Download the image below for input or use your own image: |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +### 2. Complete the Workflow Step by Step |
| 36 | + |
| 37 | + |
| 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 | + |
| 55 | + |
| 56 | +Download the image below for input or use your own image for demonstration: |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +### 2. Complete the Workflow Step by Step |
| 61 | + |
| 62 | + |
| 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