Flux Kontext AI painting tutorials, a sentence to get the image editing

With the Black Forest's kontext-dev model open-sourced, we can finally experience the power of kontext locally for free.

kontext can edit and modify images with one sentence, including but not limited to everything removal, one-click watermark and scratches removal, character angle modification, double image integration, text replacement, style transformation, everything migration, image expansion, mosaic removal, etc.

Everything Migration + Character Consistency + Style Transpainting + Partial Repainting + Text Editing, the best consistency solution available, Flux.1 Kontext Pro Transformative Technology!

Comparable to GPT4o, with natural language modification of images, super character consistency, fux.1-kontext-dev free version is here!

Today we're going to talk about how to use kontext to achieve these features in a single sentence that used to require complex workflows to achieve.

Open a workflow template

First of all, after upgrading comfyui to the latest version, we can find two kontext official workflows through the template, we take one of them as an example to explain the function.

a34ee944j00syypvz007fd000qb00fwm

The official workflow opens, which has quite a few official comments to make it easier for you to understand how the workflow works, and you can delete them.

There are two other disabled nodes in here (purple) that can also be deleted first.

5e345ea5j00syypvz0093d000u000egm

Add translation node

kontext is to edit pictures by prompt word, only support English prompt word, in order to facilitate our operation, you can add a translation node in front of the prompt word, so that you can use Chinese prompt word.

b44fe720j00syypvx001vd000u000awm

1、Edit the picture: modify the background of several uses

Cue word: Remove all roses and butterflies from the screen

It may be that the dev model has limited comprehension and the final result only removes the butterflies and not the flowers.

We can do multiple rounds of editing on this image.

350eef81j00syypw000f0d000u000bem

multiround editing

By clicking the "Update" button in the Load Image node, the image with the butterfly just removed will be loaded, so that multiple rounds of editing can be performed on the image.

a9e6f7f9j00syypw100exd000u000h2m

Enter the prompt again: Remove all pink roses from the screen

This time the flowers in the background were perfectly removed

c8a86a88j00syypw000dmd000u000bpm

Continue with multiple rounds of editing to load the image just generated

21a752f0j00syypw000aud000ij00m6m

This time, enter the cue word: change the background of the character to a city street under a streetlight

The background of the character became a night scene with the character standing under a street lamp, and the overall lighting of the picture followed the change in the background to re-light the picture with a more natural light.

3789fd52j00syypw000c4d000u000bim

Still using the same picture as before, with a different cue: have the girl stand on the street curb under a nighttime streetlight

7b071ef7j00syypvz00a8d000u000btm

What's the difference between the two cues above that got different results with the same background change?

The difference between the two cue words: the previous one is to change the background of the character to something, the object of the operation is the background, the change is only the background, the character remains unchanged.

A cue word at the back is what position to put the character in, and the object of the operation is the character. So not only will the background change, but the character's pose may change as well.

2、Edit the picture: local redraw

If you want to make changes to the localization of the image, you need to right-click where the image is loaded and open it in the Mask Editor to apply a mask to the localization that needs to be edited.

9aee7080j00syypw100ejd000ms00ucm

After applying the mask it looks like this below.

3a77e75bj00syypw100bpd000j300o4m

If we give the cue word directly and put a butterfly in the masked area, the resulting image does not change because kontext does not recognize the mask.

e858ab29j00syypw100mmd000tn00gdm

How to make kontext recognize masks

We can think of another way: the mask area will specify the color, for example, the red color number is "#FF0000", and then operate on the color area.

We need to make a copy of the loaded image node and add a "color overlay" node, the workflow is connected in the following way.

5328e41aj00syypw100esd000u000jgm

This is when the cue word is given again: put a butterfly in the red area

The butterfly has been generated, but the picture still has the red color that we don't need.

0ec167a9j00syypw000f0d000u000dkm

Modify the cue word: Remove the red area in the image and place a butterfly in this area

This time the desired result was generated, with butterflies appearing in the red area and the red color removed

