Skip to main content

Image Generation APIs

Sunset Notice: All image generation models on this page are being discontinued. These models will be removed in a future update. Please plan your migration accordingly.
Generate stunning images from text prompts using state-of-the-art diffusion models. Choose from FLUX.1-dev for best quality, SDXL for versatility, or Stable Diffusion for classic reliability.

Endpoint

Basic Example

Request Parameters

Required Parameters

Optional Parameters

SDXL-Specific Parameters

Response Format

The API returns a JSON object containing base64-encoded image data:

Decoding the Response

Available Models

Model Recommendations

Choosing the right model:
  • Best quality: FLUX.1-dev for outstanding prompt following and visual quality
  • Fast generation: SDXL Turbo for quick iterations
  • Image-to-image: SDXL 1.0 or SD1.5 (FLUX does not support image-to-image)
  • LoRA support: SDXL 1.0 or SD1.5 for style customization

Supported Resolutions

All image models support the following resolutions:

Pricing

Base rate: $0.01 per image at 1024x1024 resolution with 25 steps. Pricing formula:

Pricing Examples

Image-to-Image Generation

Transform existing images using a reference image. Supported by Stable Diffusion models only.

Image-to-Image Parameters

Strength guide:
  • 0.3-0.5: Subtle changes, preserves most of the original
  • 0.5-0.7: Moderate transformation
  • 0.7-1.0: Major changes, original is mostly a guide
Image-to-image is supported by Stable Diffusion models only. FLUX.1-dev does not support this feature.

LoRA Adapters

LoRA (Low-Rank Adaptation) adapters let you apply custom styles to your generated images. Available for SDXL and SD1.5 models.

Available LoRAs

SDXL LoRAs: SD1.5 LoRAs:

Using LoRAs

Combining Multiple LoRAs

Mix multiple LoRAs by adjusting their weights (0.0-1.0):
Experiment with different weight combinations to achieve unique styles. Lower weights apply subtle influence, while higher weights create stronger effects.

Backend Options

Tips for Better Results

Prompt Writing

  • Be specific: “A golden retriever puppy playing in autumn leaves, soft sunlight” works better than “a dog”
  • Include style: Add artistic style keywords like “photorealistic”, “oil painting”, “anime style”
  • Describe lighting: Mention lighting conditions like “soft natural light”, “dramatic shadows”, “neon glow”

Using Negative Prompts

Exclude unwanted elements:

Reproducible Results

Use the seed parameter to generate the same image:

CFG Scale Guide

  • 1-5: More creative, may deviate from prompt
  • 5-10: Balanced (recommended)
  • 10-15: Closely follows prompt
  • 15+: Very strict, may reduce quality

Next Steps

Text APIs

Generate text with large language models

Vision Language Models

Analyze images with multimodal AI

Audio APIs

Text-to-speech generation