CivArchive
    ComfyUI-RegionInpaint - Spatially Packed Multi-Region Inpainting - v1.0
    NSFW
    Preview 149577509

    ComfyUI-RegionInpaint

    Spatially Packed Multi-Region Inpainting for ComfyUI

    ComfyUI-RegionInpaint lets you inpaint multiple separate regions in a single sampling pass. Instead of processing each masked area individually, it extracts square crops around the regions, packs them into one larger canvas, and sends that canvas through a regular sampler. After sampling, the regions are unpacked and stitched back into the original image.

    The workflow is designed to make multiple local edits in one pass while keeping them under the same prompt, conditioning, and sampling settings.

    Example

    The demonstration shows an image before inpainting, the KSampler generation preview with the packed regions, and the final reconstructed image. The example uses OneObsession – Illustrious.

    How it works

    1. Pack – Detects masked regions, optionally splits disconnected mask components, expands their context, extracts square crops, and arranges them into a canvas with configurable gutters and layout.

    2. Sample – Connects the packed canvas to your regular sampling workflow. All regions are processed together using the same model, prompt, and sampling settings.

    3. Unpack – Uses the original image and stitch metadata to place the generated regions back into their original positions, blending them with the masks.

    The Pack and Unpack nodes are decoupled. Stitch metadata can be saved and retrieved using a stitch ID, allowing the two nodes to work even if the normal execution cache is lost.

    Outpainting

    The Pack node also supports outpainting on the left, top, right, and bottom edges. An optional mask lets you combine outpainting with inpainting, or perform outpainting alone.

    • Whole image mode: Includes the entire extended image in the outpaint tile.

    • Strip mode: Processes only the new area plus configurable context from the original image.

    • Overlap: Optionally includes and masks a small part of the original image to help blend the seam.

    Outpaint regions are added after the inpaint regions.

    Main features

    • Multiple masked regions processed in one sampling pass.

    • Automatic splitting of disconnected mask components.

    • Configurable context expansion and mask growth.

    • Square crops with configurable tile size and border fill.

    • Flexible canvas layouts and gutters.

    • Optional tile rotation.

    • Four-direction outpainting, with whole-image or strip mode.

    • Mask feathering and reconstruction into the original image.

    • Persistent stitch metadata with stitch ID support.

    • Canvas size limits and validation for incompatible dimensions or aspect ratios.

    • Debug output for inspecting detected regions.

    Model compatibility and prompting

    Results depend on the model. Models differ in how they handle larger-than-usual spatial inputs, so some may produce distortions, inconsistencies, or interactions between regions. The method is not guaranteed to work equally well with every architecture.

    All packed regions share the same conditioning. When inpainting several similar objects, experiment with singular and plural prompt phrasing. For example, compare “a silver gauntlet” with “two silver gauntlets”. There is no universal best phrasing.

    Basic workflow

    Load Image → Pack → KSampler → VAE Decode → Unpack

    Connect the Pack node's canvas image and mask to your sampling workflow. Connect its stitch output to Unpack, along with the original image and decoded sampled result.

    See the workflow example for the complete node connections.

    Description

    Other
    Other

    Details

    Downloads
    11
    Platform
    CivitAI
    Platform Status
    Available
    Created
    11/19/2026
    Updated
    11/20/2026
    Deleted
    -

    Files

    ComfyUI-RegionInpaint.zip

    Mirrors

    CivitAI (1 mirrors)