Method Signature
Parameters
Configuration object for job submission and polling
The video model definition to use. Access models via
models.video().Supported models:lucy-dev-i2v- image-to-video (Dev quality)lucy-fast-v2v- video-to-video (Fast quality)lucy-pro-t2v- text-to-video (Pro quality)lucy-pro-i2v- image-to-video (Pro quality)lucy-pro-v2v- video-to-video (Pro quality)lucy-pro-flf2v- first-last-frame-to-video (Pro quality)lucy-motion- motion-based image-to-videolucy-restyle-v2v- video restyling
Text prompt for generation (required for text-to-video models)
Input file (image or video). Accepts:
FileobjectBlobobjectReadableStream- URL string
URLobject
Start frame image for first-last-frame models (
lucy-pro-flf2v)End frame image for first-last-frame models (
lucy-pro-flf2v)Reference image for style or appearance guidance (model-specific)
Callback invoked when job status changes during polling. Receives the full job status response object with
job_id and status fields.Optional
AbortSignal for canceling the request and pollingReturns
Promise that resolves with a discriminated union based on job outcome
Completed Job
Job completed successfully
Unique identifier for the job
The generated video as a Blob. Can be used with
URL.createObjectURL() for playback.Failed Job
Job failed during processing
Unique identifier for the job
Error message describing why the job failed
Examples
Basic Usage
With Status Updates
Image-to-Video
Video-to-Video
With Cancellation
Discriminated Union Pattern
Error Handling
Notes
- This method does not throw when a job fails during processing. Instead, it returns a result object with
status: "failed"and anerrorfield. - Exceptions are only thrown for network errors, invalid inputs, or when the request is aborted.
- The
onStatusChangecallback is invoked immediately after submission with the initial status, and then periodically during polling. - Polling continues until the job reaches
"completed"or"failed"status. - Only video models support the queue API. For image models, use
client.process.generate(). - For more control over polling, use
client.queue.submit()followed by manual status checks.