DEV Community

qingwancong
qingwancong

Posted on

A Change-and-Preserve Prompt Pattern for Safer AI Photo Editing

AI photo editing is easy to demo and surprisingly hard to trust.

A request such as “make this photo better” sounds harmless, but it gives a generative model permission to reinterpret almost everything: facial features, clothing, objects, background geometry, light direction, crop, and even the number of people.

While designing the MendTrue Photo Workspace, I found a more reliable pattern: treat every edit as a small contract with three parts — change, preserve, review.

Original rooftop portrait before prompt-based editing

Synthetic source image used for this workflow test.

Rooftop portrait after a restrained clarity, tone, and color edit

The result improves existing clarity, exposure, and color while keeping the same person, clothing, skyline, and crop.

1. Change: ask for one visible outcome

Start with the smallest edit that would make the image useful.

Good first requests include:

  • improve mild exposure and white balance;
  • reduce a reflection;
  • remove one distracting person;
  • recover moderate blur;
  • restore faded color.

A focused edit is easier to evaluate than a prompt that changes the weather, background, wardrobe, and face at the same time. It also gives a retry a clear target.

2. Preserve: make invariants explicit

The second half of the prompt should name what must not move. For a portrait, that usually means identity, expression, pose, clothing, important objects, light direction, framing, and aspect ratio.

I use a prompt shape like this:

Change: improve mild exposure and white balance.

Preserve: the same face, expression, denim jacket, skyline,
sunlight direction, composition, crop, and aspect ratio.

Do not add or remove people, objects, text, or logos.
Enter fullscreen mode Exit fullscreen mode

This is not magic syntax. Its value is separation: the model receives one transformation goal and a readable list of invariants instead of an ambiguous aesthetic wish.

3. Match settings to risk

Not every photo should get the same amount of generative freedom.

For recognizable people, I start conservatively. A damaged historical scan may justify more reconstruction, but a modern portrait usually needs less. If a reference image is supplied, its role must be explicit: for example, “use the second burst-frame image only as evidence for the open eyes.”

A reference without a declared role can quietly introduce the wrong expression, pose, or crop.

4. Review locally and globally

The review loop matters as much as the prompt.

At 100%, inspect:

  • eyes, teeth, and hands;
  • hair boundaries and jewelry;
  • text and logos;
  • edges around the requested change.

Then return to normal viewing size and compare:

  • identity and expression;
  • subject and object count;
  • body proportions and pose;
  • perspective, horizon, and light direction;
  • the complete crop.

A technically crisp local patch can still fail if the full image feels like a different moment or a different person.

5. Retry by changing one variable

If the result is faithful but slightly too warm, revise only the color instruction. If an untouched region changed, repeat the preservation rule and narrow the requested edit. Do not fix drift by adding five new aesthetic goals.

This one-variable loop makes failures diagnosable and keeps each generation comparable with the previous one.

A useful product boundary

Generative repair is not forensic recovery. A model can create plausible detail where the source contains weak evidence. For important family or historical photos, keep the untouched source, exact instruction, and approved output as separate files, and describe generated reconstruction honestly.

You can try the change-and-preserve workflow in the MendTrue Photo Workspace, or read the complete prompt-based photo editing guide.

Top comments (0)