Nodes/ComfyUI Inpaint Nodes/Load Inpaint Model
ComfyUI Node Runs on cloud

Load Inpaint Model

Point ComfyUI at LaMa or MAT

By Acly·Created 3 years ago·Updated 2 months ago· 1,224
Load Inpaint Model
    • inpaint model
    model_name

    The loader half of this pack's non-diffusion inpainting path. Its whole job is finding a LaMa or MAT checkpoint on disk and packaging it up for Inpaint (using Model) to run. If that node is the one that actually does the filling, this is the one that gets it the weights.

    LaMa and MAT, briefly

    These aren't diffusion models - they're older, purpose-trained CNNs built specifically to fill holes in images convincingly, using spandrel (the same model-loading library that powers a lot of ComfyUI's upscaler support) under the hood. LaMa (advimman's "Large Mask" inpainting model) is the classic, widely-used option for object removal and outpainting. MAT is the alternative architecture with its own tradeoffs in speed and quality. Neither takes a prompt - they reason purely from the surrounding pixels, which is exactly why they're fast and predictable rather than creative.

    Inputs and outputs

    • model_name - a single COMBO dropdown, populated from whatever files you've placed in ComfyUI/models/inpaint.

    Output is a single inpaint model (INPAINT_MODEL), which goes into Inpaint (using Model)'s inpaint_model input.

    Installing it

    The node pack itself: ComfyUI Manager (search "ComfyUI Inpaint Nodes"), or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Acly/comfyui-inpaint-nodes.git
    

    Restart ComfyUI. Then get an actual model file - the loader is useless without one:

    Either goes in ComfyUI/models/inpaint.

    Common issues

    Empty dropdown means the model file isn't in ComfyUI/models/inpaint, or you added it without restarting ComfyUI (or refreshing the node's file list) afterward. This is the same folder used by the Fooocus patch files in this pack, so it's worth keeping organized if you're using both paths.

    Choosing between LaMa and MAT isn't something the README gives hard rules for - LaMa is the more established, commonly-used default for object removal and outpainting; MAT is worth trying if you're not happy with LaMa's results on a particular image. There's no wrong first pick, and swapping is just a dropdown change.

    A pickle-format .pt/.pth file will trip Python's standard warnings around loading arbitrary pickles if your environment is strict about it - the fp16 safetensors MAT variant sidesteps that entirely if it's an option for your workflow.

    Don't confuse this with Load Fooocus Inpaint. They live in the same pack and both end in "load an inpaint thing," but they feed two completely different pipelines. This node's output goes to Inpaint (using Model), a fast, promptless CNN pass with no KSampler involved. Load Fooocus Inpaint's output goes to Apply Fooocus Inpaint, which patches your SDXL model and still needs a full diffusion sampling pass afterward. If you wire a LaMa model into the Fooocus patch node (or vice versa) the type mismatch will stop you at the graph level - but it's worth knowing which one you actually want before you start building, since they solve different problems: LaMa/MAT for fast, prompt-free removal and outpainting; the Fooocus patch for prompt-guided, diffusion-quality fills.

    Categoryinpaint

    Inputs (1)

    NameTypeDefaultDescription
    model_nameCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    inpaint modelINPAINT_MODEL