InpaintingOption βοΈπ π π
Mask-based inpainting that runs on NovelAI's servers
- image
- mask
- NAID_OPTION
Inpainting is the classic "fix what's wrong" move - regenerate part of an image while leaving the rest alone - and InpaintingOptionNAID is how you do it through this pack. Wire its NAID_OPTION output into the option input on GenerateNAID, give it a source image and a mask, and the Generate node switches to the infill action on NovelAI's API. Everything runs on NovelAI's GPU; your local card just resizes and encodes.
The inputs:
- image - the source to edit.
- mask - the region to regenerate. This is an IMAGE input, not a ComfyUI MASK tensor, and it's worth understanding what the pack does with it: any non-black pixel becomes the inpainted region. White area = "regen here," black = "leave alone." That's a friendly behavior for beginners because a rough white scribble over the offending area just works.
- add_original_image - default on. The pack includes the original image in the request (it's a parameter NovelAI's API understands for blending the source with the inpaint). Leave it on; flipping it off generally produces more divergent results around the mask edge.
Both image and mask are resized to the generation size you set on GenerateNAID, so keep their aspect ratios in mind rather than fussing over exact pixels. If you're coming from local ComfyUI inpainting, the mental model transfers directly - the mask-based approach here is the same one the KB's inpainting essay describes, just hosted: masked region gets regenerated, unmasked stays.
One mechanism detail worth knowing because it explains a common surprise: the pack squeezes the mask into NovelAI's downsampled mask format (each 64px block becomes an 8px block) and then bakes it into the alpha channel before upload - and for V4/V4.5 models it re-upscales that back to full size on the API's expectation. Also, for anything other than the nai-diffusion-2 family, it appends -inpainting to the model id it sends, so you never hand-pick an inpainting variant - the pack does it for you.
This is where the pack's mask utilities earn their keep. The MaskImageToNAID / Convert Image to NAI Mask nodes pre-convert a mask image into NAI's expected format, which matters when your mask comes out of a segmenter or a manually painted PNG rather than being white-on-black already. If your inpaint results look wrong or the wrong region changes, check the mask isn't semi-transparent or anti-aliased gray - the alpha-derivation treats anything above black as "regenerate," so soft edges widen your inpaint region.
Cost-wise: inpainting is a full paid generation, same Anlas burn as any other Generate run. Install is the pack standard (Manager search "ComfyUI_NAIDGenerator", or clone into custom_nodes/ and restart), and you need NAI_ACCESS_TOKEN set in a .env in the ComfyUI root or the whole thing 401s before the first mask is drawn.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| mask | IMAGE | β | |
| add_original_image | BOOLEAN | true | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| NAID_OPTION | NAID_OPTION | β |