Artificial Intelligence
Intermediate
80 mins
Teacher/Student led
+75 XP
What you need:
Chromebook/Laptop/PC or iPad/Tablet

Prompt Engineering for Images

In this lesson, you'll learn how to craft precise prompts to guide AI in creating images that match your vision. Explore key components like subject, style, and mood, and experiment with tools to generate unique visuals safely and creatively.
Learning Goals Learning Outcomes Teacher Notes

Teacher Class Feed

Load previous activity

    1 - Introduction

    In this session, you will explore how to use words effectively to guide AI in generating images. You will learn to create detailed prompts that help produce the exact images you envision, much like directing a digital artist. This lesson will equip you with the skills to craft precise prompts for impressive results. Throughout, we emphasise the importance of curiosity, enjoyment, and maintaining safety online.

    Prompt engineering involves carefully choosing and structuring words to communicate your ideas to AI systems. By refining your prompts, you can achieve more accurate and creative outcomes in image generation. This skill is essential for anyone interested in AI and digital creativity.

    Lesson Objectives

    • Learn how to write effective prompts for AI image generation.
    • Understand how words, tones, and structures influence the images produced by AI.
    • Break down the components of a prompt, including subject, setting, style, mood, and lighting.
    • Compare vague and specific prompts through examples.
    • Participate in interactive activities to construct prompts.
    • Complete a mini project by creating variations of your own prompts.
    Approach this lesson with an open and creative mindset – you are in control of the AI's output.

    2 - Using AI Image Generators

    By now you should have explored how artificial intelligence (AI) can transform text descriptions into visual images. This process relies on safe and accessible online tools such as Craiyon, Bing Image Creator, and Canva AI. These tools allow you to input text prompts and generate corresponding images in a secure manner.

    If you have not yet had the opportunity to experiment with these tools, we recommend doing so at this stage. You should examine basic prompts and observe how they can yield entertaining and varied results. For instance, a simple prompt such as 'a cat' might produce a range of interpretations, from realistic depictions to more abstract ones.

    Key Concepts from Before

    • AI interprets text prompts to create images based on trained data.
    • Basic prompts can lead to unpredictable results, highlighting the need for refinement.
    • Tools like those mentioned ensure a safe environment for creative exploration.
    Today, we will advance this knowledge by focusing on techniques to make your prompts more effective and precise, enabling you to achieve the exact outcomes you envision.
    Quick Activity: Take 5 Minutes to reflect on your prior experience. If you have used one of these AI tools before, write down one key aspect you recall about crafting prompts or using the tool. If you are new to them, select one tool from the list above, visit the site, and experiment with a simple prompt such as 'a tree'. Note your observations, including what you discover about the tool's functionality. 

    3 - Breaking Down Prompt Structure

    In prompt engineering, the structure of your prompt is essential for guiding the AI to generate the image you envision. Think of a prompt as a clear set of instructions, where each component contributes to the final result. By organising your prompt into key elements, you can achieve more precise and creative outcomes. In this step, we will examine the main components of an effective prompt: the subject, setting, style, mood, and lighting. Understanding these will help you take greater control over the AI's output.

    Key Components of a Prompt

    Let us define each component:

    • Subject: This is the main focus or central element of the image, such as a person, animal, object, or concept.
    • Setting: This describes the location or environment where the subject is placed, providing context and background.
    • Style: This refers to the artistic approach, such as realistic, cartoon, abstract, or inspired by a specific art movement.
    • Mood: This conveys the emotional tone or atmosphere, for example, happy, mysterious, or serene.
    • Lighting: This details how light is used in the scene, such as bright daylight, soft evening glow, or dramatic shadows.

    For instance, consider this example prompt: 'A fluffy unicorn (subject) in an enchanted forest (setting), in a whimsical cartoon style (style), with a magical mood (mood) under sparkling starlight (lighting)'. This structured approach ensures the AI interprets your instructions accurately.

    Prompt Template

    To help you get started, use this template: [Subject] in [setting], in [style] style, with [mood] mood and [lighting] lighting. 
    Activity: Take 5 minutes to fill in the template with your own ideas to create a prompt for a fantasy scene. Write it down and imagine what the resulting image might look like. Consider how each component influences the overall composition.
    Example: A unicorn in a forest, in cartoon style, with a joyful mood and golden hour lighting.

    4 - Vague vs Specific Prompts

    In prompt engineering, the level of detail in your prompt significantly influences the quality and accuracy of the AI-generated image. This step examines the differences between vague and specific prompts, demonstrating how added details can lead to more precise and engaging results.

    Understanding Vague Prompts

    A vague prompt provides minimal information, allowing the AI considerable freedom in interpretation. For example, a prompt such as 'a house' might result in a generic or unexpected image, such as a plain building without any distinctive features. This lack of specificity can lead to unpredictable outcomes, as the AI draws from a broad range of possibilities in its training data.

    Understanding Specific Prompts

    In contrast, a specific prompt includes detailed elements like subject, setting, style, mood, and lighting, guiding the AI towards a more targeted output. For instance: 'A cosy cottage in a snowy village, in watercolour style, with a warm, inviting mood under soft evening light.' This level of detail helps the AI produce an image that closely matches your vision, resulting in a more refined and intentional creation.

    Comparing the Two

    Vague prompts often yield broad or random results because they leave much to the AI's interpretation. Specific prompts, however, provide clear instructions, reducing ambiguity and enhancing control over the final image. Consider the example outputs: a simple 'house' might show a basic structure, while the detailed prompt could depict a charming, atmospheric scene. This comparison highlights the importance of precision in achieving desired results.

    Activity: Take 5 minutes to create a vague prompt for an animal, such as 'a dog.' Then, refine it into a specific version using the prompt structure, for example, 'A fluffy golden retriever playing in a sunny park, in realistic style, with a joyful mood under bright daylight.' Reflect on how the added details might alter the generated image and improve its relevance to your idea.

    5 - Matching Prompts

    In this activity, you will match components of a prompt to their correct descriptions. This exercise is designed to reinforce your understanding of prompt structure, helping you to identify and apply each element effectively when creating your own prompts for AI image generation.

    To complete the activity, review the list of prompt parts and their descriptions below. Then, use the dropdown menus to match each example to the appropriate component. Once you have made your selections, click the 'Check Answers' button to see if your matches are correct.

    Match the Prompt Parts

    • Subject: The main focus or central element of the image.
    • Setting: The location or environment in the image.
    • Style: The artistic approach or visual style.
    • Mood: The emotional tone or atmosphere.
    • Lighting: The way light is used in the scene.
    Activity: Select the correct component for each example using the dropdowns, then check your answers. If you don't get them all right, try again to deepen your understanding.

    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2025. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more