DeepSeekDSH
Independent community guideNot affiliated with DeepSeek.Download versions and guide references

AI Image Editing: Prompts, Masks and Review

Beginner guide to AI image editing without ruining your subject: copy our 4-line prompt template, avoid PNG mask traps, inspect edges, and use DSH safely.

Maintained by DeepSeekDSH (independent site)Documentation review
On this page
AI image editing illustration of changing a mug background while preserving the subject

Almost every beginner trying AI photo editing hits the same frustrating moment: "I only asked the AI to change the messy wooden table to a clean gray background—why did it warp my mug handle and turn the printed brand logo into gibberish?"

Skip the abstract theory. This beginner guide walks you through three practical skills step by step:

  1. Picking a tool that actually outputs edited image files (instead of a text-only chat model that just describes your photo);
  2. Copying our "4-line subject-lock prompt template" so the AI stops redrawing your product;
  3. Avoiding mask traps and running a safe 1-image-first workflow inside DeepSeek Harness (DSH) without overwriting your originals.

Step 1: Don't confuse "reading images" with "editing images"

Beginners frequently mix up three very different kinds of tools. Check this table before you start typing prompts:

Tool TypeWhat It Actually ReturnsReal ExamplesBest Use Case
1. Vision chat modelsReads your photo, yet only replies with text—cannot export a new image fileStandard text chat endpoints without an image-output toolAsking for critique or drafting image prompts
2. Generative AI image editorsTakes your photo + prompt and exports a brand-new edited image fileOpenAI GPT Image editing API, Google Gemini image editingReplacing studio backgrounds, relighting scenes, removing clutter
3. Standard crop / cutout editorsCrops, resizes, or pastes your exact original cutout over a new background layerPhotoshop, standard background-removal tools, image resize scriptsMandatory whenever tiny ingredient text, barcodes, or legal logos must stay 100% pixel-identical

Golden rule for beginners: Need a simple 2000×2000 to 800×800 resize, or selling a bottle covered in tiny fine-print text that cannot change by a single pixel? Do not ask generative AI to redraw the bottle—cut out the original photo and drop it onto a clean background layer instead.

Copy-and-paste "4-line subject-lock" prompt template

Typing "Make this product photo look more professional" invites the AI to invent new lighting, new colors, and a brand-new product shape.

Instead, copy this 4-line fill-in-the-blank template that states what is off-limits right up front:

1. Goal: Turn this existing mug photo into a square e-commerce product card image.
2. Only change: Replace ONLY the cluttered table behind the mug with a plain light-gray studio backdrop and soft even lighting.
3. Keep locked (do NOT redraw): Keep the mug's exact outline, handle shape, glaze color, and printed front lettering untouched.
4. Do not add: Do not add water droplets, props, extra logos, or any new text.

Follow-up tip: If the first output nails the mug yet leaves the background slightly too dark, fix one thing at a time on your next message ("Keep the mug from this version completely unchanged, and only brighten the gray background slightly") instead of rewriting the whole prompt from scratch.

Two mask ("paint-to-edit") traps beginners need to know

Many editing tools let you brush over the area you want changed (called a mask or inpainting). Keep two rules in mind:

  1. A mask is a strong hint, not a brick wall: As noted in OpenAI's official mask-editing docs, GPT Image treats masks as prompt guidance rather than a hard pixel lock—so borders and nearby lettering still need a visual check afterward.
  2. API masks need real PNG transparency, not black-and-white JPGs: Calling the OpenAI image-edit API directly requires a .png mask with the exact same pixel dimensions as your source image and a real transparent alpha channel marking the edit area. Uploading a flat black-and-white JPG will not mask anything.

Don't trust chat thumbnails! Use this 5-point zoom check

Tiny chat previews hide blurry letters and chewed-up edges. Open your original photo and saved output file side by side at 100% zoom and check five spots in 30 seconds:

Spot to InspectWhat to Check at 100% ZoomEasy Fix If It Failed
1. Printed text & logosWarped letters, merged strokes, or misspelled brand namesComposite the original logo/label layer back on top of the edited photo
2. Fine outer edgesMug handles, hair, or glass rims partially eaten by the new backgroundTighten your brush mask away from the edge or use a dedicated cutout tool
3. Shadow & light directionProduct lit from the left while the new shadow falls to the left tooSpecify light direction in Line 2 ("soft light from top-left, gentle shadow on the right")
4. File dimensions & formatCheck file properties: did resolution shrink or lose .png transparency?Export at full target resolution and save under a new filename
5. Real webpage cropDoes the product get clipped inside mobile or square card layouts?Ask for "15% clean margin around the subject" in your prompt

4-step beginner workflow: organize safe image edits with DSH

Want DeepSeek Harness (DSH) to help organize product folders or run an external image-editing plugin (MCP)? Never start with a loop over 100 original photos! Follow these four safe steps:

Step 1: Duplicate a backup folder before touching anything

Copy your source folder to photos-backup first, then open a separate photos-work folder in DSH via Choose workspace (first-run file tips in our Web UI beginner guide).

Step 2: Connect an actual image-editing tool if automating via MCP

Vision-capable chat models in DSH (DSH provider image-input docs) can inspect photos and write HTML/CSS, while generating edited image files requires connecting an image-editing tool server via DSH MCP setup (details in the MCP client docs). Keep your OpenAI or Gemini API keys stored locally—never hardcode keys inside browser frontend code.

