Remix Prompt in Midjourney API
Tags: midjounrey, api, chatgpt, python
Published: 2023-09-27 11:57:31

This article is about the unique value of the Remix feature in Midjourney. It will guide you on obtaining precise control over image variations using the Remix Prompt in [Midjourney API](https://www.goapi.ai/midjourney-api) by [GoAPI](https://www.goapi.ai/).

## What's Midjourney's Remix Mode

Midjourney's Remix Mode offers users a unique way to alter prompts, parameters, model versions, or aspect ratios between variations. It takes the general composition of your starting image and uses it as part of a new task. This blending can assist in changing the setting or lighting of an image, evolving a subject, or achieving intricate compositions.

## What's [Midjourney API](https://www.goapi.ai/midjourney-api) by [GoAPI](https://www.goapi.ai/)?

The [Midjourney API](https://www.goapi.ai/midjourney-api), brought to you by the GoAPI team, stands as the world's only API boasting the Remix Prompt parameter input capability. This means that, with the [Midjourney API](https://www.goapi.ai/midjourney-api) provided by the GoAPI team, developers can offer their users an experience identical to the native Midjourney product.

The operations that support remix prompts in Midjourney API by GoAPI:
Variation (V1 / V2 / V3 / V4)
Vary (Strong / Subtle / Region)
Pan (All directions)
Zoomout (1.5x / 2x / Custom / MakeSquare)

## How to Use the Remix Prompt with the Midjourney API (Sample code in Python)
![flow](https://static.wixstatic.com/media/d09a41_f077e2ff342f44b5be5fd883f7007b66~mv2.png/v1/fill/w_295,h_1099,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/d09a41_f077e2ff342f44b5be5fd883f7007b66~mv2.png)

### 1. Invoke the /imagine endpoint to generate the original quad-image.
```python
import requests

X_API_KEY = "YOUR_API_KEY"

endpoint = "https://api.midjourneyapi.xyz/mj/v2/imagine"

headers = {
         "X-API-KEY": X_API_KEY
}
data = {
          "prompt": "a cute cat",
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
```
### 2. Get the response of the imagine endpoint, you will find the task_id
```json
{
    "task_id": "807400b9-9d79-465b-8ecc-eecb7419dbbc",
    "status": "success",
    "message": ""
}
```

### 3. Loop the fetch endpoint, to know if the imagine task was success
```python
import requests

endpoint = "https://api.midjourneyapi.xyz/mj/v2/fetch"

data = {
    "task_id": "c0295660-4710-4b09-8fc4-73ed09b114ec"
} 

response = requests.post(endpoint, json=data)

print(response.status_code)
print(response.json())
```

### 4. Use the variation endpoint, directing the parent task for specific modifications, and input the desired prompt in the parameters (the Remix Prompt)
```python
import requests

X_API_KEY = "YOUR_API_KEY" 

endpoint = "https://api.midjourneyapi.xyz/mj/v2/variation"

headers = {
    "X-API-KEY": X_API_KEY
}

data = {
    "origin_task_id": "45ffd445-28cf-45fc-9ac5-7ee5d426c901",
    "index": "1",
    "prompt": "a cute cat with a hat",
    "aspect_ratio": "3:4"
    "webhook_endpoint": "",
    "webhook_secret": ""
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())
```

5. Pan, Zoom, Vary follows a similar process as above.

## Conclusion

Midjourney with its Remix Prompt feature, sets a new benchmark for the future of image variations. It isn't just an software; it's a canvas for boundless imagination. You can now automate the whole process using [Midjourney API](https://www.goapi.ai/midjourney-api) provided by [GoAPI](https://www.goapi.ai/). 

Whether you're a developer, a digital marketer, or a business owner, the time to delve into the [Midjourney API](https://www.goapi.ai/midjourney-api) is now.

Embrace the future of image variation and let your visual content radiate unparalleled brilliance.