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 videosubmit_and_poll()- 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 bytes (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.)
on_status_change(optional) - Callback function called on each status change
Complete Example
Image Animation with Queue
Animate images using the queue for better control:Video Editing with Queue
Transform videos with style transfer: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: dict- Model and input parameters
JobSubmitResponse
job_id: str- Unique job identifierstatus: str- Initial status (“pending”)
client.queue.status(job_id)
Check the status of a job.
Parameters:
job_id: str- The job identifier
JobStatusResponse
job_id: str- Job identifierstatus: str- Current status
client.queue.result(job_id)
Get the result of a completed job.
Parameters:
job_id: str- The job identifier
QueueJobResult
status: str- “completed” or “failed”data: bytes- Video data (when completed)error: str- Error message (when failed)
client.queue.submit_and_poll(options)
Submit a job and poll until completion.
Parameters:
options: dict- Model and input parameterson_status_change: Callable(optional) - Status change callback
QueueJobResult