Fix, don't regenerate: editing AI images instead of re-rolling them

A live test of image editing on Kugel Platform: instruction edits, masked edits and deterministic tools across nine repairs, with real outputs, costs, preservation scores and the failures.

13 min read By Platform Documentation Guide #Publishing

A live test of image editing on Kugel Platform: instruction edits, masked edits and deterministic tools across nine repairs, with real outputs, costs, preservation scores and the failures.

Image editing

Edit the image you have instead of generating a new one

A generated image is often almost right. There is stray text on a label, a hand with the wrong number of fingers, or a crop that cuts off the subject. Generating it again with a new prompt changes everything else as well, so a fix in one place costs you the parts that were already right.

Kugel Platform can edit an existing image instead. An edit job takes the stored image, an instruction and optionally a mask, and saves the result as a new artifact. The original is never changed. Every edit records what it was made from, what it cost, and a score for how much of the rest of the picture survived.

This article reports what happened when nine common repairs were run live on 2026-10-20. That was the first day the image-editing models were called for real rather than against test stubs. Five of the nine repairs worked and four did not. Every image below is the actual output.

Image editing

Terms used in this article

Edit job. A create_agent_artifact_job call with operation edit. It names a source image and its fingerprint, so the job cannot run against a different file from the one you looked at.

Instruction edit. The model receives the whole image and a sentence describing the change, such as "remove the handwritten codes under the swatches". You can also pass up to two or three reference images, for example a product to place into the scene.

Masked edit. You first build a mask, an image the same size as the source with the area to change painted white. The model may only repaint inside it. build_edit_mask makes a mask from rectangles for free, or from a description such as "the white cream on her cheek" for one paid segmentation call ($0.005).

Preservation score. After every model edit, the platform compares the source and the result outside the area you declared you were changing. A score of 1 means identical. The default threshold is 0.95. A low score adds a warning and never blocks the job.

Geometry drift. The edited image comes back at a different size from the source. This is also a warning only.

Deterministic tool. An operation with no model and no cost, such as a crop, a text render or placing a flat image onto a surface. The same inputs always give the same output.

Image editing

How the nine cases were run

Each case had its own request and followed the same loop: take a source image, edit it, then measure the result and look at it. The first attempt used the cheapest model for the job. Instruction edits started on FLUX.2 klein 9B edit and masked edits on FLUX.1 Pro Fill. A failed attempt moved up to a more expensive model, with at most three paid attempts per case.

The models used were:

  • FLUX.2 klein 9B edit, about $0.0115 an edit.

  • Qwen Image Edit 2511, about $0.0315.

  • FLUX.1 Kontext Pro, which has no price in the cost table yet.

  • FLUX.1 Pro Fill, about $0.0525.

  • OpenAI gpt-image-1.

Costs below are the estimates on each job's cost receipt, not invoices. Each output was downloaded and looked at, and the verdict in each section is that visual judgement, not the score.

One case starts from a real published image: the hero photograph of the Dr. Lurie article on reactive skin. The other sources were generated for the test.

Case 1 · state change

Cream on a cheek, rubbed in: not fixed

Goal: the thick dollop of cream on the woman's cheek should look rubbed in, with a faint sheen, and nothing else should change.

Attempt 1, instruction edit on klein ($0.0115, preservation 0.925 of 0.95): the cream moved onto her fingertips, and her whole face became glossy and smoother.

Attempt 2, the same instruction on Qwen: the provider returned an error (status 422) on all three tries inside the job. No image was produced, and about $0.094 was still charged.

Attempt 3, masked edit on Fill with a mask made from the words "the white cream on her cheek" ($0.005 for the mask, $0.0525 for the edit, preservation 0.958): the mask was exact and nothing outside it changed. Inside the mask, the model painted a new, glossier dollop where the old one was.

What this shows: describing the cream in the prompt made the fill model draw cream. A prompt that describes only bare skin is the next thing to try. It was not run because the case had used its three attempts.

A woman presses three fingers to her cheek, where a thick white dollop of cream sits; a pump bottle and tap are blurred behind her.
Source: the published Dr. Lurie hero image, 1536 by 1024.
The same woman, but the cream now sits on her fingertips and her whole face looks shiny.
Instruction edit (klein): the cream moved to the fingers and the face turned glossy. 1248 by 832.
The same scene with an unchanged face and hand, and a rounder, glossier white dollop of cream on the cheek.
Masked edit (Fill): everything outside the mask kept, but the dollop was redrawn rather than rubbed in. 1440 by 960.

Case 2 · garbled text

A garbled bottle label made blank, then relabelled: fixed

Goal: remove the invented pseudo-words from a generated serum bottle's label, then put real label text on it.

Attempt 1, masked edit on Fill with a rectangle mask over the label ($0.0525, preservation 0.986): the label came back as a solid black slab. Both the preservation check and the text check passed this broken result.

Attempt 2, masked edit on gpt-image-1: the job failed with an error from OpenAI ("array too long"). The platform sends the image in a form OpenAI rejects, and this is a known bug.

