All video generation (text-to-video, image-to-video, video-to-video, restyling, motion control) uses the Queue API. For realtime camera transformation, use the Realtime API.
Overview
The Queue API provides five methods:| Method | Description |
|---|---|
submit() | Submit a job and get a job ID immediately |
status() | Check the status of a submitted job |
result() | Download the completed video as ByteArray |
submitAndPoll() | Submit and auto-poll until completion |
submitAndObserve() | Submit and return a Flow of progress updates |
Quick Start
Submit a Job
Submit a video generation job and receive a job ID immediately:JobSubmitResponse
jobId: String- Unique job identifierstatus: 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
Download the completed video as raw bytes:ByteArray - The output video (MP4).
Submit and Poll
The easiest way to use the Queue API. Submit a job and automatically poll until completion:model(required) - Video model fromVideoModelsinput(required) - Typed input (e.g.,VideoEditInput,TextToVideoInput)onStatusChange(optional) - Callback invoked on each status change
submitAndPoll does not throw on job failure — it returns QueueJobResult.Failed. It will throw QueueSubmitException, QueueStatusException, or QueueResultException on network/API errors.Submit and Observe (Flow)
Get a reactiveFlow of progress updates, ideal for Jetpack Compose UIs:
QueueJobResult.InProgress- On each poll while pending/processingQueueJobResult.Completed- Terminal: contains the video bytesQueueJobResult.Failed- Terminal: contains the error message
Input Types
Each model category has a typed input class that enforces required fields at compile time.VideoEditInput
For video-to-video editing models:LUCY_2_V2V, LUCY_PRO_V2V, LUCY_FAST_V2V.
Text prompt describing the desired edit. Max 1000 characters. Can be empty string.
Video file to transform.
Optional reference image for style guidance.
Seed for reproducible output (0–4294967295).
Output resolution.
Whether to AI-enhance the prompt.
VideoRestyleInput
For video restyling:LUCY_RESTYLE_V2V. Must provide exactly one of prompt or referenceImage (mutually exclusive).
TextToVideoInput
For text-to-video generation:LUCY_PRO_T2V. No media file required.
ImageToVideoInput
For image-to-video animation:LUCY_PRO_I2V, LUCY_DEV_I2V.
MotionVideoInput
For trajectory-guided motion:LUCY_MOTION. Animates a detected object along a path.
frame: Int- Frame number (≥ 0)x: Float- Normalized x coordinate (0.0–1.0)y: Float- Normalized y coordinate (0.0–1.0)
Trajectory must have 2–1000 points. The object at the first point is auto-detected — no text prompt is needed.
FileInput
FileInput is a sealed class that wraps common Android file sources. All queue input types use it for file fields.
| Factory method | Source | Best for |
|---|---|---|
fromUri(uri) | Android content Uri | Gallery picker, camera capture, content providers |
fromFile(file) | java.io.File | Files on local storage |
fromBytes(bytes, mimeType) | ByteArray | In-memory data |
fromInputStream(stream, mimeType) | InputStream | Streaming from network or assets |
Error Handling
Queue methods throw typed exceptions on network/API errors:| Exception | Thrown when |
|---|---|
QueueException | Base class for all queue errors |
QueueSubmitException | Job submission fails |
QueueStatusException | Status check fails |
QueueResultException | Result download fails |
InvalidInputException | Input validation fails before submission |
statusCode: Int? for HTTP errors.
Manual Polling
For custom polling logic, combinesubmit(), status(), and result():
Supported Models
| Model | Constant | Input Type | Description |
|---|---|---|---|
| Lucy 2 V2V | VideoModels.LUCY_2_V2V | VideoEditInput | Video editing with optional reference image |
| Lucy Pro V2V | VideoModels.LUCY_PRO_V2V | VideoEditInput | Pro quality video-to-video |
| Lucy Fast V2V | VideoModels.LUCY_FAST_V2V | VideoEditInput | Fast video-to-video |
| Lucy Restyle V2V | VideoModels.LUCY_RESTYLE_V2V | VideoRestyleInput | Video restyling (prompt or reference image) |
| Lucy Pro T2V | VideoModels.LUCY_PRO_T2V | TextToVideoInput | Text-to-video generation |
| Lucy Pro I2V | VideoModels.LUCY_PRO_I2V | ImageToVideoInput | Image-to-video (Pro) |
| Lucy Dev I2V | VideoModels.LUCY_DEV_I2V | ImageToVideoInput | Image-to-video (Dev) |
| Lucy Motion | VideoModels.LUCY_MOTION | MotionVideoInput | Trajectory-guided motion video |
API Reference
client.queue.submit(model, input)
Submit a job for processing. Suspend function.
Parameters:
model: VideoModel- Video model fromVideoModelsinput: QueueJobInput- Typed input (e.g.,VideoEditInput)
JobSubmitResponse
jobId: String- Unique job identifierstatus: JobStatus- Initial status (PENDING)
InvalidInputException, QueueSubmitException
client.queue.status(jobId)
Check the status of a job. Suspend function.
Parameters:
jobId: String- Job ID fromsubmit()
JobStatusResponse
jobId: String- Job identifierstatus: JobStatus- Current status
QueueStatusException
client.queue.result(jobId)
Download the result of a completed job. Suspend function.
Parameters:
jobId: String- Job ID fromsubmit()
ByteArray - Output video bytes (MP4)
Throws: QueueResultException
client.queue.submitAndPoll(model, input, onStatusChange?)
Submit a job and auto-poll until completion. Suspend function.
Parameters:
model: VideoModel- Video modelinput: QueueJobInput- Typed inputonStatusChange: ((JobStatusResponse) -> Unit)?- Optional status callback
QueueJobResult.Completed or QueueJobResult.Failed
Throws: QueueSubmitException, QueueStatusException, QueueResultException on network errors
client.queue.submitAndObserve(model, input)
Submit a job and return a Flow of progress updates.
Parameters:
model: VideoModel- Video modelinput: QueueJobInput- Typed input
Flow<QueueJobResult> - Emits InProgress, then Completed or Failed