ImageRouter icon

ImageRouter

Generate AI images and videos through ImageRouter.io

Overview

The node "ImageRouter" enables generating AI images and videos using the ImageRouter.io API. Specifically, for the Image to Image operation under the Image resource, it allows users to transform or edit an existing image based on a text prompt. This can be useful in scenarios such as enhancing photos, creating variations of an image, or applying artistic styles guided by textual descriptions.

For example, you might provide an original photo and a prompt like "make this look like a watercolor painting," and the node will generate a new image reflecting that style. Alternatively, if no input image is provided, it can generate an image purely from the prompt.

Properties

Name Meaning
Model The AI model to use for generation (e.g., "test/test").
Prompt Text description guiding the image generation or editing.
Image Optional binary property containing the input image to edit. Leave empty to generate image from text only.
Image Mask Optional binary property containing a mask image used for selective editing (only some models require it).
Quality Generation quality level; options: auto, low, medium, high (if supported by the model).
Size Output image size, either "auto" or specific dimensions like "1024x1024".
Response Format Format of the returned image data; options are URL or Base64 JSON.

Output

The node outputs JSON objects representing the response from the ImageRouter API. The structure depends on the API response but generally includes generated image URLs or base64-encoded image data depending on the selected response format.

If binary data is involved (input images or masks), these are handled internally but not output directly; the output focuses on the generated image information.

Dependencies

  • Requires an API key credential for ImageRouter.io configured in n8n.
  • Uses HTTP requests to communicate with the ImageRouter API endpoint at https://api.imagerouter.io/v1.
  • Supports multipart form-data upload when sending input images and optional masks.

Troubleshooting

  • Binary Property Not Found: If the specified binary property for the input image or mask does not exist on the input item, the node throws an error indicating which property is missing. Ensure the input data contains the correct binary fields.
  • Invalid Model or Prompt: Providing an invalid model name or empty prompt may cause API errors. Verify the model string and ensure the prompt is meaningful.
  • Unsupported Quality or Size: Some models may not support all quality levels or sizes. Use "auto" or check model documentation.
  • API Authentication Errors: Make sure the API key credential is correctly set up and has necessary permissions.

Links and References

Discussion