The first step to start processing images with the IMG Processing API is to create an Image Object.
upload(body: ImageUploadParams, options?: RequestOptions): APIPromise<ImageObject>;
Show uploadOptions
Show ImageUploadParams
Show Examples
import fs from 'fs'; const imageObject = await client.images.upload({ image: fs.createReadStream('path/to/file'), name: 'example-image', });
createFromURL(body: ImageCreateFromURLParams, options?: RequestOptions): APIPromise<ImageObject>;
Show createFromURLOptions
Show ImageCreateFromURLParams
const imageObject = await client.images.createFromURL({ name: 'example-image', url: 'https://example.com/image.jpg', });
imagine(body: ImageImagineParams, options?: RequestOptions): APIPromise<ImageObject>;
Show imagineOptions
Show ImageImagineParams
const imageObject = await client.images.imagine({ name: 'example-image', prompt: 'A beautiful sunset over the ocean.', });