Actions22
- Runway Actions
- Minimax Actions
- Midjourney Actions
Overview
The Midjourney "Imagine" operation in this node allows users to generate images based on a text prompt using the Midjourney API via UseAPI. This operation sends a descriptive text prompt to the API, optionally including additional parameters such as aspect ratio and callback URLs, to create an image generation job.
This node is beneficial for automating creative workflows where AI-generated images are needed from textual descriptions. For example, it can be used in content creation pipelines, marketing campaigns, or any scenario requiring rapid generation of visual concepts from text prompts.
Practical examples:
- Generating concept art for a story by providing detailed scene descriptions.
- Creating unique social media visuals based on trending topics described in text.
- Automating image generation for product mockups or design inspiration.
Properties
| Name | Meaning |
|---|---|
| Prompt | Text prompt describing the image to create (3-2000 characters). |
| Additional Options | Collection of optional settings: |
| - Aspect Ratio | Sets the aspect ratio of the generated image. Options: 16:9 (Landscape), 21:9 (Widescreen), 1:1 (Square), 9:16 (Portrait), 4:3, 3:4. |
| - Reply URL | URL to receive callbacks once the job is completed. |
| - Reference ID | User-defined reference ID returned with the job response/result. |
Output
The output JSON contains the response from the Midjourney API after submitting the imagine job. It typically includes details about the created job such as job ID, status, and metadata related to the image generation request.
If the job submission is successful, the output will contain fields that allow tracking the job progress or retrieving results later. The node does not directly output binary image data but provides job information to fetch or receive the generated images asynchronously.
Dependencies
- Requires an API key credential for authenticating with the Midjourney API through UseAPI.
- The node makes HTTP requests to the UseAPI Midjourney endpoints (
https://api.useapi.net/v2/jobs/imagine). - Optional configuration may include Discord tokens and server/channel identifiers if provided in credentials or additional options, used internally for job management.
Troubleshooting
- Missing or invalid API key: Ensure the API key credential for Midjourney is correctly configured in n8n.
- Prompt length errors: The prompt must be between 3 and 2000 characters; shorter or longer prompts may cause API errors.
- Invalid aspect ratio: Only specified aspect ratios are supported; incorrect values may lead to request failures.
- Network or API errors: Check connectivity and API service status if requests fail.
- Callback URL issues: If using
Reply URL, ensure the endpoint is reachable and properly handles callbacks. - Discord-related errors: If Discord tokens or server/channel info are used, verify their correctness and permissions.
Common error messages usually come from the API response and include authentication failures, validation errors on input parameters, or rate limiting. Review the error details in the output JSON for guidance.
Links and References
- Midjourney Official Website
- UseAPI Documentation
- n8n HTTP Request Node Documentation (for understanding underlying HTTP calls)