The Queue API is the primary way to process videos with the Swift SDK. Submit jobs that are processed asynchronously in the background, then poll for status and retrieve results when complete.Documentation Index
Fetch the complete documentation index at: https://docs.platform.decart.ai/llms.txt
Use this file to discover all available pages before exploring further.
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:
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_2:
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.Manual Polling
For custom polling logic, usesubmit(), status(), and result() separately:
Error Handling
Supported Models
All video models support queue processing:| Model | Type | Description |
|---|---|---|
lucy2_1 | Video-to-Video | Video editing (latest) |
lucy2_1_vton | Video-to-Video | Virtual try-on |
lucyRestyle2 | Video-to-Video | Video restyling with prompt or reference image |
lucyMotion | Image-to-Video | Trajectory-based motion control |
Previous generation models
Previous generation models
| Model | Type | Description |
|---|---|---|
lucy_clip | 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, orVideoToVideoInput)
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