Step 3: Run 1 single test photo to a new output folder first

Pick one photo (mug-01.png) and instruct DSH explicitly: "Read mug-01.png, generate the light-gray studio background version into output/mug-01-gray.png, and do not modify or overwrite mug-01.png."

Step 4: Inspect that 1 output file before running small batches

Open output/mug-01-gray.png on your computer, run the 5-point zoom check above, and only then run small batches of 5 to 10 images at a time.

Common questions

Why did my product still change slightly even when I wrote "keep unchanged"?

Generative AI redraws the image from pixels rather than locking layers mechanically, so "keep unchanged" is guidance rather than a mathematical lock. Whenever you need 100% pixel-identical text or logos, cut out the original product and composite it over the AI-generated backdrop.

Can every AI model that accepts uploaded photos also edit photos?

No. Many multimodal chat models only read images and output text. Always check that your chosen tool or API explicitly outputs edited .png or .webp image files.

Does painting a mask guarantee pixels outside the brush never change?

No. Prompt-guided masks in models like GPT Image can still blend or subtly alter pixels near the mask boundary, so always inspect fine edges and labels at full zoom.

What is the #1 rule before batch-editing 50 product photos?

Back up the originals in a separate folder, test your prompt and output path on one single image first, and always write edited results to a separate output/ folder so originals are never overwritten.

Model and workflow guides

Models and costs

Gemini 4 Neon is here. When is it worth switching models?

Compare Gemini 4 Neon in two coding setups, work through a $0.45 API example, and find Neon in Gemini, Google AI Studio, and Antigravity.

Read →
Models and costs

GPT-6.2 Astra & Sol Guide: Specs, Pricing & Choice

Beginner guide to OpenAI's GPT-6.2 Astra and Sol: Claude vs DeepSeek price table, plain-English benchmarks, 272K cliff, and step-by-step DSH & Python setup.

Read →
Models and costs

GPT-6.1 Terra Guide: Uses, Pricing and Sol Comparison

Beginner guide to OpenAI's GPT-6.1 Terra: half-price visual, computer-use, and writing model compared with Sol and DeepSeek, plus DSH and Python setup steps.

Read →
Model setup and costs

Connect Local Qwen 3.8 27B to DSH

Beginner guide to connecting local Qwen 3.8 27B to DSH: GPU memory table, LM Studio / Ollama / llama.cpp port setup, exact 5-field config, and error fixes.

Read →
Model setup and costs

Codex Costs: API Billing vs Subscription Usage

Beginner guide to OpenAI Codex costs: ChatGPT Plus login vs API-key billing table, real per-prompt dollar math, and 3 steps to lock a monthly budget cap.

Read →
Model setup and costs

Connect Grok API to DSH: Setup & Tools

Step-by-step beginner guide to connecting xAI's Grok API (grok-4.7) to DSH: Grok vs Groq comparison, exact 5-field custom provider setup, and 401/404 fixes.

Read →
Model setup and costs

Choose a Gemini Model by Task and Cost

Beginner guide to Google Gemini model selection: compare 3.8 Flash, 4 Argon, and DeepSeek prices, watch 2027 rate changes, and set up DSH in 4 simple steps.

Read →
Model benchmarks and engineering

Gemini 4 Argon Coding Benchmarks & 1M Window

Beginner guide to Google's Gemini 4 Argon coding scores vs Claude and GPT, how its shared 1M window and 65K output cap work, plus 4-step DSH setup.

Read →
API costs and enterprise ROI

Gemini 4 Argon API Pricing, Cache & ROI Guide

Beginner guide to Gemini 4 Argon API pricing: Dec 2026 2x rate jump, how 95% auto-caching and thinking tokens bill, DeepSeek cost comparison, and calculator.

Read →
Model setup and costs

Claude Sonnet vs Opus: Which Should You Use?

Beginner guide to Claude Sonnet 5.5 vs Opus 5.5: side-by-side API prices, per-prompt cost math, clear rules on when to upgrade, and 4-step DSH setup.

Read →
Models and costs

Opus 5.5 vs Fable 5.2: Which Model Is Right for You?

Beginner guide to Claude Opus 5.5 vs Fable 5.2: side-by-side API prices, coding benchmarks, per-task cost math, 30-day retention rules, and 4-step DSH setup.

Read →
Content creation

How to draft a video script with Media Desk for DeepSeek Harness

Turn a phone note into a video script, cover, and storyboard with Media Desk for DeepSeek Harness. See how to install it, set up images, and export a draft.

Read →
Mobile and remote access

Use DeepSeek Harness on Your Phone: Beginner Guide

Zero-jargon beginner guide to using DeepSeek Harness on your phone: find your computer IP, connect over home Wi-Fi in 2 minutes, or use Tailscale on 4G/5G.

Read →
Model interfaces and workflows

MiniMax H3 vs M-Series in DSH: Which Works?

Beginner guide to MiniMax H3 vs M3 in DSH: why H3 is for video while M3 handles coding, how to avoid region 401 errors, and 4-step DSH setup instructions.

Read →
API credentials and troubleshooting

Kimi API Key Errors: Region, Model and Permissions

Beginner fix guide for Kimi / Moonshot API key errors: match .ai vs .cn URLs, avoid retired model names and K3 Max typos, decode 401/404/429, and set up DSH.

Read →