All video processing (video editing, restyling, motion control) uses the Queue API. For image editing, use the Process API.
Overview
The Queue API is accessed viaclient.queue and 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 editing job and receive a job ID immediately:jobId- 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 |
Get Job Result
Retrieve the video data once the job is completed:Data — the raw video bytes
Submit and Poll
The easiest way to use the Queue API — submit a job and automatically poll until completion:model(required) - Video model fromModels.video()input(required) - Typed input for the modelonStatusChange(optional) - Closure called on each status change
QueueJobResult
.completed(jobId: String, data: Data)- Video data on success.failed(jobId: String, error: String)- Error message on failure
Video Editing
Transform videos with prompt and optional reference image usinglucy_2_v2v:
VideoEditInput parameters:
prompt(required) - Text description of the transformationdata(required) - Input video asFileInputreferenceImage(optional) - Reference image asFileInputseed(optional) - Random seed for reproducible resultsresolution(optional) - Output resolution (.res720por.res480p)enhancePrompt(optional) - Auto-enhance the prompt
Video Restyling
Restyle videos using either a text prompt or a reference image (but not both) withlucy_restyle_v2v:
VideoRestyleInput parameters:
prompt(optional) - Text description of style (required if noreferenceImage)data(required) - Input video asFileInputreferenceImage(optional) - Reference image (required if noprompt)seed(optional) - Random seedresolution(optional) - Output resolutionenhancePrompt(optional) - Auto-enhance the prompt
You must provide either
prompt or referenceImage, but not both. The SDK validates this at initialization.Motion Video
Generate motion-controlled video from a still image and trajectory points usinglucy_motion:
MotionVideoInput parameters:
data(required) - Input image asFileInputtrajectory(required) - Array of 2–1000TrajectoryPointvaluesseed(optional) - Random seedresolution(optional) - Output resolution
TrajectoryPoint parameters:
frame(required) - Frame number (≥ 0)x(required) - Normalized x coordinate (0.0–1.0)y(required) - Normalized y coordinate (0.0–1.0)
Manual Polling
For custom polling logic, usesubmit(), status(), and result() separately:
Error Handling
Supported Models
All video models support queue processing:| Model | Type | Description |
|---|---|---|
lucy_2_v2v | Video-to-Video | Video editing with prompt and optional reference image |
lucy_restyle_v2v | Video-to-Video | Video restyling with prompt or reference image |
lucy_motion | Image-to-Video | Trajectory-based motion control |
Previous generation models
Previous generation models
| Model | Type | Description |
|---|---|---|
lucy_pro_v2v | Video-to-Video | Transform video style |
API Reference
client.queue.submit(model:input:)
Submit a job for processing.
Parameters:
model: VideoModel- Video modelinput- Typed input (VideoEditInput,VideoRestyleInput,VideoToVideoInput, orMotionVideoInput)
JobSubmitResponse
jobId: String- Unique job identifierstatus: JobStatus- Initial status (.pending)
client.queue.status(jobId:)
Check the status of a job.
Parameters:
jobId: String- The job identifier
JobStatusResponse
jobId: String- Job identifierstatus: JobStatus- Current status
client.queue.result(jobId:)
Get the result of a completed job.
Parameters:
jobId: String- The job identifier
Data - Video bytes
client.queue.submitAndPoll(model:input:onStatusChange:)
Submit a job and poll until completion.
Parameters:
model: VideoModel- Video modelinput- Typed inputonStatusChange: ((JobStatusResponse) -> Void)?- Optional status callback
QueueJobResult
Next Steps
Process API
Synchronous image editing
Realtime API
Transform video streams in realtime with WebRTC