Universal Techniques — Weighting, Negative Prompts & img2img

Generative AI Prompting for Image Models

Chapter 7 · Universal Techniques — Weighting, Negative Prompts & img2img

imgai1-4imgai1-6 each covered one tool's own particular syntax. This chapter zooms back out to three techniques that recur — in some form — across most of them, despite genuinely different syntax: weighting individual terms, excluding content, and starting from an existing image rather than pure noise. Each section cross-references back to the tool-specific version already covered.

Term Weighting

A whole-prompt CFG scale (imgai1-5) controls how strongly the entire prompt's embedding pulls generation. Term weighting is the more granular version of the same idea — controlling how strongly one specific word or phrase contributes to that overall pull, relative to the rest of the prompt.

ToolSyntaxExample
Stable Diffusion (imgai1-5)Parenthetical numeric weight(red umbrella:1.4), rainy street
Midjourney (imgai1-4)Double-colon multipliersred umbrella::2 rainy street::1
DALL-E (imgai1-6)No direct syntax — described conversationally"make the umbrella much more prominent than the street", left to ChatGPT's own rewriting step
Weighting too aggressively causes the same problem as too-high CFG
A term pushed to an extreme weight distorts the same way an overall CFG scale pushed too high does (imgai1-5) — the network is being asked to amplify one piece of its own conditioning signal well past the range it was trained to handle sensibly, and the result degrades rather than simply "emphasizing more." imgai1-8 covers this class of failure — and several others — in full.

Negative Prompts, Recapped Across Tools

imgai1-4 and imgai1-5 already covered this in tool-specific depth — this section is a deliberately short recap, not new material. The goal is the same everywhere (exclude unwanted content), but the depth of mechanism genuinely differs:

ToolMechanism
Midjourney--no — a simple exclusion parameter (imgai1-4)
Stable DiffusionA full second prompt replacing the unconditional CFG baseline (imgai1-5)
DALL-ENo direct field — expressed conversationally ("don't include X"), interpreted by ChatGPT's own rewriting step (imgai1-6)

img2img — Starting From an Image, Not Pure Noise

imgai1-2 described generation as starting from pure random noise and denoising down to a coherent image. img2img changes the starting point: instead of pure noise, the process starts from a real, existing image with only a partial amount of noise added, then runs the same trained denoising steps from there. Because the starting point already resembles a real image rather than static, the result tends to preserve the original's overall composition and structure while the denoising process fills in whatever the new text prompt specifies.

The amount of noise added to the starting image — often exposed directly as a denoising strength parameter — controls the trade-off precisely: a low value keeps the result very close to the original image (only lightly re-touched by the prompt), while a high value approaches full, pure-noise generation, where the original image's influence becomes minimal.

ToolHow img2img is invoked
Stable DiffusionDirect — upload a reference image plus a denoising-strength value
MidjourneyAn image URL supplied alongside the prompt, weighted via --iw (imgai1-4)
DALL-EAttach a reference image in the chat and describe the desired change conversationally (imgai1-6)

Inpainting & Outpainting — A Genuinely Distinct Capability

img2img re-generates an entire image, just anchored to a starting point. Inpainting is more surgical: a mask marks a specific region of an existing image (a bad hand, an unwanted object), and only that masked region is regenerated — the rest of the image is held fixed at every denoising step, rather than merely encouraged to stay similar. Outpainting runs the same masking idea in reverse, extending an image past its original borders and generating new content in the newly added space that plausibly continues what's already there.

Both are available, with different interfaces, across all three tools — Stable Diffusion exposes inpainting/outpainting directly as a masking tool in most community interfaces; Midjourney and DALL-E both offer a comparable region-select-and-regenerate workflow through their own editing interfaces, without exposing the underlying masking mechanism directly.

Hands-On Exercises

Exercise 1

Explain, using this chapter's own weighting section and imgai1-5's own CFG formula, why term weighting is described as "the more granular version" of a whole-prompt CFG scale rather than an unrelated technique.

📄 View solution
Exercise 2

Using this chapter's own img2img section and imgai1-2's own description of generation from pure noise, explain what a low vs. a high denoising strength actually does to the balance between the original image and the new prompt.

📄 View solution
Exercise 3

Explain the real structural difference this chapter draws between img2img and inpainting — why is inpainting described as "more surgical" rather than just "img2img with a smaller area"?

📄 View solution

Chapter 7 Quick Reference

  • Term weighting — per-term version of CFG scale; SD uses parenthetical numeric weights, Midjourney uses :: multipliers, DALL-E has none directly (conversational instead)
  • Negative prompts — same goal everywhere, different depth: Midjourney's --no (simple exclusion) vs. SD's full second-prompt mechanism (imgai1-5)
  • img2img — start denoising from a real image with partial noise, not pure noise; denoising strength controls how much the original survives
  • Inpainting — regenerate only a masked region, rest held fixed · Outpainting — extend an image's borders with new, plausible content
  • Weighting/CFG pushed too far degrades output the same way — previewing imgai1-8's failure modes
  • Next chapter: Common Failure Modes & Honest Limitations