---
title: "OpenClaw Image Generation — Flux, Imagen 4, Seedream, GPT Image, Midjourney API"
description: "Generate images inside OpenClaw agent workflows with Flux Kontext, Imagen 4, Seedream, GPT Image 2, and Midjourney. One RunAPI key, no extra skills to install."
url: "https://runapi.ai/openclaw-image-generation.md"
canonical: "https://runapi.ai/openclaw-image-generation"
locale: "en"
---

# Add Flux, Imagen 4, Seedream, GPT Image, and Midjourney to OpenClaw — No Extra Skills

The same API key your OpenClaw agent uses for chat also calls Flux Kontext, Imagen 4, Seedream, GPT Image 2, and Midjourney — 10+ image models, no extra skill to install. Use text-to-image, image editing, image-to-video, and prompt discovery in one RunAPI task flow.

Each model covers a different production need. Flux Kontext handles brand-consistent edits and text rendering. Imagen 4 produces photorealistic output with strong prompt adherence. Seedream 5 Lite runs fast at low cost for high-volume workflows. GPT Image 2 excels at instruction-following edits and compositing. Midjourney covers polished AI image generation, creative image editing, image-to-video, prompt discovery, and seed lookup. All five fit the same RunAPI task lifecycle your OpenClaw agent already uses.

## Generate images in OpenClaw through RunAPI

1. **Configure RunAPI in OpenClaw** — If you have not set up RunAPI in OpenClaw yet, follow the OpenClaw setup guide. Add the RunAPI provider with baseUrl https://runapi.ai/v1 and your RUNAPI_API_KEY environment variable.
2. **Send an image generation request** — Use the RunAPI task endpoint from your agent code or a direct HTTP call. Set the model field to an image model slug such as flux-kontext-pro, imagen-4, gpt-image-2, or midjourney-v8.1. The request body follows the same JSON pattern as LLM calls.
3. **Poll and retrieve the result** — Image tasks return a task ID. Poll the task status endpoint or use a webhook callback. When the task completes, the response includes the generated image URL. RunAPI SDKs and the CLI handle polling automatically.

## Flux Kontext vs Imagen 4 vs Seedream vs GPT Image 2 vs Midjourney

| Comparison point | Flux Kontext | Imagen 4 | Seedream | GPT Image 2 | Midjourney |
|---|---|---|---|---|---|
| Best default use | Brand-consistent edits, text overlays, logo placement, and in-context image modification with style references. | Photorealistic generation from detailed prompts, product photography, and high-fidelity single-image output. | Fast bulk generation and prototyping where speed and cost matter more than maximum detail. | Instruction-driven compositing, background changes, style transfers, and multi-step image editing. | Creative art direction, polished AI art, cinematic compositions, image variations, prompt discovery, seed lookup, and image-to-video when visual style matters. |
| Input types | Text prompt, reference image for in-context editing, style references. | Text prompt. Fast, standard, and ultra quality tiers. | Text prompt, image-to-image with a source image URL. | Text prompt for generation, text plus image URL for editing and compositing. | Text prompt for generation; source image URL for image editing, image-to-video, prompt discovery, and seed lookup. |
| Output quality | High detail with accurate text rendering. Strong at preserving brand elements across edits. | Photorealistic with strong prompt adherence. Ultra tier for maximum detail. | Good quality at speed. Suitable for drafts, thumbnails, and iteration loops. | High quality with strong instruction following. Best for edits that require understanding spatial relationships. | Highly stylized and polished visual output. Strong for cinematic concept art, campaign visuals, and mood boards. |
| Speed | Standard generation speed. Suitable for interactive and batch workflows. | Fast tier available for near-instant output. Standard and ultra tiers trade speed for quality. | Fastest for high-volume draft and prototype pipelines. | Standard speed. Slightly slower for complex multi-step edits. | Async task workflow. Suitable for agent pipelines that can poll or use callbacks while media is generated. |
| Cost per image | Check the live Flux model page for current task pricing by tier and endpoint. | Check the live Imagen model page for current task pricing by quality tier. | Check the live Seedream model page for current text-to-image and image-to-image task pricing. | Check the live GPT Image model page for current pricing by resolution and endpoint. | Check the live Midjourney model page for current task pricing by endpoint before production use. |
| Best for OpenClaw agents | When the agent workflow involves brand assets, marketing images, or text-heavy visuals. | When the agent needs photorealistic output from a natural language description. | When the agent generates many images per session and cost or speed is the priority. | When the agent edits existing images based on user instructions. | When the agent needs polished creative direction, image variation, or image-to-video from a selected frame. |

## USE CASES

- **Marketing asset generation** — OpenClaw agents can generate product images, social media visuals, campaign concepts, and ad creatives by calling Flux Kontext, Imagen 4, or Midjourney. The agent writes the prompt based on conversation context and retrieves the finished image in the same session.
- **Automated image editing** — Pass an existing image URL to GPT Image 2 or Seedream with an editing instruction. The agent can remove backgrounds, swap styles, or composite elements without manual design tools.
- **High-volume image iteration** — OpenClaw agents that prototype UI components, social ads, or product variations benefit from Seedream 5 Lite's speed and low per-image cost. Generate 20 drafts per session, then route the selected prompt to Flux Kontext Pro for the final output.
- **Midjourney creative direction** — Route creative briefs to Midjourney when the agent needs polished AI art, cinematic concept visuals, image variations, prompt discovery, seed lookup, or image-to-video motion tests from a selected frame.

