Skip to content

Prompting for Image Generation | Lecture 17

Prompting for Image Generation

A conceptual overview of prompting for AI image generation models. Learn the key components of a good image prompt, including subject, style, and composition. Lecture 17

From Text to Pixels

Welcome back! While most of this course has focused on text-based AI, many of the same principles apply to the exciting world of text-to-image generation. These are models like Midjourney, Stable Diffusion, and DALL-E that create pictures from your words.

Today, we’ll do a conceptual overview of how to prompt for images. The core idea is the same: clear, detailed instructions produce better results.

The Key Components of an Image Prompt

A good image prompt is a recipe with several key ingredients. While you don’t need all of them every time, combining them gives you more control.

1. Subject

What is the main thing you want to see in the image? Be as specific as possible.

Simple Subject: a cat

Detailed Subject: A fluffy, orange tabby cat with green eyes, sleeping on a stack of books.

2. Style / Medium

What should the image look like? Is it a photograph? A painting? A cartoon?

Examples: photographoil paintingwatercolor sketch3D renderanime stylepixel artline drawing.

3. Composition / Framing

How should the subject be framed? Where is the “camera”?

Examples: close-up shotwide-angle landscapeportraitfrom a low anglemacro shot.

4. Lighting

Lighting dramatically affects the mood of an image.

Examples: soft morning lightdramatic studio lightingneon glowcinematic lightingbacklit.

5. Color

You can guide the color palette of the image.

Examples: vibrant and colorfulmonochromatic black and whitepastel colorsearthy tones.

6. Level of Detail and Realism

How realistic or detailed should it be?

Examples: highly detailed8kphotorealistichyperrealisticminimalistabstract.

Example: Building an Image Prompt from Scratch

Idea: I want a picture of a cool robot in a forest.

Prompt v1 (Simple):

A robot in a forest.

This is too vague. The result will be random.

Prompt v2 (Adding Detail):

Let’s add our components:

  • Subject: A tall, sleek, humanoid robot with glowing blue eyes.
  • Setting: Standing in a misty, ancient redwood forest.
  • Style: A realistic, cinematic photograph.
  • Lighting: Sunbeams filtering through the tall trees.
  • Detail: Highly detailed, 4k.

Prompt v3 (Putting it all together):

A cinematic photograph of a tall, sleek, humanoid robot with glowing blue eyes, standing in a misty, ancient redwood forest. Sunbeams are filtering through the tall trees. Highly detailed, 4k, photorealistic.

This prompt will produce a much more specific and dramatic image that is closer to our original vision.

Negative Prompts

Many image models also allow for negative prompts. This is where you tell the model what you don’t want to see. It’s a very powerful tool for removing common errors or unwanted elements.

Example Negative Prompt: ugly, blurry, bad anatomy, extra limbs, disfigured, watermark, text

Prompting for Image Generation
Prompting for Image Generation

Key Takeaways from Lecture 17

  • Image prompting uses the same core principle as text prompting: specificity is key.
  • Build your prompt by combining components: Subject, Style, Composition, Lighting, Color, and Detail.
  • Start with a simple idea and gradually add descriptive keywords and phrases.
  • Use negative prompts to tell the AI what to avoid, which can significantly improve image quality.
  • Image generation is highly iterative. Expect to try many variations of a prompt to get the perfect shot.

End of Lecture 17. You now have the conceptual tools to start creating visual art with AI. Next, we’ll learn how to evaluate the performance of our prompts and the AI’s responses.

Workflows with Multi-Step Prompts|Lectures 16

Najeeb Alam

Najeeb Alam

Technical writer specializes in developer, Blogging and Online Journalism. I have been working in this field for the last 20 years.