DEV Community

AJ
AJ

Posted on

Generate AI Images Using YAML Instead of Python in 5 Minutes

Most AI image generation tutorials start with pip install and end with 200 lines of Python. This one doesn't.

OE Runtime is a single binary that runs AI agents defined in plain YAML. No Python. No LangChain. No Node.js. Just download, configure, and run.

In this guide you'll build an image generation agent that:

  • Plans and enhances a prompt automatically
  • Calls OpenAI's image API
  • Returns the image URL and style notes

Total setup time: under 5 minutes.

What You Need
An OpenAI API key with access to gpt-image-1
OE Runtime binary for your platform (download below)
A text editor
No Python. No npm. No Docker.

Step 1 — Download OE Runtime
OE Runtime is a standalone binary — no install, no dependencies.

Windows: oe-runtime-win.exe
macOS: oe-runtime-macos
Linux: oe-runtime-linux
macOS users: First run may be blocked by Gatekeeper. Go to System Settings → Privacy & Security → click "Allow Anyway".

Step 2 — Create the Agent YAML
Create a folder called image-generation/ and add agent.yaml inside it:

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
Enter fullscreen mode Exit fullscreen mode

The agent has three steps: plan a rich prompt, generate the image, and report the result. The LLM handles the reasoning — you just define the workflow.

Step 3 — Create the Config File
Create oe-config.json in the same image-generation/ folder:

{
  "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"
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

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

Step 4 — Run the Agent
Windows:

oe-runtime-win.exe image-generation/agent.yaml --config image-generation/oe-config.json
Enter fullscreen mode Exit fullscreen mode

macOS:

chmod +x oe-runtime-macos
oe-runtime-macos image-generation/agent.yaml --config image-generation/oe-config.json
Enter fullscreen mode Exit fullscreen mode

Linux:

chmod +x oe-runtime-linux
oe-runtime-linux image-generation/agent.yaml --config image-generation/oe-config.json
Enter fullscreen mode Exit fullscreen mode

The agent will plan an enhanced prompt, generate the image, and return the URL and style notes — all in one run.

Bonus: Run as an HTTP API Server
Add --serve to turn the binary into a local HTTP server:
(Make sure server.enabled = true in oe-config.json)

oe-runtime-win.exe --serve --config image-generation/oe-config.json
Enter fullscreen mode Exit fullscreen mode

Then call it from any app or script:

curl.exe -X POST http://localhost:3333/run-file -H "Content-Type: application/json" -H "x-api-key: your-secret-api-key" -d '{\"file\": \"e:/oe-runtime-folder/image-generation/agent.yaml\", \"params\": {}}'
Enter fullscreen mode Exit fullscreen mode

This is useful if you want to trigger image generation from a web app, CI pipeline, or automation tool.

What Can You Build With This?

  1. Product photography — Generate studio-quality product shots from descriptions, no photographer required
  2. Marketing creative — Produce social media visuals and ad banners at scale from a prompt template
  3. UI mockups — Create hero images, illustrations, and placeholders that match your exact aesthetic
  4. E-commerce catalogues — Automate image generation for large SKU lists
  5. Concept art — Rapidly prototype characters and environments for games or apps
  6. Training data — Generate synthetic image datasets with controlled variation ** How It Works Under the Hood** OE Runtime is an agent execution engine. It reads your YAML, spins up an LLM reasoning loop, and gives the model access to tools (connectors). When the model decides to call the image generation tool, the runtime handles the API call, waits for the result, and feeds it back into the next step.

You write the what. The runtime handles the how.

The same pattern works for 20 capability categories — SQL databases, SSH, Slack, REST APIs, web search, OCR, video generation, music generation, and more. Every agent is just a YAML file.

Resources
🔗OE Runtime page — downloads, API docs, all 20 capabilities
🌐 Website — openenterprise.info
💻 GitHub — Apache-2.0, open source
📦 Sample agents — 20 ready-to-run YAML agents
📬 Postman Collection — test all API endpoints

OE Runtime is part of Open Enterprise, an open-source Enterprise AI platform for building, deploying, and governing AI applications. If you're looking for the full platform—including web UI, enterprise connectors, and collaboration features—visit openenterprise.info.

Have questions or built something with it? Drop a comment below.

Thanks,
AJ
The JumboCoder

Top comments (0)