Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
AI Builder
Module 7Full course11 min read

Image Generation and Editing in Products

Add text-to-image and image editing to an app: choosing a model, prompt templates for consistent results, storage, moderation, and licensing questions.

A text-to-image demo takes ten minutes to build: a text box, an API call, a picture. Shipping it is a different job. Real users type prompts you never imagined, every generation costs real money, the fifth image looks nothing like the first four, and somebody will eventually ask whether they own what came out. And image failures are visible: a distorted hand or a mangled logo ends up in a screenshot.

In this lesson you'll add image generation and editing to an app the way you'd ship any other feature: pick the job first, choose a model on your own test prompts, wrap user input in prompt templates that keep results consistent, store outputs properly, put moderation in front of the model, and know which licensing questions to ask before launch.

Decide what the image feature is for

"Add AI images" covers several very different features. Before choosing a model, decide which one you're building, because it changes who writes the prompt, how much control the user needs, and what failure looks like.

FeatureWho writes the promptWhat "good" meansExample
Free-form generationThe user, mostlyMatches their intent; safeA "create an image" button in a design tool
Templated generationYour app, with a user-supplied slotConsistent with a house styleHeader illustrations for help articles
EditingThe user points at an image and describes a changeChanges only what was askedRemove the background from a product photo
VariantsYour app, from an approved originalRecognizably the same assetAd creative in five aspect ratios

Free-form generation is a commodity users already get from chat apps. Templated generation and editing are where your product adds value, because you supply context the user would otherwise have to type: your brand palette, the article's topic, the exact product photo.

For this lesson we'll build two features. Deskmate, the help-desk app used throughout the course, will generate header illustrations for knowledge-base articles in a consistent house style. And an online store will replace the background of product photos while keeping the product untouched.