Skip to main content

Overview

Open WebUI supports powerful image generation and editing capabilities through multiple engines, allowing you to create custom visuals directly in your chat conversations.

Supported Engines

DALL·E Integration
  • DALL·E 2: Fast, cost-effective
  • DALL·E 3: Higher quality, more detailed
  • GPT-IMAGE 1 & 1.5: Latest models
{
  "IMAGE_GENERATION_ENGINE": "openai",
  "IMAGE_GENERATION_MODEL": "dall-e-3",
  "IMAGES_OPENAI_API_BASE_URL": "https://api.openai.com/v1",
  "IMAGES_OPENAI_API_KEY": "sk-..."
}

Image Generation

Basic Generation

Create images from text descriptions:
1

Enable Image Generation

{
  "ENABLE_IMAGE_GENERATION": true,
  "IMAGE_GENERATION_ENGINE": "openai",
  "IMAGE_GENERATION_MODEL": "dall-e-3"
}
2

Configure Parameters

{
  "IMAGE_SIZE": "1024x1024",  // or "auto" for compatible models
  "IMAGE_STEPS": 50,          // Quality/speed tradeoff
  "ENABLE_IMAGE_PROMPT_GENERATION": true
}
3

Generate in Chat

Simply describe what you want:
Generate an image of a futuristic city at sunset

API Usage

Generate images programmatically:
# POST /api/v1/images/generations
curl -X POST "https://your-instance/api/v1/images/generations" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A serene mountain landscape at dawn",
    "n": 1,
    "size": "1024x1024",
    "steps": 50,
    "negative_prompt": "blurry, low quality"
  }'
Response:
[
  {
    "url": "/api/v1/files/{file-id}/content"
  }
]

Generation Parameters

Prompt

Text description of desired image
  • Be specific and detailed
  • Include style, mood, lighting
  • Mention artistic techniques

Size

Image dimensions
  • Standard: 512x512, 1024x1024
  • Custom: WIDTHxHEIGHT format
  • “auto”: Model-dependent sizing

Steps

Generation iterations
  • More steps = higher quality
  • More steps = slower generation
  • Typical range: 20-100

Negative Prompt

What to avoid in the image
  • “blurry, distorted”
  • “low quality, watermark”
  • Engine-dependent support

Image Editing

Modify existing images with AI.

Configuration

{
  "ENABLE_IMAGE_EDIT": true,
  "IMAGE_EDIT_ENGINE": "openai",  // openai, gemini, comfyui
  "IMAGE_EDIT_MODEL": "dall-e-2",
  "IMAGE_EDIT_SIZE": "1024x1024"
}

Edit Workflow

1

Upload Image

Provide source image(s):
  • File upload
  • URL reference
  • File ID from previous generation
2

Describe Changes

Specify desired modifications:
{
  "prompt": "Add a rainbow in the sky",
  "image": "data:image/png;base64,..."
}
3

Optional Parameters

  • Background color for transparency
  • Multiple image inputs (for Gemini)
  • Size adjustments
4

Generate Edited Version

API returns modified image URL

Edit API

# POST /api/v1/images/edit
curl -X POST "https://your-instance/api/v1/images/edit" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://example.com/image.png",
    "prompt": "Change the sky to nighttime with stars",
    "size": "1024x1024",
    "n": 1
  }'

Supported Edit Operations

DALL·E Edit Capabilities:
  • Single image input
  • Inpainting/outpainting
  • Background replacement
  • Style transfer
  • Detail enhancement

ComfyUI Integration

Advanced users can leverage ComfyUI’s powerful workflow system.

Workflow Configuration

1

Design Workflow

Create workflow in ComfyUI interface:
  • Load desired models
  • Configure nodes
  • Test generation
2

Export Workflow

Save workflow as JSON from ComfyUI
3

Configure Nodes

Map workflow nodes to Open WebUI parameters:
{
  "COMFYUI_WORKFLOW_NODES": [
    {
      "type": "model",
      "node_ids": ["4"]
    },
    {
      "type": "prompt",
      "node_ids": ["6", "7"]
    },
    {
      "type": "size",
      "node_ids": ["5"]
    }
  ]
}
4

Upload to Open WebUI

Paste workflow JSON in settings:
{
  "COMFYUI_WORKFLOW": "{...}"
}

