POST
/
video
/
text2video
Generate video from text prompt
curl --request POST \
  --url https://modelslab.com/api/v6/video/text2video \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "model_id": "cogvideox",
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "seed": 123,
  "height": 512,
  "width": 512,
  "num_frames": 25,
  "num_inference_steps": 20,
  "guidance_scale": 7,
  "clip_skip": 1,
  "upscale_height": 640,
  "upscale_width": 1024,
  "upscale_strength": 0.6,
  "upscale_guidance_scale": 12,
  "upscale_num_inference_steps": 20,
  "use_improved_sampling": false,
  "improved_sampling_seed": 123,
  "fps": 15,
  "output_type": "gif",
  "instant_response": false,
  "temp": false,
  "webhook": "<string>",
  "track_id": "<string>"
}'
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "future_links": [
    "<string>"
  ],
  "meta": {},
  "eta": 123,
  "message": "<string>",
  "tip": "<string>",
  "fetch_result": "<string>"
}

Text to Video

Text to Video Example

Request

Make a POST request to below endpoint and pass the required parameters in the request body.
curl
--request POST 'https://modelslab.com/api/v6/video/text2video' \

Body

json
{
    "key": "your_api_key",
    "model_id": "cogvideox",
    "prompt": "Space Station in space",
    "negative_prompt": "low quality",
    "height": 512,
    "width": 512,
    "num_frames": 25,
    "num_inference_steps": 20,
    "guidance_scale": 7,
    "upscale_height": 640,
    "upscale_width": 1024,
    "upscale_strength": 0.6,
    "upscale_guidance_scale": 12,
    "upscale_num_inference_steps": 20,
    "output_type": "gif",
    "webhook": null,
    "track_id": null
}

Body

application/json

Response

Video generation response

The response is of type object.