DEV Community

LION ZHANL
LION ZHANL

Posted on

A Practical QA Pipeline for Generative Inpainting Edits

Generative inpainting is easy to demo and surprisingly easy to under-review.

A user supplies an image, identifies an unwanted overlay, and receives a patch that appears to fit the surrounding scene. At thumbnail size, the operation looks complete. At 100%, the same result may contain a halo, broken geometry, duplicated texture, or a semantic detail the model invented.

The engineering workflow should therefore end with a QA stage - not with the provider returning completed.

Disclosure: I am writing from the team behind Remove Sticker From Photo. The checklist below is tool-agnostic.

Use the correct mental model

Let the source image be I, the editable mask be M, and the generated output be O.

The provider is not recovering the hidden values of I beneath a sticker. Those pixels were replaced when the overlay was applied. It is estimating a visually plausible region from the context around M.

In other words:

  • Input: visible context plus an editable region
  • Operation: conditional generation
  • Output: a reconstruction
  • Not available: guaranteed original hidden pixels

That distinction affects both UX copy and acceptance criteria. Recovered suggests authenticity. Reconstructed accurately describes the result.

A seven-check acceptance pipeline

1. Global stability

Alternate between I and O. Changes outside M should be minimal. Check crop, aspect ratio, color balance, wanted text, and neighboring objects.

2. Mask-boundary integrity

Inspect the perimeter at 100%. Common failure signals include:

  • light or dark halos
  • feathered patches beside sharp objects
  • color bleeding
  • remnants shaped like the original overlay
  • edits extending farther than the user selected

Boundary problems often indicate an oversized or imprecise mask.

3. Geometric continuity

Trace any line crossing the generated region. Tile joints, shelves, window frames, cables, stripes, and horizons should retain direction, thickness, perspective, and spacing.

A photorealistic texture cannot rescue broken geometry.

4. Texture consistency

Compare frequency and repetition on both sides of the patch. Watch for cloned-looking clusters, sudden loss of grain, repeated fabric motifs, or wood patterns that terminate without explanation.

5. Photometric consistency

The reconstructed region should match local exposure, color temperature, shadow direction, contrast, and image noise. A patch can be semantically correct and still fail because it looks cleaner than the sensor data around it.

6. Semantic safety

Models sometimes synthesize letter-like marks, numbers, logos, labels, or product details. Plausible is not equivalent to true. Reject results that introduce meaningful-looking information into listings, documentation, evidence, or archival material.

7. Delivery-context review

Test both full resolution and the actual display size. A defect may appear only at 100%; an uneven visual mass may be more noticeable as a thumbnail.

Pass, retry, or reject

A lightweight decision matrix works well:

Decision Criteria Next step
Pass Local change, stable structure, consistent texture and lighting, no misleading detail Export
Retry Correctable boundary or texture issue Reduce the mask and preserve more context
Reject Large uncertain region, damaged important structure, or misleading result Use the original or another source

For our product workflow, automatic detection is useful for an obvious flat overlay. A manual brush is the fallback when the selected region needs tighter control. The result is then shown in the same frame for before/after review.

Safety belongs in the pipeline

Inpainting should be limited to authorized, ordinary photo cleanup. It should not be used to remove legitimate creator attribution or rights-management marks without permission, or to infer content behind privacy masks, sensitive redactions, identity information, or deliberate censorship.

Keeping the source image is also part of the system design. The generated output should never become the only copy.

The broader lesson is simple: provider success is a processing state, not a quality verdict. A trustworthy editing experience gives the user enough control and comparison context to make that verdict themselves.

The full end-user workflow is documented in the official guide.

How do you QA inpainting or generative-fill output in your own pipeline? I would be interested in the failure classes you see most often.

Top comments (0)