The image generation feature is the creative core of Akari Art. Authenticated users describe a scene, subject, or mood in plain text, and the app transforms that prompt into a unique image via Cloudflare Workers AI’s Flux-1-Schnell model. The resulting image is automatically uploaded to Cloudinary, and the hosted URL is returned to the browser for instant preview — no local file handling required.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/Akari-Art/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Enter a text prompt on the Create page
Navigate to
/create and type a description of the image you want to generate. The prompt field accepts between 10 and 500 characters. A live character counter in the bottom-right corner of the textarea tracks your input. The Artwork Name field is pre-filled with your account display name and cannot be edited.Client POSTs to /api/image-generation
Clicking Generate Image triggers A pulsing skeleton loader with a spinner replaces the empty preview area while the request is in flight.
handleGenerate, which validates the form and then sends a POST request with your prompt to the /api/image-generation route:Server calls Cloudflare Workers AI Flux-1-Schnell
The API route forwards the prompt directly to the Cloudflare Workers AI endpoint for the If
@cf/black-forest-labs/flux-1-schnell model, authenticated with your account credentials:response.data.success is false, the route returns a 500 error immediately.Base64 image is uploaded to Cloudinary
Cloudflare returns the generated image as a base64 string. The server decodes it and uploads it directly to Cloudinary:
Writing effective prompts
The textarea placeholder reads “Describe your vision in detail… Be creative and specific!” — and that’s genuine advice. Flux-1-Schnell responds well to precise, layered descriptions.Specificity
Specificity
Vague prompts yield generic results. Instead of “a cat”, try “a fluffy ginger tabby cat sitting on a rain-soaked windowsill at dusk”. The more concrete details you provide — species, color, setting, time of day — the closer the output matches your intent.
Style and medium
Style and medium
Append an artistic style to steer the aesthetic. Examples include “oil painting”, “photorealistic 4K render”, “watercolor illustration”, “charcoal sketch”, or “Studio Ghibli animation style”. Naming a specific artist or movement (e.g., “in the style of Monet”) also works.
Lighting and atmosphere
Lighting and atmosphere
Lighting dramatically changes the mood of an image. Phrases like “golden hour lighting”, “dramatic chiaroscuro”, “soft diffused studio light”, or “neon-lit night scene” give the model clear direction on how to illuminate the subject.
Composition and framing
Composition and framing
Guide the camera angle or framing: “close-up portrait”, “wide-angle landscape”, “bird’s-eye view”, “symmetrical composition”, or “rule-of-thirds framing”. Adding depth cues like “foreground bokeh” or “distant misty mountains” adds realism.
Validation rules
Before the request is sent,validateForm runs client-side checks on the prompt field:
| Rule | Condition | Error message |
|---|---|---|
| Required | prompt.trim() is empty | "Prompt is required" |
| Minimum length | prompt.trim().length < 10 | "Prompt must be at least 10 characters long" |
Sharing generated images
Once an image has been generated, a Share with Community button appears below the preview. Clicking it callshandleShare, which POSTs the user’s name, the original prompt, and the Cloudinary image URL to /api/post:
/community where the new post appears at the top of the grid (posts are displayed in reverse-chronological order).
Image generation and sharing both require authentication. The
/create page calls getServerSession on the server; unauthenticated visitors are redirected to /signin before the ImageGenerator component ever renders. See Authentication for details on the session and middleware setup.