← Back to Blog

How to Run an AI Image Generation Agent with OE Runtime

Turn text descriptions into high-quality images automatically. OE Runtime lets you run an AI image generation agent locally — no cloud platform, no monthly subscription, just a YAML file and a binary.

🎨
Step 1
Plan the Prompt
Design a detailed prompt with style, lighting, composition, and aspect ratio details.
Step 2
Generate Image
Call the image generation tool with the crafted prompt and retrieve the image URL.
Step 3
Report
Return the final prompt used, image URL, and style notes for future reference.

The Agent YAML

Create a file called agent.yaml inside an image-generation/ directory:

name: Image Creator
description: Generate images from text descriptions using AI
instructions: |
  You are a creative image generation agent. Craft detailed prompts and generate high-quality images.
  If the concept is vague, enhance it with artistic style, lighting, and composition details before generating.
  Complete all steps fully before writing your report.
steps:
  - name: Plan the Prompt
    content: |
      Design a detailed image generation prompt for a professional product showcase photo.
      The subject: a sleek laptop on a minimalist desk with soft natural lighting.
      Enhance with: camera angle, lighting style, color palette, mood, and aspect ratio (16:9).
  - name: Generate Image
    content: |
      Call the image generation tool with the crafted prompt.
      Request high resolution. Wait for the generation to complete and retrieve the image URL.
  - name: Report
    content: |
      Summarize the result:
      - The final prompt used
      - Any enhancements made to the original concept
      - Image URL
      - Style and composition notes for future reference
connectors:
  - connection_name: OpenAI Image
    connection_type: openai-image

The Config File

Create oe-config.json in the same directory:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "YOUR_OPENAI_API_KEY"
  },
  "server": {
    "enabled": false,
    "port": 3333,
    "apiKey": "your-secret-api-key"
  },
  "connectors": [
    {
      "connection_name": "OpenAI Image",
      "connection_type": "openai-image",
      "apiKey": "YOUR_OPENAI_API_KEY",
      "model": "gpt-image-1",
      "size": "1024x1024"
    }
  ]
}

Replace YOUR_OPENAI_API_KEY with your key from platform.openai.com/api-keys.

Download OE Runtime

OE Runtime — Direct Downloads

Run the Agent

Windows

# Run the agent
oe-runtime-win.exe image-generation/agent.yaml --config image-generation/oe-config.json

macOS

# Make executable (first time only)
chmod +x oe-runtime-macos

# Run the agent
oe-runtime-macos image-generation/agent.yaml --config image-generation/oe-config.json

Linux

# Make executable (first time only)
chmod +x oe-runtime-linux

# Run the agent
oe-runtime-linux image-generation/agent.yaml --config image-generation/oe-config.json

macOS Gatekeeper: On first run, macOS may block the binary. Go to System Settings → Privacy & Security → click "Allow Anyway" next to oe-runtime-macos.

Running as an API Server

Add --serve to start OE Runtime as an HTTP server on port 3333:

oe-runtime-win.exe --serve --config image-generation/oe-config.json

Then send a request:

curl -X POST http://localhost:3333/run \
  -H "Content-Type: application/json" \
  -d '{"yaml": "image-generation/agent.yaml", "params": {}}'

Or import the Postman collection (download above) to test all endpoints visually.

Use Cases

Build your own agents with OE Runtime

Download OE Runtime and run any AI agent locally or as a server — no cloud required.

Get OE Runtime →