Skip to main content

Image Generation

Elftia's image generation feature lets you use AI to generate images from text descriptions (prompts). It supports multiple providers, batch generation, custom parameters, and automatic retries under rate limiting.

Use Cases

  • Generate concept designs, illustrations, or artwork from text descriptions
  • Quickly generate reference images or illustrations during a chat
  • Generate multiple images in batch and pick the best result
  • Try the same prompt multiple times with different styles and parameters

Supported Providers

ProviderModel examplesDescription
GeminiGemini VisionGoogle's multimodal image generation
OpenAIDALL-E 3, DALL-E 2, gpt-image-1OpenAI's image generation API
Vertex AIImagenGoogle Cloud's image generation service
Custom providerCustomThird-party services compatible with the OpenAI format

Configuring a Provider

Steps

  1. Open Settings > Media Providers > Image
  2. Select a provider from the list (e.g. OpenAI)
  3. Enter the provider's API Key
  4. (Optional) Modify the API endpoint address (required for custom providers or proxies)
  5. Select a default model
  6. Click Save

Provider Configuration Table

SettingDescriptionRequired
API KeyThe provider's API keyYes
API endpointCustom API address (defaults to the official address)No
Default modelThe model used by default when generatingNo
EnabledWhether this provider is enabledYes

Generating Images

Steps

  1. In the chat UI or the media generation interface, select the image generation feature
  2. Choose the provider and model you want to use
  3. Enter the image description in the prompt input field
  4. Configure generation parameters (see the parameter table below)
  5. Click the Generate button
  6. Wait for generation to complete and preview the result

Generation Parameters

ParameterDescriptionOptions / range
PromptDescribes the content you want to generateAny text
SizeResolution of the generated imageDepends on the model, e.g. 1024x1024, 1792x1024
CountNumber of images to generate at once1–10 (depends on provider limits)
StyleImage stylevivid, natural, etc.
QualityImage qualitystandard, hd, etc.

:::tip Prompt Tips A good prompt should include the following elements:

  • Subject: Describe the main content of the image
  • Style: The desired artistic style (realistic, watercolor, anime, etc.)
  • Details: Lighting, composition, color tone, and other details
  • Negative prompt: Elements you do not want to appear (supported by some providers) :::

Batch Generation

Elftia supports batch image generation with concurrency control, so generating multiple images does not overwhelm the API with too many simultaneous requests.

Behavior

  • When the count is greater than 1, the system automatically batches requests according to the concurrency limit
  • The default concurrency is 3; this can be adjusted in global settings
  • Each image is generated independently — a partial failure does not affect the other images

Automatic Retries

When an API rate limit (HTTP 429 error) or other temporary error is encountered, the system retries automatically:

BehaviorDescription
Retry count2 by default; can be adjusted in global settings
Retry intervalExponential backoff: 1 second on the first retry, 2 seconds on the second, doubling each time
Rate limit handlingWhen a 429 error is detected, a longer backoff time with random jitter is applied

Result Management

Generated images are:

  1. Displayed directly in the chat message
  2. Automatically saved to the local file system
  3. Recorded in the generation history for easy retrieval later

Action Options

  • Save — Save the image to a specified directory
  • Copy — Copy the image to the clipboard
  • Favorite — Add the image to your collection
  • Regenerate — Generate again with the same parameters

Adding a Custom Provider

If the image generation API you use is compatible with the OpenAI format, you can add it as a custom provider:

  1. Open Settings > Media Providers > Image
  2. Click Add Custom Provider
  3. Fill in the following information:
FieldDescription
NameProvider display name
API endpointAPI base address
API KeyAuthentication key
Model listList of available model IDs
  1. After saving, the provider can be selected when generating images

Frequently Asked Questions

QuestionSolution
Generation request returns 401API key is invalid or expired — check and update it
Generation request returns 429API rate limit reached — the system retries automatically; you can also try again later
Not all size options are availableDifferent models support different sizes — check the supported size list for the selected model
Custom provider does not workConfirm the API endpoint format is correct and the API is compatible with the OpenAI image generation format
Some images failed in batch generationCheck whether the API quota is sufficient; a single failure does not affect other images