NAI 局部重绘采样器
Fix just the broken part — masked inpainting that ships a proper NovelAI infill request
- image
- mask
- nai_pipe
- positive
- negative
- core_settings
- advanced_settings
- 图像批次
- 实际Seed列表
- 费用与统计
Inpainting is the "fix what's wrong, leave everything else alone" technique, and NAI 局部重绘采样器 (Inpaint Sampler) is how you do it against NovelAI's API. You give it an IMAGE plus a MASK - white where you want things re-rendered - and it sends a proper NovelAI infill request, then composites the regenerated region back onto the original so the unmasked pixels come back bit-identical. That last part is the whole value proposition of masked inpainting versus a whole-image edit: nothing outside the mask moved.
It's a superset of the img2img sampler: all the same pipe, prompts, cards, seed, image_count (1–4), max_anlas, strength and noise inputs, plus the mask plumbing on top.
The inputs NovelAI-specific people will recognize
- strength - default 1.0 here (img2img defaults lower). This is the denoise dial for the masked area: 1.0 is full regeneration within the mask, 0.3–0.6 is gentle tweaking. Same rule as every inpainting guide: match strength to the job, not the default.
- add_original_image - default on. Whether the original pixels are sent along as context so the model knows what's outside the mask. Leave it on; this is what keeps the regenerated region consistent with the rest of the scene.
- mask_expand - 0–128px. Grows the mask before the request goes out. Useful when your mask is a hair too tight and the model's content bleeds at the edge.
- mask_feather - default 20px. Softens the mask edge for the composite-back step. This is the seam killer; too low and you get a hard cut line.
- edge_protection - default on. Uses the feathered, official-style composite back to the original. Turn it off and you get a hard-edged paste.
Under the hood it does the official NovelAI inpaint dance: the request uses the model's native inpainting structure (with the latent-space padding NovelAI expects), and the re-blend back onto the original is done the way NovelAI's own site does it rather than a naive paste.
The model note
V5 Full uses native V5 inpainting. V5 Curated currently falls back to V4.5 Curated inpainting to match the website's behavior - which means V5 Curated inpainting runs are capped at 6 character regions even though V5 Full text-to-image allows 32. If your character regions won't go past six in an inpaint, that's the reason.
Install and where it fits
Search ComfyUI-NovelAI-GENYTOOLS in ComfyUI Manager or git clone https://github.com/XTOGENY/ComfyUI-NovelAI-GENYTOOLS.git into custom_nodes, pip install -r requirements.txt, token in settings.
Practical notes from the inpainting playbook, adapted to paid calls: for fixing small detail (a face, a hand), keep the mask tight but feather it, and consider bumping strength per the change you want - a 0.4 inpainting pass fixes an artifact, a 0.9 pass replaces the subject. And check your mask before you spend: an accidentally empty mask returns the image unchanged while quietly charging you, which is the one failure mode this node can't defend against. Preview the mask, then run.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| nai_pipe | NAI_PIPE | — | |
| positive | NAI_POSITIVE_PROMPT | — | |
| negative | NAI_NEGATIVE_PROMPT | — | |
| core_settings | NAI_CORE_SETTINGS | — | |
| advanced_settings | NAI_ADVANCED_SETTINGS | — | |
| seed | INT | 00–4294967295 | — |
| image_count | INT | 11–4 | — |
| max_anlas | FLOAT | 00–100000 | — |
| strength | FLOAT | 1.000.01–1 | — |
| noise | FLOAT | 0.000–1 | — |
| add_original_image | BOOLEAN | true | — |
| mask_expand | INT | 00–128 | — |
| mask_feather | INT | 200–64 | — |
| edge_protection | BOOLEAN | true | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 图像批次 | IMAGE | — |
| 实际Seed列表 | STRING | — |
| 费用与统计 | STRING | — |