Nodes/Moebius Inpainting/Moebius Inpaint
ComfyUI Node

Moebius Inpaint

Delete anything from a photo with a 0.2B model and no prompt

By b2renger·Created 2 months ago·Updated 2 months ago· 0
Moebius Inpaint
  • pipe
  • image
  • mask
  • image
steps20
guidance2.5
seed0
image_size512
mask_dilate0
pastetrue
compensatefalse
noise_offset0.0357

This is the node that makes a 0.2B-parameter inpainting specialist do the thing 10B-parameter models need a whole text encoder plus a few gigabytes of VRAM for. Paint a mask over the thing you want gone - the photobomber, the watermark, the cables, the road cone - hit go, and under a second later the region is filled with a plausible continuation of what's around it. On a 5090 the pack's own smoke test does 20 steps at 512×512 in 0.73 seconds - and it runs on cards that can't sniff a FLUX Fill checkpoint.

Moebius (hustvl, ECCV 2026) is a distilled diffusion inpainting model: a 0.22B student trained to mimic a 10B-parameter teacher's denoising predictions, which is how it keeps near-generalist quality at that size. When it dropped in June 2026, the model-release thread on r/StableDiffusion immediately had people asking "is there ComfyUI support?" This pack, a few days later, was the answer. The trade nobody mentions until they hit it: there is no prompt, and there can't be. No text encoder, no cross-attention language channel. Moebius replaces the whole prompt subsystem with 20 fixed learned embedding vectors - 10 "do the task," 10 "unconditional" for classifier-free guidance. The surrounding image is the instruction. Change the seed and the fill changes, but you never get to say "put a fountain here." That trade - no language channel - is exactly what makes it this small.

Mechanically, at each denoising step the UNet sees three things stacked into 9 latent channels: the noisy latent, your mask, and the latent of the image with the hole blanked out. Starting from pure noise inside the mask, it pulls the region toward whatever is statistically plausible given the surrounding pixels - textures, edges, lighting, geometry, even face structure.

Inputs that actually matter

The pipe comes from the Moebius Model Loader - this node does nothing without it. The rest:

  • image and mask - white (1.0) mask regions get removed and refilled; ComfyUI 1.0's MaskEditor polarity matches directly, no inversion needed. An empty mask returns the input unchanged.
  • steps (default 20) - DDIM denoising steps. 20 is what the model was tuned for; you rarely need more.
  • guidance (default 2.5) - classifier-free guidance, upstream's own 2.0–2.5 range. Higher pushes removal harder but starts hallucinating detail into the hole.
  • image_size (default 512) - the square side the model processes at. The model only handles square latents, so non-square images get squished to square internally and stretched back on output. Your aspect ratio comes back exactly as it went in. 512 is the training resolution; it's your best default.
  • mask_dilate (default 0) - grow the mask by N pixels before inpainting. Your first stop when the mask hugs the object too tight and leaves a sliver of it behind.
  • paste (default on) - Gaussian-blends the inpainted region back into the original-resolution image, so unmasked pixels come back bit-identical. This is the entire reason to use masked inpainting over an instruction-edit model in 2026: the untouched image survives exactly.

The optional compensate (off by default) adds upstream's brightness-compensated paste for visible seams; noise_offset (default 0.0357) tweaks the initial-noise variance - leave both alone until you hit a problem.

Output is a single image (IMAGE), which wires straight into SaveImage or downstream into anything that takes a batch.

Install

ComfyUI Manager (search "Moebius Inpainting") or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/b2renger/ComfyUI_moebius_inpainting
pip install -r ComfyUI_moebius_inpainting/requirements.txt

then restart. The requirements are all common (diffusers, einops, timm, opencv-python, huggingface_hub) - torch is deliberately not pinned, because ComfyUI owns your torch build and the upstream repo's pin would break it. There's no flash-linear-attention dependency either; that belongs to the distillation teacher, not the student you're running.

Where people get burned

  • Expecting a prompt box. There isn't one, by architecture. Want "replace the car with a fountain"? That's a FLUX.2 Klein job - the pack ships separate FLUX graphs for exactly that, and the "replace" workflow chains Moebius-cleanup then FLUX-fill.
  • Picking the wrong checkpoint for the content. The model comes in four flavors (general, scenes, portraits, faces) - if the face is small inside a bigger scene, the general one usually wins.
  • Cranking image_size up to fix quality rarely helps - the model is trained at 512, so the move is run it, then upscale.
  • No custom CUDA kernels, so GPU support is just your torch build's support - Blackwell, Ada, older cards, even CPU and Apple Silicon work, fp32 by default.
CategoryMoebius

Inputs (11)

NameTypeDefaultDescription
pipeMOEBIUS_PIPE
imageIMAGE
maskMASK
stepsINT201–100DDIM denoising steps (upstream default 20).
guidanceFLOAT2.50–15Classifier-free guidance; upstream uses 2.0-2.5.
seedINT00–18446744073709550000
image_sizeINT512256–1024Processing resolution (short side). The model is trained at 512.
mask_dilateINT00–128Grow the mask by N pixels (at input resolution) before inpainting.
pasteBOOLEANtrueBlend the result into the original image so unmasked pixels stay identical.
compensateoptBOOLEANfalseUpstream brightness-compensated paste (advanced; implies paste).
noise_offsetoptFLOAT0.03570–0.2Initial-noise variance offset (upstream default 0.0357).

Outputs (1)

NameTypeDescription
imageIMAGE