All video generation (text-to-video, image-to-video, video-to-video, motion control) uses the Queue API. For image generation, use the Process API.
Overview
The Queue API provides four main methods:submit()- Submit a job and get a job ID immediatelystatus()- Check the status of a submitted jobresult()- Retrieve the completed videosubmitAndPoll()- Submit and automatically poll until completion
Submit a Job
Submit a video generation job and receive a job ID immediately:job_id- Unique identifier for the jobstatus- Initial status ("pending")
Check Job Status
Poll the status of a submitted job:| Status | Description |
|---|---|
pending | Job is queued, waiting to be processed |
processing | Job is currently being processed |
completed | Job finished successfully |
failed | Job failed or timed out (timeout after 10 minutes) |
Get Job Result
Retrieve the video once the job is completed:status- Either"completed"or"failed"data- Video Blob (when completed)error- Error message (when failed)
Submit and Poll
The easiest way to use the Queue API - submit a job and automatically poll until completion:- All standard model parameters (prompt, resolution, etc.)
onStatusChange(optional) - Callback function called on each status change
TypeScript Types
Complete Example
Node.js
Image Animation with Queue
Animate images using the queue for better control:Video Editing with Queue
Transform videos with style transfer:Cancellation with AbortSignal
Cancel queue operations using AbortController:Manual Polling
For custom polling logic, you can manually poll for status:Error Handling
Supported Models
All non-realtime video models support queue processing:| Model | Type | Description |
|---|---|---|
lucy-pro-t2v | Text-to-Video | Generate videos from text prompts |
lucy-pro-i2v | Image-to-Video | Animate images |
lucy-dev-i2v | Image-to-Video | Development model for animation |
lucy-pro-v2v | Video-to-Video | Transform video style |
lucy-fast-v2v | Video-to-Video | Fast video transformation |
API Reference
client.queue.submit(options)
Submit a job for processing.
Parameters:
options: QueueSubmitOptions- Model and input parametersmodel- Model frommodels.video()signal?: AbortSignal- Optional abort signal- Additional model-specific parameters
Promise<JobSubmitResponse>
job_id: string- Unique job identifierstatus: JobStatus- Initial status (“pending”)
client.queue.status(jobId)
Check the status of a job.
Parameters:
jobId: string- The job identifier
Promise<JobStatusResponse>
job_id: string- Job identifierstatus: JobStatus- Current status
client.queue.result(jobId)
Get the result of a completed job.
Parameters:
jobId: string- The job identifier
Promise<QueueJobResult>
- When completed:
{ status: "completed", data: Blob } - When failed:
{ status: "failed", error: string }
client.queue.submitAndPoll(options)
Submit a job and poll until completion.
Parameters:
options: QueueSubmitAndPollOptions- Model and input parametersonStatusChange?: (job: JobStatusResponse) => void- Status change callbacksignal?: AbortSignal- Optional abort signal- Additional model-specific parameters
Promise<QueueJobResult>