PiAPI Midjourney icon

PiAPI Midjourney

Generate and manipulate images using PiAPI Midjourney

Overview

The node "PiAPI Midjourney" enables users to generate and manipulate images using the PiAPI Midjourney service. It supports three main operations:

  • Imagine: Generate four images based on a text prompt.
  • Upscale: Enhance the resolution of a selected image from a previous Imagine operation.
  • Describe: Generate descriptive prompt suggestions based on an input image.

This node is useful for creative workflows involving AI-generated imagery, such as content creation, design brainstorming, or automated image enhancement. For example, a user can input a textual description to generate concept art, upscale a chosen image for higher quality, or obtain descriptive prompts from an existing image to inspire further creations.

Properties

Name Meaning
Prompt Text prompt used to generate images (required for Imagine operation).
Aspect Ratio Aspect ratio of generated images; options: Square (1:1), Portrait (9:16), Landscape (16:9), Ultra Landscape (21:9).
Process Mode Processing speed priority; options: Relax (lower priority, cheaper), Fast (standard), Turbo (higher priority, more expensive). Applies to Imagine and Describe operations.
Skip Prompt Check Boolean flag to skip content filtering on prompts (Imagine only).
Origin Task ID Task ID of the original Imagine operation (required for Upscale).
Image Index Which image to upscale from the original grid (1 to 4) (required for Upscale).
Image Input Method Method to input image data for Describe operation; options: URL or Binary Data.
Binary Property Name of the binary property containing image data (required if Image Input Method is Binary Data for Describe).
Image URL URL of the image to describe (required if Image Input Method is URL for Describe).
Advanced Options Collection of additional options:
- Service Mode: Public (Pay-As-You-Go) or Private (Host-Your-Account).
- Bot ID: Specify which Midjourney account will process the task (Describe only, Host-Your-Account Pro Plan).
Wait For Completion Whether to wait for the operation to complete before continuing (boolean).
Max Retries Maximum number of retries to check task status (only shown if Wait For Completion is true).
Retry Interval Interval between retries in milliseconds (only shown if Wait For Completion is true).

Output

The node outputs JSON data with the following structure:

  • task_id: The unique identifier of the created task.
  • status: Current status of the task (e.g., "pending", "completed").
  • Additional fields may be present depending on the API response.

If "Wait For Completion" is enabled, the node waits and polls the task status until completion or max retries are reached, then outputs the final task status.

The node does not output binary data directly but works with image URLs or base64-encoded images internally when describing images.

Dependencies

  • Requires an API key credential for the PiAPI Midjourney service.
  • Uses the PiAPI endpoint /api/v1/task to submit tasks.
  • Supports different service modes that may affect billing or account usage.
  • No other external dependencies are required.

Troubleshooting

  • Common Issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Providing non-image binary data for the Describe operation will throw an error.
    • Failure to receive a valid task ID from the API indicates an issue with the request or service availability.
    • If waiting for completion, network issues or long processing times may cause timeouts or max retry errors.
  • Error Messages:

    • "The provided binary data is not an image": Occurs if binary input for Describe is not an image MIME type. Ensure correct binary property and valid image data.
    • "Failed to get a valid task ID from the API": Indicates the API did not return a task ID. Verify request parameters and API status.
    • Network or API errors will propagate unless "Continue On Fail" is enabled, in which case errors are returned in the output JSON.

Links and References

Discussion