zhenzhen-bria-genfill-v2-fal
Mask-guided inpainting that actually respects the mask
- image
- mask
- images
- response
- image_urls
Inpainting got quietly demoted over the last couple of years. Instruction-edit models took over most of the job, and honestly they're better at "change the lighting" type asks - but they have one structural weakness: the whole image passes through the model, so the parts you didn't ask to change drift a little, and the drift compounds across a chain of edits. BRIA GenFill v2 is the answer for the exact moment you care about that. It's a masked generative fill: only the region inside your mask is regenerated, and everything outside it stays bit-for-bit intact. That's the one thing instruction editors can't give you, and it's why people who build product shots or fix the same asset repeatedly still reach for this class of tool.
This node wraps bria/genfill/v2 through the Zhenzhen API, so you get BRIA's commercial inpainting per call. The use case is dead simple: load an image, draw a mask over what you want replaced (a butterfly covering a logo, a pothole in a street, an errant reflection), type what should be there, done.
How it works
Like the rest of this pack, it's a wrapper with an HTTP client inside. The node POSTs your image and mask (base64 by default) plus the instruction to the Zhenzhen FAL proxy, polls every few seconds, downloads the result, returns an IMAGE. Nothing runs locally - the steps_num and seed are just passed through to the hosted job. The sync_mode flag trades polling for an inline blocking call if you prefer.
One practical detail: the mask input slot is an IMAGE, not a MASK tensor. If you're drawing masks in ComfyUI and getting MASK output, convert it to IMAGE before this node, or paste a mask_url directly.
Inputs and outputs that matter
instruction is required - describe what should appear in the masked area. The default "A beautiful colorful butterfly" is a solid example of the phrasing.
image+mask- the pair that makes or breaks the result. Both areIMAGEtensors (or useimage_url/mask_urlstrings). The node errors if either is missing, so unlike the maskless edit nodes there's no ambiguity about intent.steps_num- 30 default (20-50 here, note it's a tighter range than Fibo's).seed- default 5555, so results are reproducible until you change it; FAL caps at 65535.skip_error- on, a failure returns a placeholder instead of failing the queue.
Outputs: images (the inpainted IMAGE), response (raw JSON), image_urls (the hosted result URLs, one per line).
Installing it
Same pack as every Zhenzhen node:
cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-zhenzhen
Restart ComfyUI, or install "Comfyui-zhenzhen" via ComfyUI Manager. No models to download - the requirements are HTTP libraries, and the actual inpainting runs on BRIA's servers.
Common issues
The pack-level stuff first: you need a Zhenzhen account with credit; the overseas API can throw 443 errors from some networks (VPN with TUN mode); and a 500 on first run is usually upstream, so re-run before debugging.
GenFill-specific traps: a soft or feathered mask produces a soft edge where the fill tries to blend - that's fine for backgrounds, terrible for a hard-edged product swap, so erode your mask edges deliberately. And if the fill ignores your instruction, check that the mask actually covers what you think it covers - the hosted model treats the mask as authoritative, and a tiny mask with a big instruction gives you a tiny result. One more: if you're coming from the instruction-edit nodes, remember GenFill's whole advantage is that outside the mask stays untouched. If you wanted the whole frame re-rendered, you're using the wrong node.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| instruction | STRING | A beautiful colorful butterfly | — |
| imageopt | IMAGE | — | |
| maskopt | IMAGE | — | |
| image_urlopt | STRING | — | |
| mask_urlopt | STRING | — | |
| api_keyopt | STRING | — | |
| seedopt | INT | 55550–65535 | 0 = random seed. FAL seed max is 65535. |
| steps_numopt | INT | 3020–50 | — |
| sync_modeopt | BOOLEAN | false | — |
| image_wayopt | COMBO | base64 | 2 options: base64, image_url |
| poll_intervalopt | INT | 61–60 | — |
| max_poll_attemptsopt | INT | 60010–3600 | Default 600*6s = 3600s timeout. |
| skip_erroropt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| response | STRING | — |
| image_urls | STRING | — |