Skip to main content
FreeAcademy

Editing and Inpainting Like a Pro

Stop Rerolling. Start Editing.

Every time you regenerate a near-miss, you pay the same cost as the first roll and you lose the parts that were already good. The composition you liked. The lighting that finally clicked. The face that looks like your character. Re-rolling is gambling. Editing is engineering.

The shift from prompter to operator happens the moment you accept that no single generation is "the image." It's a draft made of regions. Some regions are done. Some need a surgeon. Your job is to identify which is which, mask the broken parts, and feed the model a tighter, more specific instruction than the original prompt ever carried.

This chapter is about that surgery: inpainting (fix a region), outpainting (extend the canvas), and masking (control exactly where the model is allowed to think). Once you can do these three things, your "good enough" rate jumps from maybe 1-in-20 to roughly 1-in-3, because you're no longer waiting for perfection on the first try.

Inpainting: Fix the Region, Keep the Image

Inpainting takes a mask you draw over a problem area and regenerates only that area, blending the result into the surrounding pixels. The rest of the image is untouched.

The classic use case is hands. Diffusion models still botch fingers because hands are high-variance, articulated, and often partially occluded. Instead of rerolling the whole portrait, mask the bad hand with a generous margin (include some wrist and a bit of background) and inpaint with a hand-specific prompt:

a relaxed human left hand, five fingers,
natural anatomy, soft studio lighting,
matching skin tone, photorealistic

A few rules that will save you hours:

  • Mask bigger than the defect. If you mask only the bad fingers, the model has no context for how the hand should sit. Include wrist, palm, and a bit of the surroundings.
  • Lower the denoise strength. Around 0.4-0.6 is usually right. Higher and you'll get a hand that doesn't match the lighting. Lower and you'll get the same broken hand back.
  • Prompt the region, not the scene. Don't paste your full original prompt. The model is only painting that patch; tell it what belongs there.
  • Generate four variations and pick. Inpainting is cheap. Always batch.

The same flow fixes warped eyes, distorted text, melted jewelry, third nostrils, and the famous "extra leg behind the chair." Mask, narrow prompt, low denoise, batch.

Outpainting: Extend the Canvas Without Losing the Vibe

Outpainting is inpainting's cousin. Instead of masking inside the image, you add empty canvas around it and let the model paint into the void, using the existing pixels as context.

This is how you turn a square portrait into a 16:9 banner, a vertical phone shot into a desktop wallpaper, or a tight crop into a cinematic wide. It's also how you fix bad framing after the fact: you generated a great character but cut their feet off β€” outpaint downward.

Three habits separate clean outpaints from obvious seams:

  • Extend in one direction at a time. Don't expand all four sides in a single pass. The model loses the thread. Go bottom, regenerate, then right, then top.
  • Overlap the seam. Most tools let you control how much of the existing image the model "sees" when painting the new region. Give it 100-200 pixels of overlap so lighting and texture carry through.
  • Match the prompt to the extension. If you're extending downward into "floor," say so. If you're extending sideways into "rest of the restaurant," say so. The model won't invent context it doesn't know about.

When you're building visuals for slide decks, thumbnails, or banner ads, outpainting is the difference between rerolling for hours hunting the right aspect ratio and shipping in 20 minutes. If you're making decks specifically, the AI Pitch Decks & Executive Presentations course walks through this exact workflow.

Masking: The Power Tool Most People Skip

A mask is just a black-and-white image telling the model where it's allowed to change pixels. White = paint here. Black = leave alone. Most tools let you brush a mask in the UI, but the real unlock is precision masking.

Three techniques worth learning:

Soft-edge masks for natural blends

Hard-edge masks leave visible seams, especially on skin or sky. Feather the mask edge by 10-30 pixels and the inpainted region melts into the surroundings.

Inverted masks for background swaps

Want to keep the subject and replace everything else? Mask the subject, then invert. Now you can drop your person into a new environment without touching them. Prompt the background only:

golden-hour rooftop bar in Athens,
warm bokeh city lights, shallow depth of field

This is one of the fastest ways to repurpose a single good portrait across an entire brand campaign.

Segment-then-mask for clean cutouts

Tools like SAM (Segment Anything) or the built-in segmenters in modern editors let you click on the subject and get a pixel-perfect mask in one shot. Use these instead of brushing by hand. Your masks get sharper, your edits get cleaner, your turnaround drops.

Artifact Removal: The Boring But Valuable Skill

Every generated image has artifacts: weird glints, asymmetric earrings, signage with garbled letters, leftover artist signatures from training data, that one strand of hair that goes through the wall.

Don't ignore these. A professional eye spots them immediately, and once you see them you can't unsee them. The fix is the same loop every time:

  1. Zoom to 200%. Scan corners, edges, hands, jewelry, text.
  2. Mask the artifact with generous margin.
  3. Inpaint with a minimal prompt describing what should be there.
  4. Batch four, pick the cleanest, move on.

Treat this as a 5-minute pass at the end of every image. It's the polish that separates AI-looking output from work people assume came from a designer.

A Quick Editing Workflow

Drop this into your process and your hit rate climbs immediately:

  1. Generate four candidates at low cost (small size, fewer steps).
  2. Pick the strongest composition, even if details are broken.
  3. Upscale once to working resolution.
  4. Fix the worst region first with inpainting. Usually hands or face.
  5. Sweep for artifacts at 200% zoom.
  6. Outpaint to your target aspect ratio.
  7. Final upscale for delivery.

The order matters. Fix structure before polish. Polish before resizing. Resize before final upscale.

Rerolling is the beginner move. Operating on the image you already have is what gets you a portfolio.