Skip to main content
POST
/
v1
/
variation
Create Image Variation
curl --request POST \
  --url https://api.legnext.ai/api/v1/variation \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "imageNo": 0,
  "type": 0,
  "remixPrompt": "<string>",
  "callback": "<string>"
}
'
Generate variations of existing images with controllable transformation intensity while maintaining the original composition structure.

Endpoint

POST https://api.legnext.ai/api/v1/variation

Headers

HeaderTypeRequiredDescription
x-api-keystringYesYour API key

Request Body

ParameterTypeRequiredDescription
jobIdstringYesID of the original image generation task
imageNointegerYesImage number to vary (0/1/2/3)
typeintegerYesVariation intensity type (0 or 1)
remixPromptstringNoAdditional prompt for guided variation (1-8192 characters)
callbackstringNoCallback URL for task completion notifications

Variation Types

TypeNameDescription
0SubtleMinor changes while preserving most original elements
1StrongMore dramatic variations with significant changes

Example Requests

Subtle Variation

curl -X POST "https://api.legnext.ai/api/v1/variation" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jobId": "5dd94ec3-7282-4f04-9445-59e850ef1822",
    "imageNo": 0,
    "type": 0,
    "callback": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d"
  }'

Response

Returns a task object containing the task information.
{
    "job_id": "340721c6-86eb-4620-ba38-8df46fb507b6",
    "model": "midjourney",
    "task_type": "variation",
    "status": "completed",
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "secret": ""
        }
    },
    "input": null,
    "output": {
        "image_url": "https://cdn.legnext.ai/temp/1760409500232.png",
        "image_urls": [
            "https://cdn.legnext.ai/mj/340721c6-86eb-4620-ba38-8df46fb507b6_0.png",
            "https://cdn.legnext.ai/mj/340721c6-86eb-4620-ba38-8df46fb507b6_1.png",
            "https://cdn.legnext.ai/mj/340721c6-86eb-4620-ba38-8df46fb507b6_2.png",
            "https://cdn.legnext.ai/mj/340721c6-86eb-4620-ba38-8df46fb507b6_3.png"
        ],
        "seed": "3546238130",
        "available_actions": {
            "edit": [
                0,
                1,
                2,
                3
            ],
            "inpaint": [
                0,
                1,
                2,
                3
            ],
            "outpaint": [
                0,
                1,
                2,
                3
            ],
            "pan": [
                0,
                1,
                2,
                3
            ],
            "remix": [
                0,
                1,
                2,
                3
            ],
            "reroll": true,
            "upscale": [
                0,
                1,
                2,
                3
            ],
            "variation": [
                0,
                1,
                2,
                3
            ]
        }
    },
    "meta": {
        "created_at": "2025-10-14T02:36:32Z",
        "started_at": "2025-10-14T02:36:32Z",
        "ended_at": "2025-10-14T02:38:34Z",
        "usage": {
            "type": "point",
            "frozen": 120,
            "consume": 120
        }
    },
    "detail": null,
    "logs": [],
    "error": {
        "code": 0,
        "raw_message": "",
        "message": "",
        "detail": null
    }
}

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json
jobId
string<uuid>
required

ID of the original image generation task

imageNo
integer
required

Image number to vary (0, 1, 2, or 3)

Required range: 0 <= x <= 3
Example:

0

type
enum<integer>
required

Variation intensity (0=Subtle, 1=Strong)

Available options:
0,
1
remixPrompt
string | null

Optional additional prompt for guided variation

Required string length: 1 - 8192
callback
string<uri>

Callback URL for task completion notifications

Response

200

Variation task created successfully