Attempt 3, Fill with a literal description of the surface ("clean bright white paper label, plain solid white, same white as the bottle", plus "no black, no dark areas"; $0.0525, preservation 0.985): a clean blank label. The whole picture came back slightly warmer.

The real text was then added with three deterministic tools, at no cost. render_word_art drew "KUGEL LAB", "Barrier Serum" and "30 ml" onto a crop of the blank label, and project_planar_decal placed that crop back onto the bottle. check_image_text then found all three strings. The label is flat: it does not follow the curve of the bottle.

A white pump bottle on a shelf with a front label full of misspelled pseudo-words.
Source: generated, with invented text on the label.
The same bottle with a plain, blank white label.
Masked edit (Fill), third attempt: blank label. 1440 by 960.
The same bottle with a white label reading KUGEL LAB, Barrier Serum, 30 ml.
Deterministic text placed on the blank label; read back correctly by the text check.

Case 3 · painted codes

Hex colour codes painted into an image, removed: fixed

Image models sometimes paint colour codes from the prompt into the picture as text. This source was made to reproduce that. A text check read "#2F4A34", "#2B4DC2B" and "#104.DC68" under the swatches, and there were smaller handwritten marks as well.

Attempt 1, instruction edit on klein with eight rectangles marking the text ($0.0115, about 10 seconds, preservation 0.964): all the text is gone, including the small marks, with no smudges. The swatches, colours and paper are unchanged. The text check found nothing afterwards.

The output is 1248 by 832 rather than the source's 1536 by 1024. The picture is the same, only smaller. Klein returned that size on every edit in this test.

Paint swatches on cream paper with dark blue hex codes written beneath them and small handwritten marks.
Source: generated, with hex codes painted in as text.
The same swatches on clean paper with no text at all.
Instruction edit (klein), first attempt: all text removed.

Case 4 · anatomy

Repairing a hand: made worse

Goal: repair hand anatomy with a masked edit over the whole hand. The generated hand already had five plausible digits, so this tested whether the repair leaves a good hand alone.

Attempt 1, Fill with a mask over the whole hand ($0.0525, preservation 0.983): the hand was redrawn in a contorted pose with a ghost finger. The bottle shrank, and outlines of extra bottles and garbled words appeared.

Attempt 2, gpt-image-1: failed with the same OpenAI "array too long" error as case 2.

Attempt 3, Fill with a mask over the four fingers only ($0.0525, preservation 0.972): cleaner, but only four digits are visible. New garbled words appeared that echo the instruction.

The preservation score passed every time. It only measures pixels outside the mask, so it cannot tell when the inside got worse.

An open hand with five digits holding a small dropper bottle in front of a window, with diagram lines and invented labels around it.
Source: generated. The hand itself was acceptable.
The same scene after a fingers-only repaint: three fingers and a thumb are visible, with new garbled labels.
Masked edit (Fill), third attempt: one digit lost.

Case 5 · anatomy

Repairing a senior dog's legs and paws: made worse

Goal: repair the legs and paws of a generated senior dog with a masked edit. The source already showed four legs and four paws.

Attempt 1, Fill with a mask over the legs ($0.0525, preservation 0.972): still four legs. Words from the instruction were painted into the image as garbled text, for example "Keep Anatomy Corfue".

Attempt 2, gpt-image-1: failed with the OpenAI "array too long" error.

Attempt 3, Fill with a tighter mask and a shorter instruction ($0.0525, preservation 0.971): garbled text again, a splayed paw and a dark blot.

Fill has no separate list of things to avoid, so the platform folds the "keep" and "do not" lines into the same prompt. Fill then sometimes paints those words into the image.

A grey-muzzled dog standing side-on on a wooden floor with all four legs visible, beside diagram boxes with invented labels.
Source: generated, four legs and four paws.
The same dog with its lower legs redrawn: a splayed front paw, a dark blot and new garbled text near the floor.
Masked edit (Fill), third attempt: worse than the source.

Case 6 · product insert

Placing a product into a scene from a reference image: fixed

Goal: put a specific product into an empty bathroom scene by giving the model a photo of the product as a reference.

The Dr. Lurie site has no photograph of a single product, so the product is a generated stand-in: a white jar with a pale green lid. The first scene and packshot came out as diagrams with invented labels, because this site's image style asks for diagrams. Both were regenerated with a one-off photographic style.

Attempt 1, instruction edit on klein with the jar as a reference ($0.0115, about 5 seconds, preservation 0.9496, just under the 0.95 threshold): the jar on the counter has the same shape, matte white body and green lid as the reference. It is at a believable size and has a soft shadow. It sits left of the towel rather than at the far left. The rest of the scene shifted slightly, which explains the near-miss score.

Kontext accepts no reference images. A request that gave it one was refused before any charge (IMAGE_EDIT_REFERENCES_UNSUPPORTED).

An empty marble bathroom counter with a folded white towel and a window to the left.
Source scene: generated.
A matte white cosmetic jar with a pale mint-green lid on a white background.
Reference: generated stand-in product.
The same counter with the white jar and its green lid standing beside the towel, with a soft shadow.
Instruction edit (klein) with the reference: the jar placed into the scene.

Case 7 · consistency

The same character in a second comic panel: fixed on the second model

