Nodes/ComfyUI-RecraftAI/RecraftAI Inpainter
ComfyUI Node

RecraftAI Inpainter

Change only what's under the mask — Recraft's server-side inpaint keeps the rest untouched

By recraft-ai·Created 2 years ago·Updated about a year ago· 73
RecraftAI Inpainter
  • client
  • image
  • mask
  • image
prompt
style
substyle
seed0

Masked inpainting, done on Recraft's servers instead of your GPU. You give this node an image, a mask, and a prompt; the model regenerates only the masked region and leaves everything outside it alone. That's the classic inpainting contract, and it's worth remembering why it still matters: whole-frame edit models like Kontext and Qwen-Image-Edit re-render everything and bring the unmasked pixels back close but not identical. A true masked inpaint gives you untouched pixels outside the mask, every time.

That's exactly what this node promises. The README is unusually precise about it: "pixels with mask values >= 0.5 will be filled based on the prompt, while others will keep intact." The non-masked parts of your image are not merely preserved - they're sent to the API as fixed context and come back unaltered. If you've ever had an edit model drift a face or shift a logo across three sequential fixes, you know why that's a feature worth paying for.

The inputs that matter

Required: client, image, mask, and prompt.

The mask is a standard ComfyUI MASK tensor, so anything that produces one works - a hand-drawn mask, a segmentation output, a BiRefNet cutout. Here's the catch baked into the source: the node thresholds the mask hard. Values at or above 0.5 become fully filled; everything below becomes untouched. There's no soft edge, no partial strength - anti-aliased or gradient masks get slammed into hard black-and-white before they're sent up. If you want feathering, you can't get it from the mask itself; you'll have to blur the input image's masked boundary some other way, or accept the hard edge.

The prompt describes what fills the masked area - "a red leather jacket," "remove the person and show the empty street." style and substyle (realistic_image / digital_illustration plus seventeen substyles) and seed round out the optional inputs.

How it works

The node serializes the image and the thresholded mask, then multipart-POSTs both, plus the prompt and style, to Recraft's /images/inpaint endpoint. The server returns a URL, the node downloads it, and hands you back a full IMAGE tensor on the image output - mask region regenerated, the rest sent up as fixed context and returned unaltered. As with the rest of the pack: server-side compute, no local model, paid per call.

Installing it

ComfyUI Manager: search "RecraftAI", install ComfyUI-RecraftAI, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/recraft-ai/ComfyUI-RecraftAI
cd ComfyUI-RecraftAI && pip install -r requirements.txt

Windows portable: .\python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-RecraftAI\requirements.txt. Dependencies are just requests, torch, Pillow, numpy; no model downloads, no VRAM. You'll need an API key from recraft.ai/profile/api with a positive API units balance.

Where people get burned

  • Hard mask edges. The 0.5 threshold is the single most surprising behavior here. If your mask has soft, semi-transparent regions, they're not "a bit inpainted" - they're either fully regenerated or not touched at all.
  • Empty prompt = hard fail. The node raises Prompt is required, same as the other prompt-driven nodes in the pack.
  • Mask orientation. ComfyUI masks are single-channel; if you're feeding a mask from a node that produces an RGBA image instead, convert it to a proper MASK first.
  • Cost per call. Every inpaint is a paid API call. It's tempting to iterate on the prompt with the same mask; fix the prompt first, then re-roll seeds only if the result is wrong.
CategoryRecraftAI

Inputs (7)

NameTypeDefaultDescription
clientRECRAFTCLIENT
imageIMAGE
maskMASK
promptSTRING
styleoptCOMBO4 options: , any, realistic_image, digital_illustration
substyleoptCOMBO17 options: , b_and_w, hard_flash, hdr, natural_light, studio_portrait, +11
seedoptINT00–2147483647

Outputs (1)

NameTypeDescription
imageIMAGE