Inpaint Processor
Overview
The Inpaint Processor fills in or modifies selected regions of an image based on a mask and text prompts. It supports multiple models via the model
parameter and accepts additional model‐specific options through options_json
. Additionally, the processor offers pre‐processing and post‐processing resize options to control the resolution of the image fed to the inpainting API and the final output quality.
Example Usage
- processor:
processor: "inpaint"
inputs:
source: "input/input.png" # Filepath to the source image to be inpainted.
mask: "mem/mask.png" # Filepath to the mask image defining the inpainting region.
params:
prompt: "a single vehicle on a solid white background"
negative_prompt: "walls, cars"
model: "sdxl" # The model to use (default is "sdxl"; alternative: "stable diffusion").
options_json: "{}" # JSON string with additional model-specific options.
pre_width: "1024" # Optional. If >0, resize the source image and mask to this width before inpainting.
pre_height: "768" # Optional. If >0, resize the source image and mask to this height before inpainting.
post_width: "0" # Optional. If >0, resize the inpainted result to this width after processing.
post_height: "0" # Optional. If >0, resize the inpainted result to this height after processing.
outputs:
target: "output/output.png" # Filepath where the final inpainted image will be saved.
Inputs
Key |
Required |
Description |
source |
Yes |
Filepath to the source image to be inpainted. |
mask |
Yes |
Filepath to the mask image defining the inpainting region. |
Params
Key |
Type |
Default |
Description |
prompt |
str |
N/A |
The text prompt describing the desired content for the inpainted area. |
negative_prompt |
str |
N/A |
A text prompt specifying undesired elements to avoid in the inpainted output. |
model |
str |
"sdxl" |
The model to use for inpainting. Currently supported models include "sdxl" (default) and "stable diffusion". |
options_json |
str |
"{}" |
A JSON string containing additional model-specific options. |
pre_width |
int |
0 |
Optional. If greater than 0, the source image and mask will be resized to this width before inpainting. |
pre_height |
int |
0 |
Optional. If greater than 0, the source image and mask will be resized to this height before inpainting. |
post_width |
int |
0 |
Optional. If greater than 0, the inpainted result will be resized to this width after processing. |
post_height |
int |
0 |
Optional. If greater than 0, the inpainted result will be resized to this height after processing. |
Outputs
Key |
Required |
Description |
target |
Yes |
Filepath where the final inpainted image (saved as a JPEG converted to PNG) will be saved. |