SmartGen

SmartGen for Image Generation (Experimental)

Experimental Feature: SmartGen is currently in beta. APIs and behaviors may change.


Overview

SmartGen provides a high-level interface for generating images with enhanced prompt engineering and dimension controls. It supports both FLUX and Stable Diffusion models.


Basic Example

Copy

import Xalora from 'xalora';

const xalora = new Xalora({
  apiKey: process.env['XALORA_API_KEY']
});

const response = await xalora.smartgen.generateImage({
  description: "A futuristic cyberpunk portrait of a young woman",
  image_model: "FLUX.1-dev",
  stylization_level: 3,
  detail_level: 4,
  color_level: 5,
  lighting_level: 2
});

Parameters and Controls

SmartGen accepts the following key parameters:

Copy

Two-Step Generation

You can split the generation process into two steps:

Copy

Response Type in Parameter-only Mode (param_only set to true)

Copy

This allows you to preview and tweak the image generation parameters before invoking the generation method.

One-Step Generation

You can create an image with a simple description in one step:

Copy

Demonstration

Here are two examples showcasing the progression from monochromatic to vibrant colors (color_level from 1 to 5):

Example 1: “A futuristic cyberpunk portrait of a young woman”

Example 2: “Hot air balloons in the sky”.

Last updated