Skip to main content
POST
/
v1
/
video-diffusion
Video Diffusion
curl --request POST \
  --url https://api.legnext.ai/api/v1/video-diffusion \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "imageNo": 1,
  "prompt": "<string>",
  "videoType": 0,
  "callback": "<string>"
}
'
Generate high-quality videos from text descriptions or existing images using the Legnext AI video generation capabilities.

Endpoint

POST https://api.legnext.ai/api/v1/video-diffusion

Headers

HeaderTypeRequiredDescription
x-api-keystringYesYour API key

Request Body

Image-to-Video Mode

Choose one of two input methods: Option 1: Using existing generated image
ParameterTypeRequiredDescription
jobIdstringYesID of the source image generation task
imageNointegerYesImage number to animate (0/1/2/3)
promptstringNoVideo generation prompt text (1-8192 characters)
videoTypeintegerNoVideo quality type (0: 480p, 1: 720p)
callbackstringNoCallback URL for task completion notifications
Option 2: Using prompt with image URL
ParameterTypeRequiredDescription
promptstringYesVideo generation prompt text with image URL included, format: “[image_url] your prompt text” (1-8192 characters)
videoTypeintegerNoVideo quality type (0: 480p, 1: 720p)
callbackstringNoCallback URL for task completion notifications

Video Types

ValueResolutionDescription
0480pStandard definition (default)
1720pHigh definition

Advanced Parameters

You can add these parameters to your prompt for more control over video generation:

Motion Intensity

Control the amount of movement in the generated video:
  • Low Motion (default): Static scenes with subtle movements
    • Add --motion low to your prompt
  • High Motion: Large camera movements and dramatic motion (may produce artistic effects)
    • Add --motion high to your prompt
Example:
"https://example.com/image.jpg A cinematic landscape --motion high"

Raw Mode

Reduce automatic system enhancements for more precise control over the output:
  • Add --raw to your prompt
Example:
"https://example.com/image.jpg A peaceful sunset scene --raw"

End Frame Image

Specify the final frame of your video by providing an image URL:
  • Add --end [image_url] to your prompt
Example:
"https://example.com/start.jpg A transformation sequence --end https://example.com/end.jpg"

Video Loop

Generate a video where the last frame matches the first frame, creating a seamless loop:
  • Add --loop to your prompt
Example:
"https://example.com/image.jpg Rotating product display --loop"

Batch Size

Control the number of videos generated in a single task. This affects the cost accordingly:
  • Add --bs [1|2|4] to your prompt
  • Valid values: 1, 2, or 4
  • Default: 4
Example:
"https://example.com/image.jpg A dynamic animation --bs 2"

Combining Parameters

You can combine multiple parameters in a single prompt: Example:
"https://example.com/image.jpg Epic camera movement through the scene --motion high --raw --loop --bs 1"

Example Requests

Image-to-Video (Using existing image)

curl -X POST "https://api.legnext.ai/api/v1/video-diffusion" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jobId": "c6821434-5e41-408f-b42b-2562306b109c",
    "imageNo": 0,
    "prompt": "Make this image move with gentle animation",
    "callback": "https://webhook.site/c98cb890-fb92-439f-8d60-42c8a51eb52d",
    "videoType": 0
  }'

Image-to-Video (Using image URL)

curl -X POST "https://api.legnext.ai/api/v1/video-diffusion" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "https://example.com/image.jpg A cinematic shot of ocean waves crashing against rocks",
    "videoType": 1,
    "callback": "https://webhook.site/d0ca59bc-35a6-4a1e-b1b1-aea7faeb7f67"
  }'

Response

Returns a task object containing the task information.
{
    "job_id": "d55cb628-3f71-4be8-bea1-4e01319b6589",
    "model": "midjourney",
    "task_type": "video_diffusion",
    "status": "completed",
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "secret": ""
        }
    },
    "input": null,
    "output": {
        "video_urls": [
            "https://cdn.legnext.ai/temp/1760422803195.mp4",
            "https://cdn.legnext.ai/temp/1760422805847.mp4",
            "https://cdn.legnext.ai/temp/1760422807148.mp4",
            "https://cdn.legnext.ai/temp/1760422808471.mp4"
        ],
        "seed": "1422921276",
        "available_actions": {
            "extend": [
                0,
                1,
                2,
                3
            ],
            "upscale": [
                0,
                1,
                2,
                3
            ]
        }
    },
    "meta": {
        "created_at": "2025-10-14T06:18:09Z",
        "started_at": "2025-10-14T06:18:10Z",
        "ended_at": "2025-10-14T06:20:10Z",
        "usage": {
            "type": "point",
            "frozen": 480,
            "consume": 480
        }
    },
    "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
  • Option 1
  • Option 2
jobId
string<uuid>
required

ID of the source image generation task (for existing image mode)

imageNo
integer
required

Image number to animate (0/1/2/3) (for existing image mode)

Required range: 0 <= x <= 3
prompt
string

Video generation prompt text (required for prompt mode, optional for existing image mode)

Required string length: 1 - 8192
videoType
integer

Video quality type (0=480p, 1=720p)

Required range: 0 <= x <= 1
callback
string<uri>

Callback URL for task completion notifications

Response

200

Video generation task created successfully