Skip to main content

Introduction

The Decart AI SDK Provider enables you to generate high-quality images from text prompts using Decart’s image generation models. Built on the AI SDK, it provides a simple and powerful interface for text-to-image generation.

Quick Start

1

Install the provider

npm i @decartai/ai-sdk-provider
2

Import the provider and generate an image

import { decart } from '@decartai/ai-sdk-provider';
import { generateImage } from 'ai';
import fs from 'fs';

const { image } = await generateImage({
  model: decart.image('lucy-pro-t2i'),
  prompt: 'Three dogs playing in the snow',
});

const filename = `image-${Date.now()}.png`;
fs.writeFileSync(filename, image.uint8Array);
console.log(`Image saved to ${filename}`);

Key Features

High-Quality Generation

Generate photorealistic images with the lucy-pro-t2i model

Flexible Aspect Ratios

Support for 16:9 landscape and 9:16 portrait orientations

Reproducible Results

Use seed values to generate consistent outputs

AI SDK Integration

Seamlessly integrates with the AI SDK ecosystem

Available Models

Decart currently offers one image generation model:
Model IDDescription
lucy-pro-t2iHigh-quality text-to-image generation model
For detailed information about model capabilities, see the Models page.

Image Settings

Customize your image generation with optional settings:
  • aspectRatio: Control the output dimensions (16:9 or 9:16)
  • seed: Set a seed value for reproducible results
The size setting is not supported by Decart models. Use aspectRatio instead to control image dimensions.
For comprehensive documentation on all settings, see the Settings page.

API Reference

The image generation functionality is provided through the AI SDK’s generateImage() function. For complete API details, refer to:

Next Steps

Explore Models

Learn about lucy-pro-t2i capabilities

View Examples

See real-world code examples

Configure Settings

Customize generation parameters

Configuration

Configure the Decart provider