Workflow Node Types

  • model: Checkpoint/model selector
  • prompt: Positive/negative prompts
  • size: Width/height dimensions
  • steps: Sampling steps
  • seed: Random seed control
  • sampler: Sampling method
ComfyUI workflows allow complete control over the generation pipeline, including custom samplers, LoRAs, and post-processing.

AUTOMATIC1111 Integration

Configuration

{
  "IMAGE_GENERATION_ENGINE": "automatic1111",
  "AUTOMATIC1111_BASE_URL": "http://localhost:7860",
  "AUTOMATIC1111_API_AUTH": "username:password",  // Optional
  "IMAGE_SIZE": "512x512",
  "IMAGE_STEPS": 50
}

Custom Parameters

Pass additional parameters to AUTOMATIC1111:
{
  "AUTOMATIC1111_PARAMS": {
    "cfg_scale": 7.5,
    "sampler_name": "Euler a",
    "enable_hr": true,
    "hr_scale": 2,
    "denoising_strength": 0.7
  }
}

Model Management

Switch models dynamically:
# GET /api/v1/images/models
# Returns available SD models

# Set active model
POST /api/v1/images/generations
{
  "model": "sd_xl_base_1.0.safetensors",
  "prompt": "..."
}

Image Storage

Generated and edited images are automatically stored in the file system.

Storage Flow

1

Generation/Edit

Image created by AI engine
2

Upload to Storage

  • Converted to standard format (PNG/JPEG)
  • Assigned unique file ID
  • Metadata stored (prompt, model, parameters)
3

Database Record

File entry created with:
  • User association
  • Generation parameters
  • Timestamp
4

Chat Linking

Optional: Link to chat message for context

Accessing Images

# Get image by ID
GET /api/v1/files/{file-id}/content

# Returns image file
Content-Type: image/png

Permissions

Control who can generate images:
# User permissions
{
  "USER_PERMISSIONS": {
    "features.image_generation": true  // Per-user setting
  }
}
Image generation can be resource-intensive. Consider setting usage limits or restricting to specific user groups.

Best Practices

Prompt Engineering

Write effective prompts:
  • Be specific about style and details
  • Include lighting and mood
  • Specify artistic techniques
  • Use negative prompts to avoid unwanted elements

Quality vs Speed

Balance performance:
  • More steps = better quality, slower
  • Larger sizes = more detail, higher cost
  • Test with low steps first
  • Increase for final generation

Model Selection

Choose appropriate engine:
  • OpenAI: Best quality, easiest setup
  • Gemini: Good balance, Google ecosystem
  • ComfyUI: Maximum control, self-hosted
  • AUTOMATIC1111: Free, extensive models

Cost Management

Control expenses:
  • Monitor API usage
  • Set generation limits
  • Use local engines for volume
  • Cache common generations

Troubleshooting

Check:
  • Base URL is correct and accessible
  • API key is valid (if required)
  • Firewall allows connection
  • Engine is running and healthy
  • Authentication credentials correct
Solutions:
  • Increase step count
  • Use larger image size
  • Refine prompt with more details
  • Try different model
  • Adjust sampling parameters
Fix:
  • Reduce image size
  • Lower step count
  • Check engine performance
  • Increase timeout settings
  • Use faster sampler
Verify:
  • Workflow JSON is valid
  • Node IDs correctly mapped
  • Required models installed
  • ComfyUI API accessible
  • Workflow tested in ComfyUI first

Advanced Features

Auto-Size Support

Some models support automatic sizing:
{
  "IMAGE_SIZE": "auto"  // Model chooses optimal size
}
Auto-size is only supported by models matching the pattern: gpt-image-*, dall-e-*

Batch Generation

Generate multiple variations:
{
  "prompt": "A beautiful sunset",
  "n": 4  // Generate 4 variations
}

Image Caching

Generated images are cached based on:
  • Prompt hash
  • Model configuration
  • Generation parameters
Repeated identical requests return cached results instantly.

API Reference

Generate Image

POST /api/v1/images/generations
Create new images from prompts

Edit Image

POST /api/v1/images/edit
Modify existing images

Get Models

GET /api/v1/images/models
List available image models

Get Config

GET /api/v1/images/config
Retrieve current settings