The Image Generator sends text prompts to Cloudflare Workers AI running theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/ai360/llms.txt
Use this file to discover all available pages before exploring further.
@cf/black-forest-labs/flux-1-schnell model and returns a base64-encoded PNG image rendered directly in the browser. Once generated, users can download the result as a standard PNG file — no external storage or sign-in required.
How to use
Enter a prompt
Type a descriptive prompt into the input field. The more detail you provide about subject, style, lighting, and mood, the better the result.
Generate the image
Press Generate Image (or hit
Enter). A skeleton loader will appear while Cloudflare Workers AI processes your prompt — this typically takes a few seconds.Sample prompts
The following prompts are built into the UI as one-click starting points:- “A futuristic city with flying cars”
- “Underwater coral reef with colorful fish”
- “Medieval castle on a misty mountain”
Tips for better prompts
API integration
Call the endpoint directly from your own code to embed image generation anywhere in your application.<img> tag’s src attribute, a Next.js <Image> component, or a canvas context — no additional decoding needed.
Request & Response
POST /api/utilities/image-generator
Request body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | ✅ Yes | The text description of the image to generate. |
| Field | Type | Description |
|---|---|---|
image | string | A base64 data URL in the format data:image/png;base64,.... |
| Status | Condition |
|---|---|
500 | Cloudflare API call failed or returned success: false. |
Required environment variables
| Variable | Description |
|---|---|
CLOUDFLARE_ID | Your Cloudflare account ID. |
CLOUDFLARE_API_KEY | An API token with Workers AI read permission. |
CLOUDFLARE_ID is your Account ID, visible in the right-hand sidebar of the Cloudflare dashboard when you log in. CLOUDFLARE_API_KEY is an API Token (not a Global API Key) — create one under My Profile → API Tokens and grant it the Workers AI — Read permission scope.