Goal: make the woman in a second panel the same character as in the first panel, which was passed as a reference.

Attempt 1, klein ($0.0115): only the colours carried over. The figure kept a different face, long hair and adult proportions.

Attempt 2, Qwen ($0.0315, about 10 seconds, full 1536 by 1024 output): the same character, with a short red bob, a round face, a yellow raincoat and green boots. She is now sitting in the café with a cup of tea. Qwen redrew the whole panel rather than editing it, and it added a chalkboard with garbled lettering. That redraw is why the preservation score was 0.31. A score that low is expected when most of the picture is supposed to change.

Comic panel of a small round character with a red bob, yellow raincoat and green boots at a rainy bus stop, framed by diagram labels.
Panel 1, used as the reference.
Comic panel of a slender woman with long brown hair holding a cup of tea by a window.
Panel 2 before the edit.
Comic panel of the red-bobbed character in her yellow raincoat and green boots, seated at a café table holding a cup of tea.
Panel 2 after an instruction edit on Qwen with panel 1 as reference.

Case 8 · reframe

A landscape hero made portrait (4:5): fixed without a model

Goal: turn a wide image into a 4:5 portrait without losing the runner. The job's size list has no true 16:9 and no 4:5, so the source is 3:2.

smart_crop picks a 4:5 frame automatically, free and instantly. It kept the runner from head to feet but left a strip of the source's text panel along one edge. A manual crop with image_transform, starting 717 pixels from the left, gave a clean 819 by 1024 image, also free.

The model routes did not reframe:

  • Klein asked for 1024 by 1536 (2:3, the nearest allowed portrait size) did return that size, at $0.017. It redrew the whole scene: a different face, and a logo on the shoe that was not there before.

  • Kontext ignored the 4:5 instruction and returned another landscape image.

For a change of shape, a crop is the right tool. A model is only worth trying when the subject is cut off and new picture has to be invented.

Wide image: a runner on a seaside promenade at sunrise on the right, with a cream panel of diagram labels on the left.
Source: generated, 1536 by 1024.
Portrait crop showing the runner from head to feet with sea and sky.
Deterministic crop with image_transform: 819 by 1024, 4:5.
Portrait image of a runner on a promenade, with a different face and a logo on the shoe.
Instruction edit (klein) at 1024 by 1536: a new picture, not a reframe.

Case 9 · restyle

Over-smoothed skin given natural texture: not fixed

Goal: replace airbrushed, glossy skin with natural texture, keeping the same person.

Attempt 1, klein with the face marked ($0.0115, preservation 0.841): real pores appeared and the gloss went. The model also added freckles, age spots and deep folds, so the woman looks about fifteen to twenty years older.

Attempt 2, Qwen ($0.0315): the skin stayed smooth, and the diagram shapes in the background were deleted although the instruction said to keep them.

Attempt 3, Kontext: a different-looking woman with new hair and new framing, and the skin still glossy.

Of the three, klein came closest. A softer instruction ("subtle pores, keep apparent age, no freckles or deep wrinkles") limited to the cheeks and forehead is the next thing to try.

Close portrait of a woman with glossy, airbrushed skin, beside diagram boxes with invented labels.
Source: generated, with over-smoothed skin.
The same portrait with textured skin, but with heavy freckles, age spots and deep lines that make her look much older.
Instruction edit (klein): texture added, but the face aged.

Image editing

What the scores do not tell you

The preservation score answers one question: did the rest of the image survive? It does not answer whether the defect is fixed.

  • On masked edits it only looks outside the mask. Every failed Fill edit here scored between 0.96 and 0.99.

  • On edits where most of the picture is meant to change, such as a new character, a reframe or a restyle, it fails even when the result is good.

  • The text check missed small handwriting and passed a black label.

Look at every output before you use it.

Size changes are routine. Klein and Kontext returned 1248 by 832 for a 1536 by 1024 source, and Fill returned 1440 by 960. Qwen kept the source size. Each size change adds a geometry-drift warning and the edit is kept. Resize afterwards if the size matters.

Three problems were found and reported:

  • Masked edits on gpt-image-1 fail every time with an OpenAI "array too long" error.

  • One Qwen job failed at the provider and was still charged for three tries.

  • On this site, the default image style turns photographic subjects into diagrams with invented labels unless a one-off style is passed.

Image editing

Which tool to reach for

Use these defaults:

  • Stray text on a plain background: an instruction edit on klein with the text areas marked, then a text check and a look.

  • A surface that must be blank, then lettered: a masked edit on Fill with a rectangle mask and a literal description of the surface, then render_word_art and project_planar_decal for the text.

  • A product from a photo: an instruction edit with the product as a reference image, on klein.

  • The same character in a new scene: Qwen with the earlier panel as a reference.

  • A new shape: crop, with smart_crop or image_transform, and check the crop.

For anatomy errors on hands and paws, generate the image again. Masked repainting made both cases here worse. For a small change of state such as cream being rubbed in, and for skin texture, none of the models tested produced a usable result yet.

The site's defaults for edits were left as they were. Klein is the default for instruction edits and Fill for masked edits, because each was the cheapest model that passed a case.

Back to Library