Masked Outpaint Guide Fill
Fill masked areas with plausible pixels instead of a gray blob
- images
- mask
- images
Before a masked outpainting pass runs, the sampler needs to know what the masked area looks like - this is the classic "mask content / fill mode" decision, and most setups pick either "fill with a blurred average of surroundings" or "fill with flat gray." MaskedOutpaintGuideFill is that fill step as a standalone node, and its main trick is that it can spread your actual image's colors into the masked region instead of leaving a featureless slab. The model sees plausible neighboring content where the hole is, which tends to produce a more coherent extension than a flat gray start.
It's part of the Muffins-Flat-2-Panoramic outpainting toolset, but honestly it's pack-agnostic - if you've outpainted anything in ComfyUI you've had the gray-blob problem, and this is a cleaner answer than most of the manual workarounds.
How it works
Two fill_mode choices:
edge_spread(default) - fills the masked area by iteratively diffusing the surrounding pixels inward. Under the hood it runs a tiny 3x3 convolution, spreading the average of valid neighboring pixels into the hole one ring at a time, until the hole is filled oriterationsruns out. Think of it as a slow, controlled blur-inpaint: edges fade into the hole with direction rather than a hard wall.neutral_gray- instantly fills the hole with flat 0.5 gray. Fast, boring, sometimes exactly right.
Either way, the unmasked pixels are left completely untouched - the node only writes inside the mask, which is the whole point of a guide-fill: you want a conditioned image where the original content is byte-identical and only the fill area changed.
Inputs that matter
images- your IMAGE batch.mask- the MASK telling it where to fill. Standard convention: white (1.0) = fill, black (0.0) = keep. It handles a single mask applied across a batch, and resizes the mask to match if dimensions differ.fill_mode- the two choices above.iterations(default 96, up to 512) - how many diffusion passesedge_spreadgets. Big holes need more; the node short-circuits early once the hole is filled, so a high cap costs nothing if the fill completes first.
The output is a single images socket - same size as the input, just with the masked region filled. Feed it into the image side of your outpaint graph where the mask feeds the mask side.
When to pick which mode
If the hole is surrounded by real content you want to bleed into the extension - a sky gradient, a wall, a textured background - edge_spread gives the sampler a much better starting canvas than gray. If the masked area is huge and mostly abstract, edge_spread will eventually smear into mush anyway, so neutral_gray is the honest choice and it's instant. The KB's standing advice about fill modes applies here: a flat gray/white overwrite forces the model to invent rather than lean on what's there, while blurred surroundings preserve rough composition. That's the trade you're making with this dial.
Install
Same single-pack story as the rest of the Muffins nodes - requirements.txt is just numpy, no models, no downloads. ComfyUI Manager: search "Muffins-Flat-2-Panoramic-node". Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Ragamuffin20/Muffins-Flat-2-Panoramic-node.git
cd Muffins-Flat-2-Panoramic-node
python -m pip install -r requirements.txt
Restart ComfyUI. It's a small node with a small job, but if you've ever watched a gray-box seam wreck an outpaint, you'll appreciate having the edge-spread option as a first-class socket instead of a hack.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| mask | MASK | — | |
| fill_mode | COMBO | edge_spread | 2 options: edge_spread, neutral_gray |
| iterations | INT | 961–512 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |