C.W.K.
Stream
Lesson 04 of 10 · published

Inpainting: Editing Part of an Image

~14 min · control, editing, l4

Level 0Spark
0 XP0/100 lessons0/14 achievements
0/200 XP to next level200 XP to go0% complete

피파 한 줄 정리: Inpainting = mask 안만 새로 생성, 밖은 보존. 손 고치고, 안 좋은 디테일 고치고, 배경 바꾸고 — 이게 generate-from-scratch loop를 끊는 도구야.

Mental model: You've painted a beautiful landscape, but you want to change the sky from blue to a dramatic sunset. Instead of repainting the entire canvas, you tape off everything except the sky, mix your new colors, and paint only within the masked area. The mountains, trees, and lake below stay exactly as they are. That's inpainting — selective editing within a mask while preserving everything outside it.

How Inpainting Works

Inpainting gives you a simple but powerful workflow:

  1. Start with a generated or real image that's mostly right but needs local changes.
  2. Draw a mask over the area you want to change (the "inpaint region").
  3. Write a prompt describing what should appear in the masked area.
  4. Generate: The model fills the masked region with new content while keeping everything outside the mask untouched.
Original Image          Mask                    Inpainted Result
  ┌──────────────┐    ┌──────────────┐        ┌──────────────┐
  │   ☀️ sky     │    │ ████████████ │        │  🌅 sunset   │
  │              │    │ ████████████ │        │              │
  │──────────────│    │──────────────│        │──────────────│
  │  🏔️ mountain │    │              │        │  🏔️ mountain │
  │  🌲 trees    │    │   (keep)     │        │  🌲 trees    │
  │  🏞️ lake     │    │              │        │  🏞️ lake     │
  └──────────────┘    └──────────────┘        └──────────────┘

What Inpainting Excels At

  • Fixing hands: Generated an amazing portrait but the hands have six fingers? Mask the hands, prompt "a natural hand resting on the table," regenerate.
  • Removing unwanted objects: A distracting element appeared? Mask it, prompt the background behind it, let the model reconstruct.
  • Changing clothing or accessories: Swap a jacket for a sweater, add glasses, change hair color — all without regenerating the face.
  • Replacing backgrounds: Keep the subject, mask everything around them, describe a new environment.
  • Fixing text: If text rendered poorly, mask it and either let the model try again or remove it entirely for post-production text addition.

Mask Quality Matters

The precision of your mask directly affects the quality of the inpaint:

  • Too tight: If the mask barely covers the problem area, the model doesn't have enough room to generate a coherent replacement. Include some buffer around the target.
  • Too loose: If the mask covers too much, you lose good parts of the image unnecessarily. Be selective.
  • Feathered edges: Soft mask edges help the new content blend smoothly with the surrounding image. Hard edges can create visible seams.
Key Takeaways
  • Inpainting edits a masked region while preserving everything outside it.
  • Essential for fixing hands, swapping elements, removing objects, and replacing backgrounds.
  • Mask quality matters: include buffer space, use feathered edges, match style in your prompt.
  • The generate → inspect → inpaint loop is the core professional workflow.

External links

Exercise

Obvious flaw 있는 portrait generate (extra finger 등). Inpainting으로 fix. 문서화: mask size·inpaint prompt·denoising strength·시도 횟수. 뭐가 작동?

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.