liveBook · Manning

Prompt engineering

As explained in Local Image Generation

Prompt engineering is the iterative design and refinement of input prompts to influence the outputs of a generative model.

Prompt engineering is the iterative design of prompts and settings to steer Stable Diffusion toward better images. Generate, inspect, tweak, and repeat; “engineering” is less blueprint and more educated prompt hacking. section 1.3 section 1.0

A practical workflow:

  • Prefer clear, descriptive terms over poetic wording when the goal is a specific visual result. section 1.3.1
  • Change one or more prompt terms, negative prompts, or generation settings, then compare the resulting images. section 1.3 section 2.0
  • Record the seed when testing changes so results remain reproducible. section 1.0 section 1.3.1
  • Study prompts recommended for a checkpoint because different models respond differently to keywords and phrases. section 5.2.2

From poetic coffee to a clearer prompt

“A damn fine cup of coffee, black as midnight on a moonless night” can produce inconsistent results. Replacing it with “A cup of black coffee” gives the model more direct guidance; generate several images, inspect them, and keep refining. section 1.3.1

Figure 1.18 A straight forward prompt yields more cups of black coffee.

Compare the straightforward coffee prompt with the earlier poetic attempt to see how wording changes the visible results. section 1.3.1

How Local Image Generation covers it

How deep it goes
Explains iterative practice, prompt clarity, reproducibility, and basic configuration, stopping short of a fully predictable formula.
Examples
Uses coffee prompts, explicit seeds, comparison images, negative prompts, checkpoint recommendations, and creator-provided prompt examples.
What it assumes
Starts with basic AUTOMATIC1111 use and teaches prompt refinement without requiring advanced machine-learning theory.
What you can do after
Apply it via AUTOMATIC1111 to generate, compare, reproduce, and refine Stable Diffusion images.
How it connects
Connects prompt engineering with negative prompting, prompt attention, classifier-free guidance, sampling steps, and custom checkpoints.

Also explained in

Compare how 51 books explain prompt engineering →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Local Image Generation. The section links point to the parts of the book it draws on.