Actions9
Overview
The "Inpaint" operation of the Image resource in this node allows users to selectively replace or modify specific parts of an image using a mask. The mask image defines which areas to alter (white regions) and which to keep unchanged (black regions). This is useful for scenarios such as removing unwanted objects, repairing damaged areas, or creatively altering parts of an image while preserving the rest.
Practical examples include:
- Removing a person or object from a photo by masking that area and filling it with AI-generated content.
- Changing the color or texture of a specific region in an artwork.
- Repairing old photos by masking damaged spots and letting the AI fill them naturally.
Properties
| Name | Meaning |
|---|---|
| Input Image | Name of the binary property containing the original image file to be inpainted. |
| Mask Image | Name of the binary property containing the mask image file where white areas are inpainted and black areas remain unchanged. |
| Prompt | Text description guiding how the masked areas should be transformed or replaced. |
| Number of Images | Number of variations to generate (1 to 6). |
| Style | Style for the transformation. Options: Any, Realistic Image, Digital Illustration, Vector Illustration. |
| Negative Prompt | Description of elements or qualities to avoid in the generated output (e.g., blurry, low quality, artifacts). |
| Response Format | Format of the response: either URL (link to the image) or Base64 JSON (base64 encoded image data). |
Output
The node outputs a JSON array where each item corresponds to one generated image variation. Each item contains either:
- A URL pointing to the generated inpainted image, if "Response Format" is set to URL.
- A base64 encoded string representing the image data, if "Response Format" is set to Base64 JSON.
This allows downstream nodes to either download the image from the URL or process the image data directly.
If the input images are provided as binary data, the node reads and encodes them appropriately before sending to the API.
Dependencies
- Requires an API key credential for authenticating with the Recraft v3 AI service.
- The node depends on the Recraft API endpoints for image inpainting (
POST /images/inpaint). - Binary input properties must contain valid image files (PNG/JPEG) accessible in the workflow.
- No additional environment variables are required beyond the API credential.
Troubleshooting
- Invalid or missing binary data: If the input image or mask image binary property is missing or invalid, the node will fail. Ensure the binary property names match those specified in the node parameters and that the data is properly loaded.
- Prompt length exceeded: The prompt text must not exceed 1000 bytes. Longer prompts will cause an error.
- Mask format issues: The mask image must clearly define white areas for inpainting and black areas to keep. Improper masks may lead to unexpected results.
- API errors: Network issues or invalid API credentials will cause request failures. Verify the API key and network connectivity.
- Number of images out of range: The number of images must be between 1 and 6 inclusive.
- Style option mismatch: Using unsupported style values may cause errors; use one of the predefined options.
Links and References
- Recraft AI Documentation (for detailed API usage and capabilities)
- n8n Documentation (for general node usage and binary data handling)
- Image Inpainting Concepts (background on the technique)
This summary covers the static analysis of the "Inpaint" operation of the Image resource in the Recraft v3 node based on the provided source code and property definitions.