# Midjourney Automation (`igolaizola/midjourney-automation`) Actor

Automate Midjourney to generate AI images through API or user interface. Create multiple artworks simultaneously, manage batch processing, and auto-upscale images. Includes an image gallery for easy browsing and downloading. Perfect for streamlining your Midjourney workflow.

- **URL**: https://apify.com/igolaizola/midjourney-automation.md
- **Developed by:** [Iñigo Garcia Olaizola](https://apify.com/igolaizola) (community)
- **Categories:** AI, Automation, Developer tools
- **Stats:** 1,957 total users, 6 monthly users, 100.0% runs succeeded, 28 bookmarks
- **User rating**: 4.04 out of 5 stars

## Pricing

from $19.00 / monthly usage access

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Midjourney Automation

If you're looking to automate videos instead of images, check out the [Midjourney Video Automation](https://apify.com/igolaizola/midjourney-video-automation?fpr=ig) actor.

### 🎨 What does Midjourney Automation do?

Midjourney Automation enables you to automate image generation and upscaling on [Midjourney](https://www.midjourney.com) without manual intervention. With this actor, you can:

- 🤖 Process multiple prompts in bulk
- 🔄 Automatically upscale generated images
- 📊 Handle multiple jobs concurrently
- 🕒 Manage random wait times between operations
- 📁 Generate an album HTML for easy image browsing and downloading

### 🔑 Prerequisites

Before using this actor, you need:

1. An active Midjourney subscription
2. Your Midjourney cookies for authentication
3. The [Cookie-Editor Chrome extension](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm)

### 🚀 Setup Guide

#### Getting Your Midjourney Cookie

1. Install the Cookie-Editor Chrome extension
2. Log in to [www.midjourney.com](https://www.midjourney.com)
3. Click the **Cookie-Editor** extension in your browser.
4. Grant any required permissions
5. Click **Export** to download your cookies as a JSON file.
6. Copy the JSON content and provide it in the `cookies` field when running the scraper.

#### Running the Actor

1. Paste your cookies JSON into the actor's `cookies` input field
2. Enter your desired prompts
3. Configure generation options
4. Select a proxy from your country (recommended)
5. Run the actor

### ⚙️ Input Parameters

| Parameter     | Type    | Description                                                                                                                                                       | Default   |
| ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| `cookies`     | JSON    | Your Midjourney authentication cookies obtained from the Cookie-Editor extension (required)                                                                       | -         |
| `prompts`     | Array   | List of prompts to generate images                                                                                                                                | -         |
| `mode`        | Select  | Generation mode: "relaxed" (queued, no GPU time cost, only available for "Standard Plan" or higher), "fast" (standard speed), or "turbo" (4x faster, 2x GPU cost) | "relaxed" |
| `upscale`     | Select  | Upscaling mode: none, "subtle", or "creative"                                                                                                                     | none      |
| `privacy`     | Boolean | Enable privacy mode (only available for "Pro Plan" or higher)                                                                                                     | false     |
| `concurrency` | Integer | Number of concurrent jobs                                                                                                                                         | 1         |
| `minWait`     | Integer | Minimum wait time between operations (seconds)                                                                                                                    | 5         |
| `maxWait`     | Integer | Maximum wait time between operations (seconds)                                                                                                                    | 10        |
| `jobTimeout`  | Integer | Maximum time to wait for job completion (seconds)                                                                                                                 | 300       |

### 📋 Output Format

The actor provides results in a structured format:

```json
[
  {
    "album_url": "https://api.apify.com/v2/key-value-stores/1Ht4z6r0m1OfBqZs1/records/album.html#619775b2-1f53-409e-ad1d-5a8336b138b8_0",
    "prompt": "Modern residential houses in nature, minimalist and elegant architecture, large glass facades, surrounded by trees, mountains, or lakes, with sunlight streaming through --v 6.1",
    "url": "https://cdn.midjourney.com/619775b2-1f53-409e-ad1d-5a8336b138b8/0_0.png",
    "index": 3,
    "upscaled": true,
    "job_id": "619775b2-1f53-409e-ad1d-5a8336b138b8",
    "parent_job_id": "04bbf91d-1afa-480c-853f-b6f8c95b24b9"
  }
]
```

### 📸 Accessing Generated Images

The actor saves an "album.html" file to the KeyValue store for easy browsing and downloading of generated images. You can access it by:

- Clicking any "Album URL" field in the results table
- Going to Run > Storage > KeyValueStore and finding the "album.html" file

The album interface provides several features:

- Filter images by prompt text or other metadata
- Select multiple images for batch operations
- Open images in new tabs for detailed viewing
- Download selected images as a ZIP file

Here's an example album showcasing some generated images so you can see how your results will be displayed: [Browse Example Gallery](https://igolaizola.github.io/midjourney-automation/)

### ⚠️ Usage Guidelines and Best Practices

#### Account Safety

- Automation of Midjourney accounts can result in termination
- Only use for batch jobs you would normally do manually
- Avoid running the automation 24/7
- Follow Midjourney's terms of service

#### Performance Optimization

- Start with 1-2 concurrent jobs and adjust based on results
- Use proxies from your region for better reliability
- Set job timeouts appropriate for your chosen generation mode
- Regular cookies updates may be required for long sessions

#### General Tips

- Test your setup with a small batch of prompts first
- Use descriptive prompts for better organization
- Monitor success rates and adjust settings as needed
- Failed jobs are logged but won't stop the entire process
- Privacy mode affects image visibility in your Midjourney profile

### 💳 How much will it cost to use Midjourney Automation?

Apify provides you with $5 free usage credits every month on the [Apify Free plan](https://apify.com/pricing). You can try and test Midjourney Automation for free with the Free plan for a limited time.

However, if you plan to use it regularly, you should get an Apify subscription. We recommend our [$49/month Personal plan](https://apify.com/pricing) - this plan covers the costs of Midjourney Automation and numerous executions.

# Actor input Schema

## `cookies` (type: `array`):

Cookies from Export JSON in Cookie-Editor extension

## `prompts` (type: `array`):

List of prompts to generate images

## `mode` (type: `string`):

Mode to generate images. (Relaxed mode is only available for 'Standard Plan' or higher subscriptions)

## `upscale` (type: `string`):

Upscale images

## `privacy` (type: `boolean`):

Enable privacy mode (only available for 'Pro Plan' or higher subscriptions)

## `concurrency` (type: `integer`):

Number of concurrent jobs

## `minWait` (type: `integer`):

Minimum wait time in seconds. Wait time will be randomly selected between minimum and maximum wait time.

## `maxWait` (type: `integer`):

Maximum wait time in seconds. Wait time will be randomly selected between minimum and maximum wait time.

## `jobTimeout` (type: `integer`):

Job timeout in seconds. If the job takes longer than the timeout, it will be skipped.

## `proxyConfiguration` (type: `object`):

Select proxies to be used.

## Actor input object example

```json
{
  "cookies": [
    "put-your-cookies-here"
  ],
  "mode": "relaxed",
  "upscale": "",
  "privacy": false,
  "concurrency": 1,
  "minWait": 5,
  "maxWait": 10,
  "jobTimeout": 300,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "cookies": [
        "put-your-cookies-here"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("igolaizola/midjourney-automation").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "cookies": ["put-your-cookies-here"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("igolaizola/midjourney-automation").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "cookies": [
    "put-your-cookies-here"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call igolaizola/midjourney-automation --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,igolaizola/midjourney-automation"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/f4yS7kCREzhhPpp0K/builds/wgU2fYjt6EIRGjHQA/openapi.json
