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

Image Editing

Transform and restyle existing images:
You can also provide a reference image to guide the edit — for example, to add a specific item:
Parameters:
  • prompt (required) - Text description of the style transformation
  • data (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 results
  • resolution (optional) - Output resolution
  • enhance_prompt (optional) - Auto-enhance the prompt for better results
Model: lucy-image-2

Input Types

The data, reference_image, start, and end parameters accept flexible input types:
Examples:

Cancellation

Cancel long-running operations using AbortController:
You can use this to implement cancel buttons in your UI:

Error Handling

The SDK throws specific errors for different failure scenarios:
If you provide invalid inputs, you’ll get clear error messages:

API Reference

client.process(options)

Generate or transform images. Parameters:
  • options - Configuration object with model and inputs:
    • model - Model from models.image()
    • signal? - Optional AbortSignal for cancellation
    • Additional fields depend on the model (see below)
Returns: Promise<Blob> - The generated/transformed image Inputs by Model:
  • prompt: string - Style description (required)
  • data: FileInput - Input image (required)
  • reference_image?: FileInput - Reference image to guide the edit
  • seed?: number - Random seed
  • resolution?: string - Output resolution
  • enhance_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