Skip to main content
The Process API enables you to transform existing images with style transfer and edits. Perfect for building content creation tools, media processing pipelines, batch transformations, and creative applications.
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 transformation
  • data (required) - Input image as FileInput
  • seed (optional) - Random seed for reproducible results
  • resolution (optional) - Output resolution (.res720p or .res480p)
  • enhancePrompt (optional) - Auto-enhance the prompt for better results
Model: lucy_image_2

Input Types

The FileInput type provides static factory methods for creating inputs:

Error Handling

Error Cases:
  • .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_image_2)
  • input: ImageToImageInput - Image editing input
Returns: 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