All Projects
Intermediate · Case Study

AI Image Generator

Text in. Images out.

An AI-powered image generation app that turns text prompts into high-quality images using diffusion model APIs — with a clean prompt editor and style controls.

JavaScriptAI APIsImage ProcessingMachine Learning
Live DemoGitHub
AI Image Generator

The Problem

What needed solving.

Accessing image generation models usually requires technical setup or expensive subscriptions. There's room for a clean, accessible web UI anyone can use.

The Solution

How I solved it.

A minimal prompt-to-image UI calling a public diffusion model API. Type a prompt, pick a style, and download the result — no ML background required.

Features

What it does.

Prompt Editor

Write natural language prompts with helper suggestions and style presets.

Prompt Editor

Style Presets

Choose from photorealistic, oil painting, anime, sketch, and more.

Download Generated Image

One-click high-resolution download of generated artwork.

System Architecture

How it's built.

FrontendJavaScript + CSSPrompt UI, result gallery, download handler
APIDiffusion Model APIText-to-image generation endpoint
DeploymentVercelStatic frontend, API proxied via edge function

Technology Stack

Frontend

JavaScriptHTML5CSS3

AI/ML

AI Image API

Deployment

Vercel Edge Functions

Challenges & Solutions

Real problems, real fixes.

Challenge

Generation requests taking 8–15 seconds causing perceived hang.

Solution

Added an animated progress indicator and disabled the button on submit to prevent duplicate requests.

Challenge

API key exposed in client-side JavaScript.

Solution

Moved the API call to a Vercel Edge Function so the key never leaves the server.

Demo & Screenshots

See it live.

AI Image Generator

Prompt editor and generated image gallery

Explore the full source code and documentation.

View on GitHubLive Demo← All Projects