## Generate images through the RunAPI task endpoint

Use the same RunAPI key and task lifecycle for every image model. Change the model slug and endpoint to switch between Flux, Imagen, Seedream, GPT Image, and Midjourney. The response returns a task ID for polling, so your agent can keep one workflow for draft images, edits, variations, and image-to-video tasks.

### Flux Kontext

POST /api/v1/task/text_to_image

```json
{
  "model": "flux-kontext-pro",
  "prompt": "A futuristic city skyline at sunset, photorealistic, 8K detail"
}
```
### Imagen 4

POST /api/v1/task/text_to_image

```json
{
  "model": "imagen-4",
  "prompt": "A golden retriever wearing astronaut suit, studio lighting"
}
```
### GPT Image 2

POST /api/v1/task/edit_image

```json
{
  "model": "gpt-image-2",
  "prompt": "Remove the background and add a tropical beach",
  "image_url": "https://example.com/photo.jpg"
}
```
### Midjourney

POST /api/v1/midjourney/text_to_image

```json
{
  "model": "midjourney-v8.1",
  "prompt": "A cinematic product photo of a translucent AI compass on a black desk, dramatic lighting",
  "aspect_ratio": "16:9"
}
```

## The same API key generates video and music

- **Video generation** — Generate video clips with Kling 3.0, Veo 3, and Seedance 2.0. Text-to-video and image-to-video endpoints follow the same async task lifecycle as image generation.
- **Music creation** — Create music tracks with Suno v4, v4.5, and v5. Describe the genre, mood, and lyrics in the prompt. The agent receives audio URLs when the task completes.

## Live image generation pricing by model and endpoint

RunAPI uses pay-as-you-go pricing with no monthly subscription. Each image model has a task cost based on the model tier, endpoint, and output settings. Flux Kontext, Imagen 4, Seedream, GPT Image 2, and Midjourney all publish current rates on the live pricing and model pages, so confirm the active endpoint price before production use.

RunAPI publishes current pay-as-you-go rates on the live pricing page and model detail pages. Actual task cost may vary by endpoint, resolution, quality tier, or model-specific options. Always confirm current pricing before production deployment.

## OpenClaw image generation FAQ

### How do I choose between Flux Kontext and Imagen 4 for my OpenClaw workflow?

Use Flux Kontext Pro when the agent produces brand assets, marketing images, or visuals that include text — it preserves style and renders text accurately. Use Imagen 4 when the agent needs photorealistic output from a natural language description. Both are available from the same RunAPI endpoint.
### Which image models work with OpenClaw through RunAPI?

Flux Kontext Pro and Max, Imagen 4 in fast, standard, and ultra tiers, Seedream 5 Lite, GPT Image 2, Midjourney, Nano Banana, and several more. Over 10 image models are available through the same API key. The full list is available on the RunAPI pricing page and updates automatically as new models are added.
### How much does image generation cost through RunAPI?

RunAPI image generation is pay-as-you-go with no monthly minimum. Pricing varies by model, endpoint, quality tier, resolution, and task type. Check the live pricing page and model pages for current Flux, Imagen, Seedream, GPT Image, and Midjourney rates before production use.
### Does RunAPI charge separately for image calls versus LLM calls?

No. RunAPI uses a single credits balance across all modalities. Image, video, music, and LLM calls all draw from the same account balance. There is no per-modality subscription or minimum spend. You can monitor spending per model in the RunAPI dashboard.
### How do I switch between image models in my OpenClaw workflow?

Change the model field in the request body. The endpoint, API key, task lifecycle, and polling pattern stay the same. Your agent can route to different models based on the task without changing any integration code. For example, route drafts to seedream-5-lite-text-to-image and final exports to flux-kontext-pro.
### Is RunAPI cheaper than fal.ai or Replicate for image generation?

Use the RunAPI pricing page to compare current model and endpoint rates before production use. Pricing varies by model, resolution, quality tier, and task type, so live pricing is the safest source for side-by-side cost decisions.

## Links

- [Flux Kontext](https://runapi.ai/models/flux-kontext)
- [Imagen 4](https://runapi.ai/models/imagen-4)
- [Seedream](https://runapi.ai/models/seedream)
- [GPT Image 2](https://runapi.ai/models/gpt-image-2)
- [Midjourney](https://runapi.ai/models/midjourney)
- [AI Video API Comparison](https://runapi.ai/ai-video-api-comparison)
- [Suno](https://runapi.ai/models/suno)
- [Models Hub](https://runapi.ai/models)
- [OpenClaw Setup](https://runapi.ai/openclaw)
- [Pricing](https://runapi.ai/pricing)
- [API docs](https://runapi.ai/docs/guides)
