Bird
Raised Fist0
Prompt Engineering / GenAIml~20 mins

Text-to-image prompt crafting in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Text-to-Image Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding prompt specificity in text-to-image generation

Which of the following prompts is most likely to generate a clear and detailed image of a red apple on a wooden table?

A"A colorful scene"
B"A fruit on a surface"
C"A red apple on a wooden table with natural lighting"
D"An object"
Attempts:
2 left
💡 Hint

Think about how adding details helps the AI understand what to draw.

Predict Output
intermediate
2:00remaining
Output of a prompt with conflicting style instructions

What is the most likely visual style of the image generated by this prompt?

"A futuristic cityscape, painted in the style of a watercolor and photorealistic"
AA purely photorealistic image with sharp details and no painterly effect
BA black and white sketch
CA flat cartoon-style image with no texture
DAn image blending soft watercolor textures with realistic city details
Attempts:
2 left
💡 Hint

Consider how AI models combine multiple style keywords.

Model Choice
advanced
2:00remaining
Choosing the best model for detailed text-to-image generation

You want to generate high-resolution images with fine details from complex prompts. Which model is best suited?

AA large diffusion-based model trained on diverse high-res images
BA simple GAN trained on low-res images
CA text-only language model without image generation capability
DA small lightweight model optimized for speed but low detail
Attempts:
2 left
💡 Hint

Think about model size, training data, and architecture for image quality.

Hyperparameter
advanced
2:00remaining
Effect of guidance scale on image generation

In text-to-image generation, increasing the guidance scale parameter typically causes the output to:

ABecome more closely aligned with the prompt but less diverse
BBecome more random and less related to the prompt
CRun faster but with lower image quality
DGenerate images with fewer colors
Attempts:
2 left
💡 Hint

Guidance scale controls how strongly the model follows the prompt.

🔧 Debug
expert
2:00remaining
Diagnosing poor image output from a text-to-image model

You input the prompt "A sunny beach with palm trees" but the generated image is mostly dark and blurry. Which is the most likely cause?

AThe prompt is too vague and lacks style or lighting details
BThe model was run with a very low number of inference steps
CThe model is trained only on indoor scenes
DThe prompt contains unsupported special characters
Attempts:
2 left
💡 Hint

Consider how inference steps affect image clarity.

Practice

(1/5)
1. What is the main purpose of crafting a text-to-image prompt?
easy
A. To describe what image you want the AI to create
B. To write code for training the AI model
C. To edit images after they are generated
D. To choose colors manually in the image

Solution

  1. Step 1: Understand the role of a prompt

    A prompt is a description that tells the AI what image to make.
  2. Step 2: Identify the correct purpose

    Only To describe what image you want the AI to create matches this role by describing the desired image.
  3. Final Answer:

    To describe what image you want the AI to create -> Option A
  4. Quick Check:

    Prompt = Image description [OK]
Hint: Prompts tell AI what to draw, not how to code [OK]
Common Mistakes:
  • Confusing prompt with coding instructions
  • Thinking prompt edits images directly
  • Assuming prompt sets colors manually
2. Which of the following is the correct way to write a prompt for a text-to-image AI?
easy
A. def create_image(): return 'beach'
B. "A sunny beach with palm trees and clear blue water"
C.
D. SELECT * FROM images WHERE type='beach'

Solution

  1. Step 1: Identify prompt format

    Prompts are plain text descriptions, not code or HTML.
  2. Step 2: Match the correct option

    "A sunny beach with palm trees and clear blue water" is a clear text description suitable as a prompt.
  3. Final Answer:

    "A sunny beach with palm trees and clear blue water" -> Option B
  4. Quick Check:

    Prompt = Plain text description [OK]
Hint: Prompts are simple text, not code or tags [OK]
Common Mistakes:
  • Using code or HTML instead of text
  • Confusing prompts with programming functions
  • Trying to query images with SQL as prompt
3. Given the prompt "A red apple on a wooden table, photorealistic style", what kind of image will the AI most likely generate?
medium
A. A cartoon apple with bright colors
B. A blurry sketch of an apple
C. A detailed, realistic photo of a red apple on wood
D. A text-only image with the words 'red apple'

Solution

  1. Step 1: Analyze prompt details

    The prompt says "photorealistic style" and describes a red apple on a wooden table.
  2. Step 2: Match prompt to image type

    The AI will generate a detailed, realistic photo-like image matching the description.
  3. Final Answer:

    A detailed, realistic photo of a red apple on wood -> Option C
  4. Quick Check:

    Photorealistic prompt = Realistic image [OK]
Hint: Look for style words like 'photorealistic' to guess output [OK]
Common Mistakes:
  • Ignoring style words and expecting cartoons
  • Confusing text prompts with text images
  • Assuming blurry or sketch style without prompt
4. You wrote the prompt "A futuristic cityscape at night, neon lights, cyberpunk style" but the AI generated a daytime image without neon colors. What is the likely problem?
medium
A. The prompt lacks style details
B. The AI model ignored the style keywords
C. The prompt is too short and unclear
D. The prompt should specify 'night' and 'neon' more clearly

Solution

  1. Step 1: Check prompt clarity

    The prompt mentions 'night' and 'neon lights' but may not emphasize them enough for the AI.
  2. Step 2: Improve prompt specificity

    Adding stronger emphasis or repeating keywords helps AI focus on night and neon colors.
  3. Final Answer:

    The prompt should specify 'night' and 'neon' more clearly -> Option D
  4. Quick Check:

    Clear, strong keywords = better AI focus [OK]
Hint: Be very clear and repeat key style words in prompts [OK]
Common Mistakes:
  • Assuming AI always understands subtle style hints
  • Not emphasizing important details enough
  • Blaming AI model instead of prompt clarity
5. You want to create a unique image of a "cat astronaut exploring Mars" with a watercolor painting style. Which prompt will most likely produce the best result?
hard
A. "A cat astronaut on Mars, watercolor painting, soft colors, detailed background"
B. "A cat on Earth, digital art style, bright colors"
C. "An astronaut on Mars, oil painting style, no animals"
D. "A dog astronaut exploring space, cartoon style"

Solution

  1. Step 1: Match subject and style

    "A cat astronaut on Mars, watercolor painting, soft colors, detailed background" includes the cat astronaut, Mars setting, and watercolor style as requested.
  2. Step 2: Check other options

    Options B, C, and D miss key elements like the cat, Mars, or watercolor style.
  3. Final Answer:

    "A cat astronaut on Mars, watercolor painting, soft colors, detailed background" -> Option A
  4. Quick Check:

    Complete, clear prompt = best image [OK]
Hint: Include all key subjects and style words clearly in prompt [OK]
Common Mistakes:
  • Leaving out main subject or style
  • Mixing up animals or settings
  • Using vague or unrelated descriptions