Content

Product & Person Replacement in Images with AI Agents

Use an AI agent to swap the product or person in a scene photo for the subject in a reference image while keeping the background intact — reuse one scene across many SKUs, skip reshoots, and batch the output.

Product & Person Replacement in Images with AI Agents

Tool names in this guide are for reference only and may have changed or been renamed. Please use the latest tools in the tool marketplace when implementing.

Key takeaways

  • Swap the subject, keep the background — reuse one scene across many SKUs
  • Point to a reference image to specify the new product or person
  • Once the instruction is stable, batch the output across SKUs

Tools used

Why "swap only the subject, keep the background" is so hard

E-commerce and marketing teams usually own one polished scene photo: the lighting, composition, and props are all right. But the moment you need it for a different SKU, the traditional options are to reshoot a whole set, or to mask the subject by hand in a photo editor and paste a new one — cutting edges, matching light, patching the background. One image eats an afternoon; ten products means ten times the work. Worse is redrawing the whole image: you try to swap the product and the background, palette, and props all drift, wasting the scene you carefully dialed in.

The actual need is narrow: replace just that product or person in the frame with the one in a reference image, and leave everything else alone. An AI agent connected to image-editing tools turns this into a single sentence — hand it the original and a reference subject, and it handles the swap while preserving the background.

The workflow in four steps

  1. Prepare assets: upload the original scene photo, plus a reference subject image (the new product or person).
  2. Subject replacement: swap the subject using the reference image, keeping the background as-is.
  3. Finish & verify: check edge blending and background consistency, refine if needed.
  4. Batch across SKUs: once the instruction is stable, reuse the same scene for many products.

How to do each step

Step 1: Prepare the original and the reference subject

Give the agent two images: the scene photo you're happy with, and a reference subject image (the product or person to drop in). In natural language, say which subject to replace, that it should match the reference, and that the background and other elements stay unchanged.

use ae to replace the product in this scene photo with the item in the reference image, keep the background unchanged

Step 2: Replace the subject from the reference

For reference-driven subject editing, use ae_minimax_image_01_subject_reference — it reconstructs the new subject from the reference while preserving the original background and composition. "Swap the product, keep the shelf" or "swap the model, keep the scene" both run through this step.

use ae to run ae_minimax_image_01_subject_reference with the scene as base and the reference as the new subject

Step 3: Finish and verify consistency

Compare the result against the original: did the subject become the one in the reference, are there hard seams at the edges, and did the background, props, and text stay consistent? To refine seams or details, finish with the instruction-editing tool ae_nano_banana_2_edit; when quality demands are higher, pass it through ae_openai_gpt_image_2_5_edit.

Step 4: Batch across SKUs

One scene usually has to carry a whole product line. Once the instruction is stable, have the agent reuse the same scene and instruction, swapping the reference subject for each SKU in turn and batching the output.

Reshoot/redraw vs subject swap:

Reshoot / full redraw Swap subject, keep background
Reshoot or regenerate per SKU Reuse one scene across many SKUs
Background, palette, props drift Background and composition stay as-is
Mask and align each image by hand Same instruction, batched output

Tools by goal:

Goal Tool (example)
Swap subject from a reference ae_minimax_image_01_subject_reference
Edge / detail finishing ae_nano_banana_2_edit
High-quality refinement ae_openai_gpt_image_2_5_edit

How to get started

  1. Sign up — new users get 1,000 free credits.
  2. Connect in-app from an agent like WorkBuddy or Trae by searching for "AgentEarth", or paste a one-line MCP config into Claude Code, Cursor or VSCode.
  3. Upload the scene photo and a reference subject, say "swap the subject, keep the background" in natural language, and let the agent produce the result.

FAQ

Can it keep the background unchanged? Yes. Reference-based subject replacement is built to change only the subject in the frame while keeping the background and composition as close to the original as possible; verify props, background, and text against the original after generation.

Can I swap a person too? Yes. Put a person in the reference image and the scene in the original, and have the agent replace the person in the frame — it runs through the same subject-replacement step.

Can I batch across SKUs? Yes. Stabilise the scene and instruction on one image first, then have the agent drop in different products one by one and batch the output.

Browse the 2,400+ tools · Access guide