Skip to main content

Documentation 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.

The Image Generator sends text prompts to Cloudflare Workers AI running the @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

1

Open the tool

Navigate to /utilities/image-generator in your AI360 app.
2

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.
3

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.
4

Download your creation

Once the image appears, click Download Image to save it as generated-image.png to your device.

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

Be as specific as possible. The best prompts combine a clear subject, an art style (e.g., photorealistic, watercolor, cinematic), lighting conditions (e.g., golden hour, neon-lit), and an overall mood (e.g., serene, dramatic, whimsical). For example: “A cinematic wide shot of a medieval castle on a misty mountain at dusk, dramatic storm clouds, photorealistic” will produce a far richer result than just “a castle”.

API integration

Call the endpoint directly from your own code to embed image generation anywhere in your application.
const response = await fetch('/api/utilities/image-generator', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ prompt: 'A serene mountain landscape at sunset with golden clouds' })
})

const { image } = await response.json()
// image is a base64 data URL: "data:image/png;base64,..."
You can pass the returned data URL directly to an <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
FieldTypeRequiredDescription
promptstring✅ YesThe text description of the image to generate.
Response body
FieldTypeDescription
imagestringA base64 data URL in the format data:image/png;base64,....
Error responses
StatusCondition
500Cloudflare API call failed or returned success: false.

Required environment variables

VariableDescription
CLOUDFLARE_IDYour Cloudflare account ID.
CLOUDFLARE_API_KEYAn 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.
The FLUX.1 Schnell model on Cloudflare Workers AI may have usage limits on free-tier accounts. If you exceed the included quota, requests will fail with a Cloudflare API error. Check your account’s Workers AI usage in the Cloudflare dashboard and consider upgrading to a paid plan for production workloads.

Build docs developers (and LLMs) love