For video processing (video editing, motion control), use the Queue API which provides asynchronous job-based processing.
Image Editing
Transform and restyle existing images:ImageToImageInput parameters:
prompt(required) - Text description of the style transformationdata(required) - Input image asFileInputseed(optional) - Random seed for reproducible resultsresolution(optional) - Output resolution (.res720por.res480p)enhancePrompt(optional) - Auto-enhance the prompt for better results
lucy_pro_i2i
Input Types
TheFileInput type provides static factory methods for creating inputs:
Error Handling
.invalidAPIKey- API key is invalid or missing.invalidInput(String)- Invalid input parameters or validation failed.processingError(String)- Server-side processing error.modelNotFound(String)- Specified model doesn’t exist.networkError(Error)- Network request failed
Complete Example
API Reference
client.createProcessClient(model:input:)
Creates a process client for image editing.
Parameters:
model: ImageModel- Image model (.lucy_pro_i2i)input: ImageToImageInput- Image editing input
ProcessClient
Throws: DecartError if the model URL cannot be constructed
processClient.process()
Sends the image for processing and returns the result.
Returns: Data - The transformed image bytes
Throws: DecartError on network or processing failure
Next Steps
Queue API
Asynchronous video processing with job-based queue
Realtime API
Transform video streams in realtime with WebRTC