Master AI-powered image generation with DALL-E and Stable Diffusion. Create stunning images from text descriptions, edit existing images, generate variations, and optimize prompts for professional results.
AI image generation has revolutionized creative workflows - transforming text descriptions into stunning visuals in seconds. With models like DALL-E 3, Stable Diffusion, and Midjourney, you can create professional-quality images, illustrations, and art without traditional design skills.
Whether you're building a design tool, creating marketing materials, generating product mockups, or adding visual features to your application, AI image generation opens up endless creative possibilities. These tools understand complex descriptions, artistic styles, and visual concepts.
In this lesson, you'll learn to use DALL-E 3 for image generation, master prompt engineering for precise visual outputs, edit images with AI, create variations, and implement image generation features in production applications.
DALL-E 3 generates high-quality, detailed images from natural language descriptions - understanding context, style, composition, and artistic direction.
What is DALL-E?
DALL-E is OpenAI's text-to-image model that creates original images from text descriptions:
Getting Started with DALL-E API:
1import OpenAI from 'openai';
2
3const openai = new OpenAI({
4 apiKey: process.env.OPENAI_API_KEY
5});
6
7async function generateImage(prompt) {
8 const response = await openai.images.generate({
9 model: "dall-e-3",
10 prompt: prompt,
11 n: 1, // Number of images (DALL-E 3 only supports 1)
12 size: "1024x1024", // 1024x1024, 1024x1792, or 1792x1024
13 quality: "standard", // "standard" or "hd"
14 style: "vivid" // "vivid" or "natural"
15 });
16
17 return response.data[0].url; // Temporary URL (expires in 1 hour)
18}
19
20// Usage
21const imageUrl = await generateImage(
22 "A serene Japanese garden with cherry blossoms, koi pond, and stone bridge at sunset"
23);
24console.log("Generated image:", imageUrl);Image Size Options:
DALL-E 3:
1024x1024 - Square (default)1024x1792 - Portrait (9:16)1792x1024 - Landscape (16:9)Quality Settings:
1// Standard quality (faster, cheaper)
2const standardImage = await openai.images.generate({
3 model: "dall-e-3",
4 prompt: "A futuristic cityscape",
5 quality: "standard" // $0.040 per image (1024x1024)
6});
7
8// HD quality (slower, more expensive, better detail)
9const hdImage = await openai.images.generate({
10 model: "dall-e-3",
11 prompt: "A futuristic cityscape",
12 quality: "hd" // $0.080 per image (1024x1024)
13});Style Options:
1// Vivid style - hyper-real, dramatic images
2const vividImage = await openai.images.generate({
3 model: "dall-e-3",
4 prompt: "A majestic mountain landscape",
5 style: "vivid" // More dramatic, saturated colors
6});
7
8// Natural style - more subtle, realistic
9const naturalImage = await openai.images.generate({
10 model: "dall-e-3",
11 prompt: "A majestic mountain landscape",
12 style: "natural" // More muted, natural colors
13});Downloading and Saving Images:
1import fs from 'fs';
2import https from 'https';
3
4async function downloadImage(url, filepath) {
5 return new Promise((resolve, reject) => {
6 https.get(url, (response) => {
7 const fileStream = fs.createWriteStream(filepath);
8 response.pipe(fileStream);
9
10 fileStream.on('finish', () => {
11 fileStream.close();
12 resolve(filepath);
13 });
14
15 fileStream.on('error', reject);
16 }).on('error', reject);
17 });
18}
19
20// Generate and save
21async function generateAndSave(prompt, filename) {
22 const imageUrl = await generateImage(prompt);
23 await downloadImage(imageUrl, filename);
24 console.log(`Image saved to: ${filename}`);
25}
26
27await generateAndSave(
28 "A cozy coffee shop interior with warm lighting",
29 "./generated_image.png"
30);Handling Image URLs:
1// URLs expire after 1 hour - download immediately
2async function generatePermanentImage(prompt) {
3 const response = await openai.images.generate({
4 model: "dall-e-3",
5 prompt: prompt,
6 size: "1024x1024"
7 });
8
9 const tempUrl = response.data[0].url;
10 const revisedPrompt = response.data[0].revised_prompt; // DALL-E 3 may revise your prompt
11
12 // Download to permanent storage
13 const filename = `image_${Date.now()}.png`;
14 await downloadImage(tempUrl, `./images/${filename}`);
15
16 return {
17 filename,
18 originalPrompt: prompt,
19 revisedPrompt,
20 url: `/images/${filename}` // Your permanent URL
21 };
22}Understanding Revised Prompts:
DALL-E 3 often revises your prompt for safety and better results:
1const response = await openai.images.generate({
2 model: "dall-e-3",
3 prompt: "A cat"
4});
5
6console.log("Your prompt:", "A cat");
7console.log("Revised prompt:", response.data[0].revised_prompt);
8// Revised: "A fluffy orange tabby cat sitting on a windowsill,
9// looking curiously at a butterfly, soft natural lighting,
10// cozy home interior"Error Handling:
1async function generateImageSafe(prompt) {
2 try {
3 const response = await openai.images.generate({
4 model: "dall-e-3",
5 prompt: prompt,
6 size: "1024x1024"
7 });
8
9 return {
10 success: true,
11 imageUrl: response.data[0].url,
12 revisedPrompt: response.data[0].revised_prompt
13 };
14 } catch (error) {
15 if (error.code === 'content_policy_violation') {
16 return {
17 success: false,
18 error: "Your prompt violates content policy"
19 };
20 } else if (error.code === 'billing_hard_limit_reached') {
21 return {
22 success: false,
23 error: "API billing limit reached"
24 };
25 }
26
27 return {
28 success: false,
29 error: error.message
30 };
31 }
32}Effective prompt engineering is crucial for getting the exact images you want - learn to describe subjects, styles, composition, lighting, and details precisely.
Anatomy of a Great Image Prompt:
1. Subject (What):
2. Style (How it looks):
3. Composition (Layout):
4. Lighting & Color:
5. Quality Modifiers:
Prompt Template:
1[Subject] [doing action],
2[Style/medium],
3[Composition/camera angle],
4[Lighting],
5[Color palette],
6[Mood],
7[Quality modifiers]Examples of Effective Prompts:
Bad Prompt:
1"A dog"Good Prompt:
1"A golden retriever puppy playing in autumn leaves,
2professional photography, shallow depth of field,
3warm golden hour lighting, cozy and joyful atmosphere,
4high resolution, bokeh background"Photography-Style Prompts:
1// Portrait photography
2const prompt = `Professional portrait of a young entrepreneur,
3confident expression, modern office background,
4natural window lighting, shallow depth of field,
5shot with 85mm lens, f/1.8, professional DSLR camera,
6sharp focus on eyes, cinematic color grading`;
7
8// Product photography
9const productPrompt = `Luxury watch on marble surface,
10studio product photography, dramatic side lighting,
11black background, reflections on surface,
12high-end commercial photography, ultra-sharp detail,
134K resolution`;
14
15// Landscape photography
16const landscapePrompt = `Misty mountain range at sunrise,
17dramatic clouds, golden hour lighting,
18wide-angle landscape photography,
19vibrant colors, majestic and serene atmosphere,
20professional nature photography`;Artistic Style Prompts:
1// Digital art
2const digitalArt = `Cyberpunk city street at night,
3neon signs reflecting on wet pavement,
4digital art illustration, vibrant colors,
5futuristic atmosphere, high detail,
6trending on ArtStation`;
7
8// Watercolor
9const watercolor = `Vintage bicycle with flowers in basket,
10watercolor painting style, soft colors,
11loose brushstrokes, artistic and dreamy,
12white paper texture visible`;
13
14// 3D render
15const render3D = `Modern minimalist living room,
163D render, Blender, Unreal Engine,
17ray tracing, photorealistic lighting,
18clean and contemporary design,
19architectural visualization`;
20
21// Oil painting
22const oilPainting = `Portrait in the style of Van Gogh,
23oil painting, visible brushstrokes,
24vibrant impressionist colors,
25emotional and expressive,
26thick paint texture`;Composition Keywords:
1// Camera angles
2const angles = [
3 "bird's eye view",
4 "worm's eye view",
5 "eye level",
6 "dutch angle",
7 "over-the-shoulder",
8 "first-person perspective"
9];
10
11// Shot types
12const shots = [
13 "extreme close-up",
14 "close-up",
15 "medium shot",
16 "full body shot",
17 "wide shot",
18 "establishing shot"
19];
20
21// Framing
22const framing = [
23 "centered composition",
24 "rule of thirds",
25 "symmetrical",
26 "asymmetrical",
27 "leading lines",
28 "frame within frame"
29];Lighting Keywords:
1const lighting = [
2 "golden hour",
3 "blue hour",
4 "harsh midday sun",
5 "soft diffused light",
6 "dramatic side lighting",
7 "rim lighting",
8 "backlighting",
9 "studio lighting",
10 "natural window light",
11 "neon lighting",
12 "candlelight",
13 "moonlight"
14];Quality and Technical Modifiers:
1const qualityModifiers = [
2 "4K resolution",
3 "8K ultra HD",
4 "highly detailed",
5 "photorealistic",
6 "ultra-sharp",
7 "professional photography",
8 "award-winning",
9 "trending on ArtStation",
10 "cinematic",
11 "magazine quality"
12];Negative Prompts (What to avoid):
While DALL-E 3 doesn't support explicit negative prompts, you can guide away from unwanted elements:
1// Instead of negative prompts, be explicit about what you want
2const goodPrompt = `Clean, minimalist workspace with single laptop,
3uncluttered, simple, organized, professional`;
4
5// This implicitly excludes mess, clutter, complexityTesting and Iteration:
1class PromptExperiment {
2 async testPromptVariations(basePrompt, variations) {
3 const results = [];
4
5 for (const variation of variations) {
6 const fullPrompt = `${basePrompt}, ${variation}`;
7 const image = await generateImage(fullPrompt);
8
9 results.push({
10 variation,
11 prompt: fullPrompt,
12 imageUrl: image
13 });
14 }
15
16 return results;
17 }
18}
19
20// Test different styles
21const experiment = new PromptExperiment();
22const results = await experiment.testPromptVariations(
23 "A modern coffee shop interior",
24 [
25 "photorealistic, professional photography",
26 "watercolor illustration",
27 "minimalist line art",
28 "isometric 3D render"
29 ]
30);Edit existing images with AI inpainting, create multiple variations of concepts, and transform images with intelligent modifications.
Image Variations with DALL-E 2:
Note: DALL-E 3 doesn't support variations or editing. Use DALL-E 2 for these features:
1// Create variations of an existing image
2async function createVariations(imagePath) {
3 const response = await openai.images.createVariation({
4 model: "dall-e-2",
5 image: fs.createReadStream(imagePath),
6 n: 3, // Generate 3 variations
7 size: "1024x1024"
8 });
9
10 return response.data.map(img => img.url);
11}
12
13// Usage
14const variations = await createVariations("./original-image.png");
15console.log("Created variations:", variations);Image Requirements for Variations:
1// Image must be:
2// - Square (1:1 aspect ratio)
3// - PNG format
4// - Less than 4MB
5// - Power of 2 dimensions (e.g., 512x512, 1024x1024)
6
7async function prepareImageForVariation(inputPath, outputPath) {
8 // Use image processing library (sharp, jimp, etc.)
9 const sharp = require('sharp');
10
11 await sharp(inputPath)
12 .resize(1024, 1024, {
13 fit: 'cover',
14 position: 'center'
15 })
16 .png()
17 .toFile(outputPath);
18
19 return outputPath;
20}Image Editing with DALL-E 2:
1// Edit image with mask (inpainting)
2async function editImage(imagePath, maskPath, prompt) {
3 const response = await openai.images.edit({
4 model: "dall-e-2",
5 image: fs.createReadStream(imagePath),
6 mask: fs.createReadStream(maskPath),
7 prompt: prompt,
8 n: 1,
9 size: "1024x1024"
10 });
11
12 return response.data[0].url;
13}
14
15// Usage
16const editedImage = await editImage(
17 "./room.png",
18 "./room-mask.png", // White areas = edit, Black areas = keep
19 "A modern fireplace with stone surround"
20);Creating Edit Masks:
1// Mask image requirements:
2// - Same dimensions as original
3// - PNG with transparency OR black/white
4// - White/transparent = area to edit
5// - Black/opaque = area to keep
6
7async function createMask(imagePath, maskPath, regionToEdit) {
8 const sharp = require('sharp');
9
10 // Create a mask programmatically
11 const { width, height } = await sharp(imagePath).metadata();
12
13 // Create black background
14 const mask = sharp({
15 create: {
16 width,
17 height,
18 channels: 4,
19 background: { r: 0, g: 0, b: 0, alpha: 1 }
20 }
21 });
22
23 // Add white rectangle for edit region
24 await mask
25 .composite([{
26 input: Buffer.from(`<svg>
27 <rect x="${regionToEdit.x}" y="${regionToEdit.y}"
28 width="${regionToEdit.width}" height="${regionToEdit.height}"
29 fill="white"/>
30 </svg>`),
31 top: 0,
32 left: 0
33 }])
34 .png()
35 .toFile(maskPath);
36
37 return maskPath;
38}Practical Image Editing Examples:
1// Remove object from image
2async function removeObject(imagePath, objectDescription) {
3 // Create mask around object (requires object detection)
4 const maskPath = await detectAndMaskObject(imagePath, objectDescription);
5
6 return await editImage(
7 imagePath,
8 maskPath,
9 "Empty space, background continuation"
10 );
11}
12
13// Replace object
14async function replaceObject(imagePath, maskPath, newObjectDescription) {
15 return await editImage(
16 imagePath,
17 maskPath,
18 newObjectDescription
19 );
20}
21
22// Add object to scene
23async function addObject(imagePath, position, objectDescription) {
24 const maskPath = await createMask(imagePath, position);
25
26 return await editImage(
27 imagePath,
28 maskPath,
29 objectDescription
30 );
31}
32
33// Usage examples
34const noCouch = await removeObject("./living-room.png", "couch");
35const newCouch = await replaceObject(
36 "./living-room.png",
37 "./couch-mask.png",
38 "Modern blue velvet sofa"
39);
40const withPlant = await addObject(
41 "./room.png",
42 { x: 800, y: 400, width: 200, height: 400 },
43 "Tall indoor plant in decorative pot"
44);Style Transfer (Using Variations):
1// Generate image, then create variations with different styles
2async function createStyleVariations(basePrompt) {
3 // Generate base image
4 const baseImage = await generateImage(basePrompt);
5 await downloadImage(baseImage, "./base.png");
6
7 // Create variations
8 const variations = await createVariations("./base.png");
9
10 return {
11 base: baseImage,
12 variations
13 };
14}
15
16// Usage
17const styleSet = await createStyleVariations(
18 "A mountain landscape at sunset"
19);Batch Image Generation:
1async function generateBatch(prompts) {
2 const results = [];
3
4 for (let i = 0; i < prompts.length; i++) {
5 console.log(`Generating image ${i + 1}/${prompts.length}...`);
6
7 try {
8 const image = await generateImage(prompts[i]);
9 results.push({
10 prompt: prompts[i],
11 imageUrl: image,
12 success: true
13 });
14 } catch (error) {
15 results.push({
16 prompt: prompts[i],
17 error: error.message,
18 success: false
19 });
20 }
21
22 // Rate limiting - wait between requests
23 if (i < prompts.length - 1) {
24 await new Promise(resolve => setTimeout(resolve, 1000));
25 }
26 }
27
28 return results;
29}
30
31// Usage
32const prompts = [
33 "Modern kitchen interior",
34 "Cozy bedroom design",
35 "Minimalist bathroom"
36];
37
38const batch = await generateBatch(prompts);Deploy image generation features in production with proper error handling, cost optimization, content moderation, and user experience best practices.
Production-Ready Image Generation Service:
1class ImageGenerationService {
2 constructor() {
3 this.openai = new OpenAI({
4 apiKey: process.env.OPENAI_API_KEY
5 });
6 this.storage = new ImageStorage(); // Your storage solution
7 this.moderator = new ContentModerator();
8 }
9
10 async generate(userPrompt, options = {}) {
11 const {
12 size = "1024x1024",
13 quality = "standard",
14 style = "vivid"
15 } = options;
16
17 try {
18 // 1. Moderate prompt
19 const moderation = await this.moderator.checkPrompt(userPrompt);
20 if (!moderation.safe) {
21 return {
22 success: false,
23 error: "Prompt violates content policy",
24 details: moderation.reasons
25 };
26 }
27
28 // 2. Generate image
29 const response = await this.openai.images.generate({
30 model: "dall-e-3",
31 prompt: userPrompt,
32 size,
33 quality,
34 style
35 });
36
37 const tempUrl = response.data[0].url;
38 const revisedPrompt = response.data[0].revised_prompt;
39
40 // 3. Download and store permanently
41 const permanentUrl = await this.storage.saveImage(tempUrl);
42
43 // 4. Log generation
44 await this.logGeneration({
45 userPrompt,
46 revisedPrompt,
47 imageUrl: permanentUrl,
48 size,
49 quality,
50 style,
51 timestamp: new Date()
52 });
53
54 return {
55 success: true,
56 imageUrl: permanentUrl,
57 revisedPrompt,
58 cost: this.calculateCost(size, quality)
59 };
60 } catch (error) {
61 return this.handleError(error);
62 }
63 }
64
65 calculateCost(size, quality) {
66 const costs = {
67 "1024x1024": { standard: 0.040, hd: 0.080 },
68 "1024x1792": { standard: 0.080, hd: 0.120 },
69 "1792x1024": { standard: 0.080, hd: 0.120 }
70 };
71
72 return costs[size][quality];
73 }
74
75 handleError(error) {
76 if (error.code === 'content_policy_violation') {
77 return {
78 success: false,
79 error: "Content policy violation",
80 userMessage: "Your prompt doesn't comply with our content policy. Please try a different description."
81 };
82 }
83
84 if (error.code === 'rate_limit_exceeded') {
85 return {
86 success: false,
87 error: "Rate limit exceeded",
88 userMessage: "Too many requests. Please wait a moment and try again."
89 };
90 }
91
92 return {
93 success: false,
94 error: error.message,
95 userMessage: "Failed to generate image. Please try again."
96 };
97 }
98
99 async logGeneration(data) {
100 // Log to database for analytics and debugging
101 await database.imageGenerations.create(data);
102 }
103}
104
105// Usage
106const service = new ImageGenerationService();
107const result = await service.generate(
108 "A serene mountain lake at sunrise",
109 { quality: "hd" }
110);
111
112if (result.success) {
113 console.log("Image generated:", result.imageUrl);
114 console.log("Cost:", result.cost);
115} else {
116 console.error("Error:", result.userMessage);
117}Content Moderation:
1class ContentModerator {
2 async checkPrompt(prompt) {
3 // Use OpenAI moderation API
4 const response = await openai.moderations.create({
5 input: prompt
6 });
7
8 const result = response.results[0];
9
10 return {
11 safe: !result.flagged,
12 reasons: result.flagged ? Object.keys(result.categories).filter(
13 cat => result.categories[cat]
14 ) : []
15 };
16 }
17
18 async checkGeneratedImage(imageUrl) {
19 // Use Vision API to verify generated content
20 const analysis = await openai.chat.completions.create({
21 model: "gpt-4-vision-preview",
22 messages: [{
23 role: "user",
24 content: [
25 {
26 type: "text",
27 text: "Check if this image is safe and appropriate. Return JSON with safe (boolean) and concerns (array)."
28 },
29 {
30 type: "image_url",
31 image_url: { url: imageUrl }
32 }
33 ]
34 }],
35 response_format: { type: "json_object" }
36 });
37
38 return JSON.parse(analysis.choices[0].message.content);
39 }
40}Cost Optimization Strategies:
1class CostOptimizer {
2 // Use standard quality by default, HD only when necessary
3 chooseQuality(useCase) {
4 const hdUseCases = [
5 'print',
6 'large-format',
7 'professional',
8 'high-detail'
9 ];
10
11 return hdUseCases.includes(useCase) ? 'hd' : 'standard';
12 }
13
14 // Choose appropriate size
15 chooseSize(purpose) {
16 const sizes = {
17 'thumbnail': '1024x1024',
18 'social-media-square': '1024x1024',
19 'social-media-story': '1024x1792',
20 'banner': '1792x1024',
21 'blog-hero': '1792x1024',
22 'default': '1024x1024'
23 };
24
25 return sizes[purpose] || sizes.default;
26 }
27
28 // Implement caching for common prompts
29 async getCachedOrGenerate(prompt, options) {
30 const cacheKey = this.generateCacheKey(prompt, options);
31 const cached = await cache.get(cacheKey);
32
33 if (cached) {
34 console.log("Using cached image");
35 return cached;
36 }
37
38 const result = await generateImage(prompt, options);
39 await cache.set(cacheKey, result, 24 * 60 * 60); // Cache for 24 hours
40
41 return result;
42 }
43
44 generateCacheKey(prompt, options) {
45 return `dalle3_${crypto
46 .createHash('md5')
47 .update(JSON.stringify({ prompt, ...options }))
48 .digest('hex')}`;
49 }
50}User Experience Best Practices:
1class ImageGenerationUI {
2 async generateWithProgress(prompt, options) {
3 // Show progress to user
4 this.showProgress("Analyzing prompt...");
5 await new Promise(resolve => setTimeout(resolve, 500));
6
7 this.showProgress("Generating image...");
8 const result = await imageService.generate(prompt, options);
9
10 this.showProgress("Processing result...");
11 await new Promise(resolve => setTimeout(resolve, 500));
12
13 this.hideProgress();
14 return result;
15 }
16
17 showProgress(message) {
18 // Update UI with progress
19 console.log(message);
20 }
21
22 hideProgress() {
23 console.log("Complete!");
24 }
25
26 // Provide prompt suggestions
27 getPromptSuggestions(category) {
28 const suggestions = {
29 'photography': [
30 "Professional portrait with dramatic lighting",
31 "Product photography on marble surface",
32 "Landscape at golden hour"
33 ],
34 'illustration': [
35 "Cute cartoon character",
36 "Watercolor landscape",
37 "Digital art fantasy scene"
38 ],
39 'design': [
40 "Modern logo design",
41 "Minimalist icon set",
42 "Abstract geometric pattern"
43 ]
44 };
45
46 return suggestions[category] || [];
47 }
48
49 // Show generation cost before generating
50 async estimateCost(size, quality) {
51 const costs = {
52 "1024x1024": { standard: 0.040, hd: 0.080 },
53 "1024x1792": { standard: 0.080, hd: 0.120 },
54 "1792x1024": { standard: 0.080, hd: 0.120 }
55 };
56
57 return costs[size][quality];
58 }
59}Best Practices Summary:
1. Prompt Management:
2. Cost Control:
3. Error Handling:
4. Storage:
5. User Experience:
A complete image generation application with DALL-E 3 integration, prompt engineering tools, style selection, cost estimation, and professional image management features.
1// AI Image Generation with DALL-E 3
2import OpenAI from 'openai';
3
4const openai = new OpenAI({
5 apiKey: process.env.OPENAI_API_KEY
6});
7
8// Generate image
9async function generateImage(prompt, options = {}) {
10 const {
11 size = "1024x1024",
12 quality = "standard",
13 style = "vivid"
14 } = options;
15
16 const response = await openai.images.generate({
17 model: "dall-e-3",
18 prompt,
19 size,
20 quality,
21 style,
22 n: 1
23 });
24
25 return {
26 imageUrl: response.data[0].url,
27 revisedPrompt: response.data[0].revised_prompt
28 };
29}
30
31// Production-ready service
32class ImageGenerationService {
33 async generate(userPrompt, options) {
34 try {
35 // 1. Moderate prompt
36 const isSafe = await this.moderatePrompt(userPrompt);
37 if (!isSafe) {
38 return { error: "Prompt violates content policy" };
39 }
40
41 // 2. Generate image
42 const result = await generateImage(userPrompt, options);
43
44 // 3. Save permanently
45 const savedUrl = await this.saveImage(result.imageUrl);
46
47 return {
48 success: true,
49 imageUrl: savedUrl,
50 revisedPrompt: result.revisedPrompt,
51 cost: this.calculateCost(options)
52 };
53 } catch (error) {
54 return { error: error.message };
55 }
56 }
57
58 async moderatePrompt(prompt) {
59 const response = await openai.moderations.create({ input: prompt });
60 return !response.results[0].flagged;
61 }
62
63 async saveImage(tempUrl) {
64 // Download and save to permanent storage
65 return tempUrl; // Implement your storage logic
66 }
67
68 calculateCost(options) {
69 const costs = {
70 "1024x1024": { standard: 0.040, hd: 0.080 },
71 "1024x1792": { standard: 0.080, hd: 0.120 },
72 "1792x1024": { standard: 0.080, hd: 0.120 }
73 };
74 return costs[options.size][options.quality];
75 }
76}
77
78// Usage
79const service = new ImageGenerationService();
80const result = await service.generate(
81 "A serene Japanese garden with cherry blossoms",
82 { quality: "hd", style: "natural" }
83);This image generation platform demonstrates:
Core Features:
Prompt Engineering:
Production Features:
User Experience:
Excellent work mastering AI image generation! You can now create stunning images from text, optimize prompts for specific results, and implement image generation features in production. In our next lesson, "Speech and Audio with AI," you'll learn speech-to-text transcription with Whisper, text-to-speech generation, audio processing, and building voice-enabled applications. Get ready to add voice capabilities to your projects!
Your progress is saved in this browser, on this device only.