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.

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

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.

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

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.

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

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.

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

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.

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

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

This time the flowers in the background were perfectly removed

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

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

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

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.

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

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

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

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.

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

After applying the mask it looks like this below.

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

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.

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

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.

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

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.

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

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

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

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

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

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

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

5. Expanding the map

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

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

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

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

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

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

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.

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

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.

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

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

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

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.

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

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.

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

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.

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

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.

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

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.

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

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

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

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

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

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

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

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

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

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

Search