Editing

How to change a photo's background without changing your face

A practical guide to swapping the background of a portrait while every pixel of the person stays exactly as it was. Includes the exact commands to use.

Updated 2 min readSANA Team

Changing the background of a portrait is one of the most common edits people want. It is also where AI editors most often go wrong: the new beach looks great, but your jaw is slightly different, your hair has new strands, and your skin tone has shifted. You asked for a new place, not a new face.

This guide explains why that happens and how to get a clean background swap that leaves the person untouched.

Why AI editors change faces by accident

Most generative editors re-create the whole image each time, even if you only asked about the background. The model redraws everything, including the person, and tries to make it "look similar". Similar is not the same as identical. Small changes add up, especially after several edits.

The fix is simple to describe: the parts you did not ask to change should not be redrawn at all. They should be copied from the original, pixel for pixel.

Step 1: Start from your best original

Pick the sharpest version of the photo you have. Every later step copies from this file, so its quality sets the ceiling. In SANA your original is kept as it is and is never replaced by an edited copy.

Step 2: Tell the editor what to change, and what to keep

Be explicit. A good background command names the new place and the thing to protect:

/change the background to a quiet beach at sunset, keep @Me

@Me points at your verified reference. SANA finds you in the photo and locks every pixel that belongs to you before anything runs. In the preview, locked areas show in orange and the area that will change shows in blue.

Step 3: Read the plan before it runs

A trustworthy editor tells you what it is about to do. Before running, SANA shows:

  • What it found (you, the background, other people or objects)
  • How much of the image is locked
  • Which command will run
  • The credit cost

If the locked area looks wrong, for example part of your hair is blue, fix the selection first. It takes seconds and saves a redo.

Step 4: Match the light

A new background with the wrong light is the fastest way to make an edit look fake. If the new scene is a sunset, the light on the person should feel warm and come from the side. Use:

/set light from the left, warm

This relights the background around you while your locked pixels stay as they were. When you want the person relit too, say so explicitly.

Step 5: Check the result

Finally, run:

/check identity, edges, light

Each check answers pass, fail or abstain. Abstain means there is not enough evidence to say, and that is an honest answer, not an error. Look closely at the edges around hair and shoulders, where most background swaps break.

Quick checklist

  • Use the original, not a screenshot or an already-edited copy
  • Name what to keep, not only what to change
  • Confirm the locked area before running
  • Match light direction and warmth
  • Check edges around hair and hands

A good background swap should make people ask where you were, not what happened to your face.

Try it in SANA

SANA changes only what you point at and keeps every other pixel of your photo.

Join the waitlist

More guides