Signature
Description
Process an image through one or more AI models sequentially. This is the main method for upscaling, descreening, and removing artifacts from images. The pipeline automatically downloads models if they’re not available locally, and can preserve ICC color profiles from the source image.Parameters
Path to the source image file. Supports formats: jpg, png, webp, bmp, tiff, and more.
Path where the processed image will be saved. The file extension determines the output format.
Array of processing steps to apply sequentially. Each step specifies a model and its parameters.See OpenComicAIOptions for available options.
Optional callback function that receives progress updates as a number between 0 and 1. Pass
false to disable progress tracking.The progress value represents overall completion across all steps:0= just started0.5= halfway through all steps1= completed
Optional callbacks for monitoring model download progress. Pass
false to disable download callbacks.See Downloading for callback options.Returns
Returns a promise that resolves to the path of the processed image (same as
dest parameter).ICC profile handling
If you’ve configured ICC profile preservation usingOpenComicAI.keepIccProfile(sharp), the pipeline will:
- Extract the ICC profile from the source image
- Apply it to the processed output image
- Maintain color accuracy throughout the processing pipeline
Examples
Basic upscaling
Multi-step processing with progress
Complete example with download tracking
Processing with custom parameters
Related
- preload - Preload models before processing
- model - Get model information
- OpenComicAIOptions - Available step options
- Downloading - Download callback interface