For video processing (video editing, motion control), use the Queue API which provides asynchronous job-based processing.
Image
Image Editing
Transform and restyle existing images:prompt(required) - Text description of the style transformationdata(required) - Input image (File, Blob, URL, or ReadableStream)reference_image(optional) - Reference image to guide the edit (File, Blob, URL, or ReadableStream)seed(optional) - Random seed for reproducible resultsresolution(optional) - Output resolutionenhance_prompt(optional) - Auto-enhance the prompt for better results
lucy-image-2
Input Types
Thedata, reference_image, start, and end parameters accept flexible input types:
Cancellation
Cancel long-running operations using AbortController:Error Handling
The SDK throws specific errors for different failure scenarios:API Reference
client.process(options)
Generate or transform images.
Parameters:
options- Configuration object with model and inputs:model- Model frommodels.image()signal?- Optional AbortSignal for cancellation- Additional fields depend on the model (see below)
Promise<Blob> - The generated/transformed image
Inputs by Model:
Image Editing (lucy-image-2)
Image Editing (lucy-image-2)
prompt: string- Style description (required)data: FileInput- Input image (required)reference_image?: FileInput- Reference image to guide the editseed?: number- Random seedresolution?: string- Output resolutionenhance_prompt?: boolean- Auto-enhance prompt
Next Steps
Queue API
Asynchronous video processing with job-based queue
Realtime API
Transform video streams in realtime with WebRTC