5f15bd7fj00syypw100o2d000u000ivm

3、Remove the code saik

The operation of removing the code mosaic is also essentially a partial redrawing of the image.

We'll apply a mask to the mosaic area and designate it as red, and then give the directive: Remove the red area from the picture

89f107bdj00syypw100isd000u000cbm

4. Text replacement

Currently kontext only supports text replacement in English, just type in the prompt word to replace the text.

Cue word: Replace the number with "6."

Note: Remember to put the number to be replaced in quotation marks

733e7d99j00syypw000acd000u000bfm

5. Expanding the map

Before scaling an image, you need to add a node for the image size: Scale by Aspect Ratio

586c57f6j00syypvz001xd000u000e2m

In the following workflow, the original image is a vertical image, we just need to change the scale of the image to a horizontal version, and do not need to enter any prompts, click Run to automatically expand the image

2fca64f8j00syypvz009ad000u0009om

Customized and accurate map expansion

If you want to precisely control the size of the graph customized expansion, you need to add an expansion screen node

5215b184j00syypvx001pd000u000bcm

Add this Expanded Screen node behind the Load Image node and enter a custom size, for example, in the image below, add 600 and 200 pixels to the left and right sides of the screen respectively, so that we have very precise customized control over the image expansion.

3a5852b5j00syypw000dpd000u000f0m

6. Character Editing

kontext is able to recognize details in an image and edit them, for example, in the image below we enter the cue: woman raising her head and looking up to the left

The kontext is accurately done to control the characters.

636ffba8j00syypw100o6d000u000fum

7. Style Conversion

kontext is also just a sentence away from styling an image.

The following image will be converted to Canon style with just one prompt word: Convert image to cartoon style

35d42621j00syypw100s9d000u000fem

Continue editing the image in multiple rounds and enter the prompt word: it will be converted into a 3D cartoon effect.

We then get a cartoon effect style image.

3ea89fe1j00syypw100ugd000u000evm

8, old photo restoration

Old photo restoration is also a piece of cake for kontext, just give the cue word to achieve the effect you want.

4319ff7bj00syypw100b1d000u000ghm

9、Double map merge

Remember when the official workflow opens with a disabled load image workflow, un-disable it so you can load two images.

Enter the cue word: Let two women stand in the street holding hands.

This way the two charts are fused into one.

b90f8a40j00syypw000did000u00099m

Free up video memory

Here's an extra note on freeing up video memory

As many of you may have noticed, when the workflow runs out, the video memory is still occupied, which makes it easy to burst video memory.

Today to tell you how to solve this problem.

9afd6b69j00syypvy001fd000qt00c5m

Method I:

In the latest version of comfyui, there is a little green bug icon on the panel, right click on it and you will get the clear video memory option, click on it.

4f44d89dj00syypvv0008d0006q004sm

Here's what it looks like after clearing, the video memory is clearly freed up.

949b5830j00syypvy003ad000u0009cm

Method 2, add clear VRAM nodes

There are two versions of this node, one with V2 and one without.

Let's look at the differences

01f6f0adj00syypvw000od000mh006mm

Nodes without V2: just connect behind a module and the workflow will automatically release the memory as it passes through this node

a56ee787j00syypw100bed000u000h2m

With V2 node: we can connect subsequent workflows directly behind this node

3520f0c2j00syypw0008vd000u000d3m

Tip: A workflow allows to add more than one release memory node, especially in some large workflows with multiple modules in series, we can add a release memory node after a template is run to reduce the chance of bursting memory.

statement:The content of the source of public various media platforms, if the inclusion of the content violates your rights and interests, please contact the mailbox, this site will be the first time to deal with.
TutorialEncyclopedia

Make English learning animated video tutorials with AI, easy to make short English videos with millions of plays

2025-7-11 9:15:46

TutorialEncyclopedia

Using AI to make historical legend story narration monologue video, 10 minutes to create explosive video

2025-7-12 9:46:09

Zenium
Search