PiAPI Midjourney icon

PiAPI Midjourney

Generate and manipulate images using PiAPI Midjourney

Overview

The node "PiAPI Midjourney" enables image generation and manipulation using the PiAPI Midjourney service. It supports three main operations:

  • Imagine: Generate four images from 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 inspiration, 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 analyze an existing image to get related prompt ideas.

Properties

Name Meaning
Operation The action to perform: "Imagine" (generate images from text), "Upscale" (enhance an existing image), or "Describe" (generate prompts from an image).
Process Mode Processing speed priority with options: "Relax" (lower priority, cheaper), "Fast" (standard speed), "Turbo" (higher priority, more expensive). Applies to Imagine and Describe operations.
Image Input Method How to provide the image for the Describe operation: either by "URL" or by "Binary Data".
Binary Property (For Describe with Binary Data) The name of the binary property containing the image data. Default is "data".
Image URL (For Describe with URL) The URL of the image to describe.
Advanced Options Additional settings including:
- Service Mode: "Public (PAYG)" or "Private (HYA)" processing modes.
- Bot ID: Specify which Midjourney account will process the task (for Private mode, Pro Plan only).
Wait For Completion Whether to wait for the operation to complete before continuing the workflow. If true, the node polls the task status until completion or max retries are reached.
Max Retries Maximum number of times to retry checking the task status when waiting for completion. Only shown if "Wait For Completion" is true.
Retry Interval Time interval in milliseconds between retries when waiting for completion. Only shown if "Wait For Completion" is true.

Additional properties specific to each operation:

  • Imagine:

    • Prompt: Text prompt to generate images.
    • Aspect Ratio: Aspect ratio of generated images ("1:1", "9:16", "16:9", "21:9").
    • Skip Prompt Check: Whether to skip content filtering on prompts.
  • Upscale:

    • Origin Task ID: Task ID of the original Imagine operation.
    • Image Index: Which image (1-4) from the original grid to upscale.

Output

The node outputs JSON objects representing the task status and results from the PiAPI Midjourney service. The key fields include:

  • task_id: Unique identifier of the created task.
  • status: Current status of the task (e.g., "pending", "completed").
  • When waiting for completion, the output includes the final task result once done.

If the node is configured to wait for completion, it polls the API until the task finishes or the maximum retries are reached, then returns the completed task data.

The node does not directly output binary image data but provides task metadata and URLs to generated or processed images via the API response.

Dependencies

  • Requires an API key credential for the PiAPI Midjourney service.
  • Uses internal helper functions to make authenticated HTTP requests to the PiAPI endpoints.
  • No additional external dependencies beyond the configured API credential.

Troubleshooting

  • Invalid Task ID Error: If the node fails to retrieve a valid task ID from the API response, ensure that the API credentials are correct and the request parameters are valid.
  • Binary Data Not an Image: When using binary data input for the Describe operation, the node checks the MIME type. If the data is not an image, it throws an error. Make sure the binary input contains valid image data.
  • Timeout Waiting for Completion: If "Wait For Completion" is enabled but the task does not complete within the max retries, consider increasing the retry count or interval.
  • API Request Failures: Network issues or invalid credentials may cause request failures. Verify connectivity and credential validity.
  • Unsupported Aspect Ratios or Parameters: Using unsupported values for properties like aspect ratio or process mode may cause errors. Use only the provided options.

Links and References

Discussion