Overview
This node integrates with the fusionbrain.ai API to generate images from text prompts using AI models. It is designed primarily for the "Generate Image" operation, where users provide a textual description (prompt) and receive AI-generated images based on that input.
Common scenarios include:
- Creating artistic or illustrative images from descriptive text.
- Generating concept art or visual ideas quickly without manual drawing.
- Enhancing creative workflows by automating image generation based on style and model preferences.
For example, a user might input a prompt like "a drawing of nature drawn with a brush and paints, the sea, mountains, pine trees, calm colors" and receive an AI-generated image matching that description.
Properties
| Name | Meaning |
|---|---|
| Model Name or ID | Select the AI model to use for image generation. Options are loaded dynamically from available models. You can also specify a model ID via expression. |
| Style Name or ID | Choose the style to apply to the generated image. Options are loaded dynamically from available styles. You can also specify a style ID via expression. Default is "DEFAULT". |
| Prompt | The main text description guiding the image generation. For example: "a drawing of nature drawn with a brush and paints, the sea, mountains, pine trees, calm colors". |
| Negative Prompt | Text describing elements to avoid in the generated image, e.g., "worst quality, low res, blurry, watermark, logo". Helps improve output quality by excluding unwanted features. |
| Width | Width of the generated image in pixels. Integer between 1 and 1024. Default is 1024. |
| Height | Height of the generated image in pixels. Integer between 1 and 1024. Default is 1024. |
Output
The node outputs one or more items containing:
- json: An object with metadata about the generated image, including a
censoredflag indicating if the content was censored. - binary.data: The generated image file in JPEG format (
image/jpg). This binary data contains the actual image encoded as a buffer.
Each output item corresponds to one generated image. The binary data can be used downstream in n8n workflows for saving files, sending emails, or further processing.
Dependencies
- Requires an API key credential for authentication with the fusionbrain.ai service.
- Makes HTTP requests to fusionbrain.ai endpoints for model listing, style listing, image generation, and status polling.
- Uses multipart/form-data POST requests to submit generation jobs.
- Polls the job status endpoint repeatedly until the image generation is complete.
Troubleshooting
- Timeouts or long waits: The node polls the generation status every 2 seconds until completion. Large or complex prompts may take longer. Ensure your workflow timeout settings accommodate this.
- Authentication errors: Verify that the API key credential is correctly configured and has necessary permissions.
- Invalid model or style selection: If the selected model or style ID is invalid or unavailable, the API will return an error. Use the "List Models" and "List Styles" operations to verify available options.
- Image size limits: Width and height must be integers between 1 and 1024. Values outside this range will cause validation errors.
- API errors: Any API failure will throw an error unless "Continue On Fail" is enabled, in which case the error details are included in the output JSON.
Links and References
- fusionbrain.ai API Documentation (hypothetical link, replace with actual if available)
- n8n Expressions Documentation
- n8n Node Development Guide
