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
| Provider | Model examples | Description |
|---|---|---|
| Gemini | Gemini Vision | Google's multimodal image generation |
| OpenAI | DALL-E 3, DALL-E 2, gpt-image-1 | OpenAI's image generation API |
| Vertex AI | Imagen | Google Cloud's image generation service |
| Custom provider | Custom | Third-party services compatible with the OpenAI format |
Configuring a Provider
Steps
- Open Settings > Media Providers > Image
- Select a provider from the list (e.g. OpenAI)
- Enter the provider's API Key
- (Optional) Modify the API endpoint address (required for custom providers or proxies)
- Select a default model
- Click Save
Provider Configuration Table
| Setting | Description | Required |
|---|---|---|
| API Key | The provider's API key | Yes |
| API endpoint | Custom API address (defaults to the official address) | No |
| Default model | The model used by default when generating | No |
| Enabled | Whether this provider is enabled | Yes |
Generating Images
Steps
- In the chat UI or the media generation interface, select the image generation feature
- Choose the provider and model you want to use
- Enter the image description in the prompt input field
- Configure generation parameters (see the parameter table below)
- Click the Generate button
- Wait for generation to complete and preview the result
Generation Parameters
| Parameter | Description | Options / range |
|---|---|---|
| Prompt | Describes the content you want to generate | Any text |
| Size | Resolution of the generated image | Depends on the model, e.g. 1024x1024, 1792x1024 |
| Count | Number of images to generate at once | 1–10 (depends on provider limits) |
| Style | Image style | vivid, natural, etc. |
| Quality | Image quality | standard, 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:
| Behavior | Description |
|---|---|
| Retry count | 2 by default; can be adjusted in global settings |
| Retry interval | Exponential backoff: 1 second on the first retry, 2 seconds on the second, doubling each time |
| Rate limit handling | When a 429 error is detected, a longer backoff time with random jitter is applied |
Result Management
Generated images are:
- Displayed directly in the chat message
- Automatically saved to the local file system
- 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:
- Open Settings > Media Providers > Image
- Click Add Custom Provider
- Fill in the following information:
| Field | Description |
|---|---|
| Name | Provider display name |
| API endpoint | API base address |
| API Key | Authentication key |
| Model list | List of available model IDs |
- After saving, the provider can be selected when generating images
Frequently Asked Questions
| Question | Solution |
|---|---|
| Generation request returns 401 | API key is invalid or expired — check and update it |
| Generation request returns 429 | API rate limit reached — the system retries automatically; you can also try again later |
| Not all size options are available | Different models support different sizes — check the supported size list for the selected model |
| Custom provider does not work | Confirm the API endpoint format is correct and the API is compatible with the OpenAI image generation format |
| Some images failed in batch generation | Check whether the API quota is sufficient; a single failure does not affect other images |
Related Links
- Media Generation Overview — Overview of all media types
- Video Generation — Generating video with AI
- LLM Provider Configuration — Text model configuration (separate from media providers)