img-forge: Headless Image Generation for Agents, APIs, and the MCP Ecosystem

Kurt Overmier & AEGIS 4 min read

img-forge — headless image generation API

Eleven models. One endpoint. That's the pitch for img-forge — a serverless image generation API built for autonomous agents and modern apps, running entirely inside Cloudflare's network.


What it is

img-forge exposes a single /v2/generate endpoint. You send a prompt, pick a quality tier, and get back a job ID and asset URL. Everything else — model routing, async orchestration, asset storage — is handled for you.

curl -X POST https://imgforge.stackbilt.dev/v2/generate \
  -H "Authorization: Bearer sb_live_..." \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a red fox in a snowy forest, golden hour", "quality_tier": "standard"}'

Response:

{
  "job_id": "01J...",
  "state": "completed",
  "asset_url": "/v2/assets/7082f9...",
  "quality_tier": "standard"
}

Draft and standard generations are synchronous — response comes back when the image is ready. Premium runs async; you poll /v2/jobs/:id for completion.


11 models, 5 tiers

img-forge routes across 11 Cloudflare Workers AI models organized into five quality tiers:

Tier Speed Credits Default model
draft ~4s 1 SDXL Lightning (ByteDance)
standard ~10s 2 FLUX 2 Klein 4B (Black Forest Labs)
premium ~20s 4 FLUX 2 Dev (Black Forest Labs)
ultra 8 Gemini 3.1 Flash (coming soon)
ultra_plus 10 Gemini 3 Pro (coming soon)

When you need to pin a specific model — for batch consistency, artistic style, or capability requirements — the cf_model parameter lets you override the tier default. Available selectable models include FLUX 2 Klein 9B, FLUX 1 Schnell, Leonardo Lucid Origin, Leonardo Phoenix 1.0, DreamShaper 8, SDXL Base 1.0, and the RunwayML SD v1.5 img2img and inpainting variants.


img2img and inpainting

Beyond text-to-image, img-forge supports two editing modes:

img2img — pass input_asset_url (or input_job_id to chain from a prior generation) alongside your prompt. Controls how much the output diverges from the source via input_strength. Good for style transfer and quality uplift.

Inpainting — add a mask_image (base64, white pixels = regenerate, black = preserve) to selectively rewrite regions of an existing image. Designed for automated agent self-correction workflows where an agent needs to fix a specific area without regenerating the whole image.

Both modes work by referencing prior asset URLs directly — no re-uploading base64 blobs between steps.


MCP integration via Stackbilder gateway

img-forge is available as an MCP tool through the Stackbilder MCP gateway. The gateway handles OAuth, tenant routing, and credit accounting — img-forge itself is a private service binding behind it, not a directly accessible MCP server.

Connect any MCP-compatible client to mcp.stackbilt.dev and you get three tools:

  • image_generate — generate or edit an image. Full parameter surface: quality_tier, aspect_ratio, cf_model, input_asset_url, input_job_id, mask_image, seed.
  • image_list_models — enumerate available models and capability flags at runtime.
  • image_check_job — poll a premium-tier async job for completion.

This is useful for any agent that needs image generation as a primitive — the agent calls image_generate, gets back an asset_url, and can pass that URL directly into the next image_generate call via input_asset_url to chain edits without any binary transport.

Free accounts get 25 credits/month through the MCP gateway.


Pricing

img-forge uses a credit model, not per-image flat fees.

Plan Price Included
Free $0/mo 5 images/mo (draft + standard)
Pro $29/mo 100 images/mo (all tiers)
Team $19/seat/mo Pooled quota across seats

Need more? Credit packs are available and never expire:

  • Starter — 500 credits for $9.99
  • Builder — 2,500 credits for $39.99 (20% savings)
  • Scale — 10,000 credits for $129.99 (35% savings)

Credits map directly to tier cost: 1 credit per draft image, 2 per standard, 4 per premium.


Get started

Sign up and generate your first image at stackbilder.com/img-forge. API keys are available immediately after registration under Settings → API Keys. The free tier covers draft and standard generations — no card required.

For MCP access, connect to mcp.stackbilt.dev from any compatible client. The image_list_models tool is a good first call — it shows what's available and what each model supports before you commit credits to a generation.

Written by Kurt Overmier & AEGIS. Published on The Roundtable.
Learn more at stackbilder.com →