Inpainting, Masking, and Editing

Lesson 1: Inpainting – Replacing Regions in Video

Lesson Objectives

By the end of this lesson, students should be able to:

  • Explain what inpainting replaces in a video frame
  • Draw or define a mask on a selected region
  • Write effective replacement prompts for inpainting
  • Evaluate inpainting results and identify common quality issues

Lesson Content

What inpainting does.

Inpainting replaces a selected (masked) area of a video frame with AI-generated content, while attempting to maintain consistency with the surrounding unmasked area. Common uses: removing an unwanted object from a scene, replacing a background element, changing a specific visual in a clip without regenerating the whole frame.

Defining the mask.

The mask defines the area to replace. Common mask definition approaches: painting over the area with a brush tool, using automated subject/background separation tools, or using geometric selection shapes. The mask's accuracy significantly affects inpainting quality – a rough or imprecise mask that bleeds into areas that should remain unchanged produces inconsistent seams at the mask boundary.

Writing effective replacement prompts.

The replacement prompt describes what should appear in the masked area – matching the surrounding scene's lighting, style, and visual character. "Continuation of the background city street scene, matching surrounding lighting and perspective, seamless blend with existing scene" is more effective than "city street" because it emphasizes continuity with the surrounding unmasked area.

Common inpainting quality issues.

Seam artifacts at the mask boundary (the replaced region looks inconsistently blended with the surrounding area), visual style mismatch between the replaced content and the original footage, and temporal inconsistency (the replacement looks different across frames) are the most common quality issues to check for in results.

Enroll to continue this lesson.

The preview above shows the lesson objectives and opening lesson content. Enroll to view the full lesson, complete the practice work, and take the lesson quiz.

Log In / Create Account
Back to Course