Image Tool
Overview
The node "Image Tool" provides a set of image-related operations, including image analysis, color correction, compression, watermarking, and image-to-image transformation. Specifically, the Image to Image operation allows users to generate a new image based on an input image and a text prompt, leveraging AI models such as GPT-based or DALL·E 2.
This operation is useful in scenarios where you want to create variations or enhancements of an existing image guided by textual descriptions. For example:
- Enhancing or modifying product photos with specific style instructions.
- Generating creative artwork variations from a base image.
- Creating marketing visuals by combining image content with descriptive prompts.
Properties
| Name | Meaning |
|---|---|
| Output Field | The name of the output field where the resulting image buffer will be stored. |
| Model | The AI model used for image generation. Options: gpt-image-1, dall-e-2. |
| Size | The resolution of the generated image. For dall-e-2: 256x256, 512x512, 1024x1024. For gpt-image-1: 1024x1024, 1024x1536, 1536x1024, or Auto. |
| Text Input (prompt) | The textual description guiding the image generation process. This is required and can be multiline. |
| Binary File | Boolean flag indicating whether the input image should be taken from a binary data field (true) or from a URL (false). |
| URL | The URL of the image to use as input when Binary File is false. |
| Input Binary Field | The name of the binary field containing the input image when Binary File is true. Default is "data". |
| Convert Unsupported Format to PNG | If the input image format is not one of png, webp, or jpg, this option converts it to png before processing. Useful to ensure compatibility with the image generation backend. |
Output
The node outputs the generated image data in the specified output field (default "data"). This field contains the image buffer representing the newly created image based on the input image and prompt.
If the input was provided as binary data, the output will also be binary image data suitable for further workflow steps that handle images.
Dependencies
- Requires an API key credential for accessing the underlying AI image generation services (e.g., GPT-based or DALL·E 2 models).
- Network access to download input images if using URLs.
- Proper configuration of credentials within n8n to authenticate requests to the external AI services.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Providing an unsupported image format without enabling conversion may result in errors.
- Incorrect binary field names or missing binary data when
Binary Fileis enabled. - Network errors when fetching images from URLs.
Error messages:
"Unknown operation: image2image": Indicates the operation parameter is incorrect or not implemented.- Errors related to image download failure usually mean the URL is invalid or inaccessible.
- Authentication errors suggest misconfigured or missing API keys.
Resolutions:
- Verify API credentials are correctly set up.
- Ensure the input image is accessible and in a supported format or enable conversion.
- Double-check property values, especially binary field names and URLs.