AI Model Wiki

    Skip to main content
    7 min read
    Lesson 6 of 6

    Inpainting, Outpainting & Upscaling

    From the course Stable Diffusion Mastery: Local AI Image Generation

    Beyond text-to-image generation, Stable Diffusion excels at editing, extending, and enhancing images. These advanced techniques turn SD into a complete image editing suite.

    Inpainting

    Inpainting lets you selectively regenerate parts of an image while keeping the rest intact.

    How It Works:

    1. Load an image into the inpainting tab
    2. Paint a mask over the area you want to change
    3. Write a prompt describing what should appear in the masked area
    4. Generate — the AI fills in the masked area while blending with the surrounding image

    Tips for Better Inpainting:

    • Mask padding — Add 30-60px of padding around your mask for better blending
    • Denoising strength — 0.4–0.6 for subtle changes, 0.7–0.9 for major replacements
    • Match the style — Use the same model/settings that created the original image
    • Inpaint at full resolution — Enable this option for sharper results in small areas
    • Multiple passes — For complex edits, do several rounds with different masks

    Common Inpainting Uses:

    • Fix hands, faces, or anatomy errors
    • Change clothing, accessories, or backgrounds
    • Add or remove objects
    • Correct AI artifacts

    Outpainting (Canvas Extension)

    Extend an image beyond its original boundaries:

    1. Place your image on a larger canvas
    2. Mask the empty areas
    3. Prompt the model to generate content that continues the scene
    4. Use lower denoising (0.5–0.7) for consistency with the original

    Upscaling

    Take AI-generated images from standard resolution to print-quality:

    Real-ESRGAN / ESRGAN:

    • 4x upscaling with excellent quality
    • Multiple models for different use cases (photos, anime, general)
    • Fast and effective for most needs

    Ultimate SD Upscale (Tile-Based):

    • Splits the image into tiles, upscales each with SD
    • Adds detail that wasn't in the original
    • Best quality but slowest method
    • Use with the same model and a detail-enhancing prompt

    Practical Upscaling Workflow:

    1. Generate image at native resolution (512×512 or 1024×1024)
    2. First pass: Real-ESRGAN 4x upscale (quick, good quality)
    3. Second pass (optional): SD upscale with tile-based method for added detail
    4. Final: Sharpen and color-correct in your image editor

    Img2Img (Image-to-Image)

    Use an existing image as a starting point:

    • Low denoising (0.2–0.4) — Subtle style transfer, keeps original composition
    • Medium denoising (0.4–0.7) — Significant style change while maintaining structure
    • High denoising (0.7–1.0) — Major transformation, original is just a loose guide

    Common img2img workflows:

    • Photo → Painting style conversion
    • Sketch → Rendered illustration
    • Low-quality image → High-quality reimagining
    • Real photo → Anime/cartoon conversion

    Batch Processing

    For production workflows, SD can process images in batches:

    • Set batch count (number of generations) and batch size (simultaneous generations)
    • Use scripts for automated variations
    • X/Y/Z plots to compare settings systematically

    These advanced techniques are what separate casual AI art from professional-quality production. Master inpainting and upscaling, and you'll rarely need to regenerate images from scratch.

    Key Takeaways

    • •Inpainting selectively regenerates parts of an image — great for fixing errors and editing
    • •Outpainting extends images beyond their original boundaries seamlessly
    • •Upscaling workflow: Real-ESRGAN for speed, SD tile-based upscale for maximum detail
    • •Img2img transforms existing images with controllable denoising strength
    • •These techniques make SD a complete image editing suite, not just a generator
    0 of 6 lessons marked complete

    Progress is kept in this browser only.