Skip to main content
Docs/AI Image Generation
DocsAI Image Generation
Free

AI Image Generation

Let your app create images from a text prompt (avatars, logos, stickers, artwork, product mockups) and edit or enhance your users' photos. No API key, available on every plan.

What is AI Image Generation

A built-in service that turns a written description into an image, or edits a photo the user picks. Ask for "an avatar generator", "a logo maker" or "an app that enhances my photos" in chat and GenMB wires it into your app. It works the same in the live preview and in your deployed app.

This service creates and edits images. To describe, read, or answer questions about an image the user uploads, your app uses Image AI instead (see Services & SDKs).

How to Use

Generated apps call the SDK that GenMB injects. It resolves to a data URL you can put straight into an image tag:

const src = await window.genmb.ai.generateImage('a friendly fox mascot, flat illustration', {
  size: '1024x1024',   // or '1024x1536' (portrait), '1536x1024' (landscape)
  quality: 'medium',   // or 'low'
  transparent: false,  // true returns a PNG with no background
})
img.src = src

To edit a photo, pass the file (from a file input) or its URL with an instruction. The result keeps the photo's shape unless you pass a size:

const src = await window.genmb.ai.editImage(file, 'brighten it and remove the background')
Only generate when the user presses a button. Never on page load or in a loop: every call costs a credit.

Limits and Credits

  • 1 credit per image, generated or edited, charged to the app owner, only when an image is returned.
  • Photos to edit can be PNG, JPEG or WebP up to 10MB; the SDK shrinks larger photos and converts other formats first.
  • Per app: 20 images per hour, 100 per day, and 2 at the same time. Over the cap the SDK throws an error with code RATE_LIMITED.
  • When the owner is out of credits the SDK throws an error with code INSUFFICIENT_CREDITS.
  • Prompts up to 4,000 characters.

FAQs

Who pays for the images?▾
You, the app owner. Each image costs 1 credit from your balance, including images made by visitors of your public app. On the Free plan (8 credits a day, up to 40 a month) that is about 8 images a day; after that your app gets an out-of-credits error until your credits refill or you upgrade.
How long does an image take?▾
Usually 20-30 seconds. Show a loading state and disable the generate button while it runs.
What happens if a prompt is blocked?▾
Prompts that break the image safety policy are refused with a "blocked by the image safety filter" message, and no credit is charged. Ask the user to rephrase.
Can I get a transparent background?▾
Yes. Pass transparent: true and you get a PNG with no background, which suits logos and stickers. Otherwise images come back as JPEG to keep them small.

Ready to build?

Create your first app for free, no credit card required.