blockrun_image
Generate or edit images using multiple AI models. Supports text-to-image, img2img, multi-image fusion, and inpainting. Payments processed with USDC on Base or Solana.
Instructions
Generate or edit images via BlockRun. Pays with USDC on the ACTIVE chain — Base or Solana (see blockrun_wallet) — no separate API keys needed.
Actions:
generate (default): Create image from text prompt
edit: Transform an existing image using img2img
Generation models (1024x1024 base price; larger sizes cost more on gpt-image-*):
openai/gpt-image-2 ($0.06–0.12) — flagship, reasoning-driven, multilingual on-image text + character consistency (default)
openai/gpt-image-1 ($0.02–0.04) — GPT native image generation
google/nano-banana ($0.05) — Gemini-family image model
google/nano-banana-pro ($0.10; $0.15 at 4096px) — up to 4K, strongest photorealism
xai/grok-imagine-image ($0.02) — stylized, fast
xai/grok-imagine-image-pro ($0.07) — higher quality Grok Imagine
zai/cogview-4 ($0.015) — cheapest, photorealistic detailed scenes
Edit (img2img) models: openai/gpt-image-2 (default), openai/gpt-image-1, google/nano-banana, google/nano-banana-pro Multi-image edit: pass an array of 2–4 source images to "image" to fuse them in one render (openai/* up to 4, google/* up to 3) — e.g. a subject plus a sprite layout guide, or a reference plus a brand logo. Source images and masks accept a base64 data URI, an http(s) URL, or a local file path (auto-encoded). Inpaint mask (openai/gpt-image-* only) via "mask"; not combinable with multiple source images.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mask | No | Inpaint mask for edit action (openai/gpt-image-* only): a base64 data URI, http(s) URL, or local file path. Transparent areas of the mask are regenerated. Cannot be combined with multiple source images. | |
| size | No | Image size. Common values: 1024x1024 (all models), 1536x1024 / 1024x1536 (gpt-image-*), 2048x2048 / 4096x4096 (nano-banana-pro) | 1024x1024 |
| image | No | Source image(s) for edit action: a base64 data URI, an http(s) URL, or a local file path (auto-encoded to a data URI) — or an array of 2–4 to fuse into one render (e.g. subject + layout guide, or reference + brand logo). openai/* accepts up to 4, google/* up to 3; a mask cannot be combined with multiple images. | |
| model | No | Model to use (default: openai/gpt-image-2 for both generate and edit). gpt-image-2 renders on-image text best; nano-banana-pro for 4K photorealism; cogview-4 / grok-imagine-image for cheap drafts. | |
| action | No | generate: create from text; edit: transform existing image | generate |
| inline | No | Return a small inline image preview (thumbnail) the client can render in-conversation, in addition to the full-resolution URL. Defaults to the BLOCKRUN_INLINE_IMAGES env setting (off unless set). Rich clients (e.g. the VS Code extension) render it; plain terminals ignore it. Off keeps responses lightweight. | |
| prompt | Yes | Image description or edit instructions | |
| quality | No | standard | |
| agent_id | No | Agent identifier for budget tracking and enforcement. |