Skip to main content

generateVideo()

Generate a video from text prompt with optional image URL.
Generate from Image URL in Prompt:
Generate from Image Animation (using job_id and image_no):
Parameters: Text-only generation:
  • prompt (string): Video prompt (1-8192 characters)
  • video_type (int, optional): Quality (0=480p, 1=720p)
  • callback (string, optional): Webhook URL
Image URL in prompt:
  • prompt (string): “[image_url] prompt text” format (1-8192 characters)
  • video_type (int, optional): Quality (0=480p, 1=720p)
  • callback (string, optional): Webhook URL
Image animation:
  • job_id (string): Previous image generation job ID
  • image_no (int): Image index to animate (0-3)
  • prompt (string, optional): Animation prompt (1-8192 characters)
  • video_type (int, optional): Quality (0=480p, 1=720p)
  • callback (string, optional): Webhook URL
Returns: Response with job_id and status

extendVideo()

Extend an existing video.
Parameters:
  • job_id (string): Original video task ID
  • video_no (int): Video index (0-3)
  • prompt (string, optional): Extension prompt (1-8192 characters)
  • callback (string, optional): Webhook URL
Returns: Response with job_id and status

upscaleVideo()

Upscale video to higher resolution.
Parameters:
  • job_id (string): Original video task ID
  • video_no (int): Video index (0-3)
  • callback (string, optional): Webhook URL
Returns: Response with job_id and status

Complete Example


Error Handling


Retry Logic


Asynchronous Processing with Promises

For modern PHP with async support (using ReactPHP or Amp):

Processing Multiple Videos


Next Steps