Actions7
- Chat Actions
- Image Actions
- Audio Actions
Overview
The node provides image editing capabilities using an OpenAI-compatible API. Specifically, the Edit operation under the Image resource allows users to modify an existing image based on a text prompt and optionally a mask image that defines editable areas. This is useful for scenarios such as:
- Enhancing or altering parts of an image while preserving other areas.
- Creating variations of an image with specific style or quality preferences.
- Generating multiple edited images from one base image for creative exploration.
Practical examples include editing product photos by changing backgrounds, adjusting colors or details in artwork, or generating new versions of a photo with different styles.
Properties
| Name | Meaning |
|---|---|
| Model | The AI model used for image generation. Options are dynamically loaded via getImageModels. |
| Prompt | A text description guiding how the image should be edited. |
| Image | The base image to edit, provided as a string (likely a file path, URL, or base64). |
| Mask | An optional image where fully transparent areas indicate editable regions in the base image. |
| Number of Images | How many edited images to generate (1 to 10). |
| Size | The resolution of generated images: 256x256, 512x512, or 1024x1024 pixels. |
| Response Format | Format of returned images: either URLs or Base64-encoded JSON strings. |
| Additional Options | Collection of optional settings: • Quality: Standard or HD • Style: Vivid or Natural • User: Unique end-user identifier |
| Simplify Output | Whether to return a simplified response instead of raw API data (boolean). |
Output
The node outputs JSON data containing the generated edited images. Depending on the chosen response format:
- If URL is selected, the output includes URLs pointing to the edited images.
- If Base64 is selected, the output contains Base64-encoded image data.
If multiple images are requested, the output will contain an array of these images.
If Simplify Output is enabled, the response is streamlined to include only essential information about the generated images rather than the full raw API response.
The node does not explicitly handle binary data output; all image data is returned within the JSON structure either as URLs or Base64 strings.
Dependencies
- Requires an API key credential for an OpenAI-compatible image generation service.
- The node depends on external API endpoints supporting image editing operations.
- No additional environment variables or n8n configurations beyond the API credential are indicated.
Troubleshooting
Common Issues:
- Invalid or missing API credentials will cause authentication failures.
- Providing an unsupported model name or image size may result in errors.
- Incorrectly formatted input images or masks (e.g., wrong encoding) can cause request failures.
- Requesting more images than allowed (above 10) will likely trigger validation errors.
Error Messages:
"The resource \"image\" is not supported!"— indicates a misconfiguration or unsupported resource selection.- API error messages related to invalid parameters or quota limits should be handled by checking inputs and API usage.
Resolutions:
- Verify API credentials and permissions.
- Ensure input images and masks are correctly formatted and accessible.
- Use valid model names and sizes as per the options loaded by the node.
- Limit the number of images generated per request to the allowed range.