Overview

1 Making our First Image: “A damn fine cup of coffee”

In this opening exploration of text-to-image generation, the reader is introduced to Stable Diffusion as a creative but unpredictable system that turns words into images. The main goal is to learn how to guide that system more effectively by understanding its interface, the role of prompts, and the importance of trying many outputs rather than expecting a perfect result on the first attempt. The chapter frames image generation as a process of discovery: generate broadly, then refine what you like.

To get started, the text walks through using AUTOMATIC1111’s Stable Diffusion WebUI as a practical beginner-friendly tool for working locally. It explains how to launch the interface, use the txt2img tab, and create an initial image from a simple prompt. It then shows how batch size and batch count can be combined to produce multiple images efficiently, emphasizing that having many variations makes it easier to identify the best result while staying within hardware limits.

The chapter also explains why reproducibility matters by introducing the seed, showing that the same seed can recreate the same “random” results and make comparisons meaningful. From there, it explores how image size and aspect ratio influence both composition and content, often in surprising ways. Finally, it begins prompt engineering by demonstrating that clear, concrete, descriptive prompts work better than vague or poetic ones, and that adding context or style cues can help shape the image toward a more satisfying and intentional outcome.

Stable Diffusion sure can create strange things, let’s try to avoid going too far in that direction.
Image of the upper portion of the A1111 UI.
Entering our prompt into A1111
The initial image created by our prompt: “A damn fine cup of coffee.”
Batch count and Batch size theoretically offer different ways to increase images generated
One configuration for generating 30 images at once.
30 different answer to the prompt “A damn fine cup of coffee”
Setting the value to -1 will give us a ‘random’ seed each time we hit ‘Generate’.
The recycle button will give us the seed we used previously.
The options for setting our Width and Height in the UI.
Images with a 5:3 landscape aspect ratio.
Using the same seed but reverting to 512x512 shows us the impact of aspect ratio and image size.
We can easily swap Width and Height values in A1111.
Images with a 3:5 aspect ratio .
Images with a 3:7 aspect ratio.
Images with a 4:1 aspect ratio.
A poetic prompt does not always yield poetic images.
A straight forward prompt yields more cups of black coffee.
Adding a scene to an image can help provide context.
Choosing a landscape aspect ratio helps display the counter.
Creating surrealistic images.
Images in the style of a wood etching.
I would say that’s a damn fine cup of coffee!

Summary

  • Generating with Stable Diffusion is an iterative process, in which we are constantly revising our settings and prompts.
  • Despite the many ways to improve images, it’s always a good idea to generate a variety of images to see if we find a particular one that stands out to us as pleasing.
  • Our prompts should be clear and descriptive. Giving some context for the object we’re prompting can change the image dramatically. Describing the style of the image can further let us change the feeling of the images we’re generating.
  • The aspect ratio that we use to generate an image can have a major impact on the way the image looks. Consider whether the image you want to create would look better as a square, a landscape or portrait.

FAQ

What is the main goal of Chapter 1, “Making our First Image: ‘A damn fine cup of coffee’”?The chapter’s goal is to help you create your first image with Stable Diffusion while learning the basics of using A1111, writing prompts, changing image size, generating multiple images, and making results reproducible with seeds.
What is A1111, and why does the chapter use it?A1111 is AUTOMATIC1111’s Stable Diffusion Webui, an open-source graphical interface for working with Stable Diffusion. The chapter uses it because it is beginner-friendly and makes it easier to create and customize images than the original command-line version.
How do I start A1111 after installing it?After installing it, run ./webui.sh on Linux or macOS, or ./webui.bat on Windows. Once it is running, open your browser to http://127.0.0.1:7860.
What is a prompt in text-to-image generation?A prompt is the natural-language description you give Stable Diffusion to tell it what kind of image to create. In this chapter, the prompt used is “A damn fine cup of coffee.”
Why does the chapter recommend generating many images instead of just one?Because Stable Diffusion has an element of chance, one image may be better than another even with the same prompt. Generating many images increases the chance of finding one that matches what you want.
What is the difference between batch size and batch count?Batch size is how many images are generated at the same time in one run, while batch count is how many runs or iterations are performed. Both can be combined to create more images overall.
Why does batch size use more VRAM?Because a larger batch size processes more images simultaneously on the GPU. That requires more GPU memory, so increasing batch size can quickly become limited by available VRAM.
What is a seed, and why is it important?A seed is the starting value for a pseudo-random number generator. Using the same seed with the same prompt and settings helps reproduce the same image output, which is useful for comparing changes.
How does image size affect Stable Diffusion results?Height and width change both the aspect ratio and the content of the image. Different sizes can noticeably alter the composition, and extreme aspect ratios can make results look odd.
Why does the chapter emphasize clear and descriptive prompts?Because Stable Diffusion does not truly “understand” your intention unless you describe it clearly. More specific prompts and context, such as adding “on a diner counter” or a style like “wood etching,” usually lead to better and more controlled results.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Local Image Generation ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Local Image Generation ebook for free