ComfyUI Node

FooocusInpaintWrapper

Fooocus-grade inpainting inside ComfyUI — the whole engine, vendored

By iacoposk8·Created 2 years ago·Updated about a year ago· 5
FooocusInpaintWrapper
  • image
  • mask
  • image
performanceSpeed
checkpointNo checkpoints found
prompt
guidance_scale4.00
image_sharpness2.00
seed0
negative_prompt
method
inpaint_additional_prompt
outpainting
lora1None
lora1_weight0.10
lora2None
lora2_weight0.10
lora3None
lora3_weight0.10
lora4None
lora4_weight0.10
lora5None
lora5_weight0.10

Fooocus's inpainting has a reputation that outlived Fooocus. Years after lllyasviel froze the project to bug-fixes-only, people still describe its masked inpaint as the thing they could never quite replicate elsewhere - and this node is the most literal way to get it: it doesn't reimplement Fooocus's inpaint, it drags the entire Fooocus codebase into your ComfyUI install and runs it for you. The name is a lie in a good way: no API, no separate UI, no key. You wire in an image and a mask, it hands the job to Fooocus's own engine, and a finished IMAGE comes back out.

What you're actually installing

The pack is one node, FooocusInpaintWrapper, and a vendored copy of the whole Fooocus repo under Fooocus/. The README says it plainly: the author copied practically all of Fooocus's code, wrote a thin bridge that converts ComfyUI tensors into Fooocus's input format, then patched the pipeline so the worker runs synchronously and writes progress to a percentage.txt file the node polls. It's an "embrace and vendor" hack, not a careful reimplementation - and it works.

The engine itself is the real Fooocus magic: its inpaint_v26 patch applied on top of any SDXL checkpoint, plus the fixed-resolution sampling, refiner swap and negative ADM guidance that make Fooocus output look the way it does. That means one hard constraint: this is SDXL-only, permanently. No Flux, no Qwen. Fooocus is a frozen SDXL machine and this node inherits both the strength and the ceiling.

The inputs that matter

For a beginner, five of them do the real work:

  • image and mask - required. Draw the mask wherever you want changes. Anything unmasked comes back bit-identical, which is the entire remaining case for mask-based inpainting in an era of whole-frame edit models.
  • performance - Quality, Speed, Extreme Speed, Lightning, Hyper-SD. These are Fooocus's own presets; Speed is the default and a fine place to start.
  • prompt - what should be in the masked area. negative_prompt is optional.
  • checkpoint - auto-lists everything in your models/checkpoints folder. Empty? It silently falls back to a bundled juggernautXL_v8Rundiffusion.safetensors.
  • seed - standard noise seed for reproducibility.

Two optional ones are worth knowing because they map to Fooocus features you can't get elsewhere: method (Improve Detail / Modify content) switches between a light detail-only pass and a full content replacement inside the mask, and outpainting (Left, Right, Top, Bottom, or combined) extends the canvas in that direction instead of filling a mask. There are also five lora1–lora5 slots with weights, picked from your models/loras folder. Everything else - resolution (fixed at 1152×896), sampler (dpmpp_2m_sde_gpu/karras), refiner - is hardcoded Fooocus opinion. You don't tune those, and that's the deal.

Installing it

Via ComfyUI Manager, search "ComfyUI Fooocus Inpaint Wrapper". Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/iacoposk8/ComfyUI-Fooocus-Inpaint-Wrapper
cd ../..
python_embeded/python.exe -m pip install -r ComfyUI/custom_nodes/ComfyUI-Fooocus-Inpaint-Wrapper/Fooocus/requirements_versions.txt

That second step is the one that bites. The pack has no top-level requirements.txt - the real dependencies live inside Fooocus/requirements_versions.txt, a big pinned list that includes gradio, rembg, GroundingDINO, SAM and onnxruntime, all installed into your shared ComfyUI Python environment. Manager will happily install the node and then leave you with a node that errors on load until you run that pip command yourself. Expect conflicts if you run other node packs with picky pins; this list is not shy about forcing versions like numpy==1.26.4.

The first run is also slow by design: the constructor downloads models it decides you need - the ~7GB juggernautXL_v8Rundiffusion checkpoint, the GPT prompt-expansion model, an SDXL VAE-approx, and an offset LoRA - straight into your ComfyUI models/ folders. Watch the terminal; it looks hung until the download bar finishes.

What to watch for

Because it runs the real Fooocus worker synchronously, the node blocks while generating - a slow SDXL inpaint is normal, and progress shows up via the percentage hack. And because that hack is a manual patch into vendored code, the README itself warns the instructions can rot - "several things could change and these instructions could no longer be valid." If previews stop updating or it throws on a fresh Fooocus copy, that's the drift talking.

Worth knowing before you commit to a heavy dependency tree for one node: if all you want is the patch, Acly's maintained comfyui-inpaint-nodes (Apply Fooocus Inpaint) gives you the same inpaint_v26 quality in a lean, graph-friendly form. Reach for this wrapper when you want the whole Fooocus experience - presets, outpainting, method switching, bundled checkpoint - in a single node.

Categoryinpaint

Inputs (22)

NameTypeDefaultDescription
imageIMAGE
maskMASK
performanceCOMBOSpeed5 options: Quality, Speed, Extreme Speed, Lightning, Hyper-SD
checkpointCOMBONo checkpoints found1 options: No checkpoints found
promptSTRING
guidance_scaleFLOAT4.000–30
image_sharpnessFLOAT2.000–30
seedINT00–18446744073709550000The random seed used for creating the noise.
negative_promptoptSTRING
methodoptCOMBO3 options: , Improve Detail, Modify content
inpaint_additional_promptoptSTRING
outpaintingoptCOMBO7 options: , Left, Right, Top, Bottom, Top + Bottom, +1
lora1optCOMBONone2 options: No checkpoints found, None
lora1_weightoptFLOAT0.10-2–2
lora2optCOMBONone2 options: No checkpoints found, None
lora2_weightoptFLOAT0.10-2–2
lora3optCOMBONone2 options: No checkpoints found, None
lora3_weightoptFLOAT0.10-2–2
lora4optCOMBONone2 options: No checkpoints found, None
lora4_weightoptFLOAT0.10-2–2
lora5optCOMBONone2 options: No checkpoints found, None
lora5_weightoptFLOAT0.10-2–2

Outputs (1)

NameTypeDescription
imageIMAGE