Sub topic 6
Iterating on results one change at a time
This chapter assumes you can write a basic image prompt with subject, style, composition, lighting, and color. It also assumes you have a creative brief for the image. If you have not written one yet, read the chapters on briefs and prompt anatomy first. The code examples use introductory Python and need no image library.
Why iteration needs a method
A first generation is rarely the final image. Most teams then start "fiddling": they rewrite half the prompt, switch the style, add three new details, and click generate again. When the new image looks better, they cannot say why. When it looks worse, they cannot say what to undo.
Systematic iteration fixes this. You change one element at a time, compare the result against a fixed reference, and write down what happened. This is the same idea as a controlled experiment. If only one thing changed, any difference in the output has one likely cause.
Image generators add a complication. Most tools use randomness. The same prompt can produce different images on each run. A good method has to separate the effect of your change from the effect of chance.
The working model
Think of every generation as the combination of three kinds of input:
- The prompt text, which holds the subject, style, palette, composition, and exclusions.
- The settings, such as aspect ratio, model version, guidance strength, and number of images per run.
- The seed, a number that starts the random process. Some tools expose it and some do not.
If you hold two of these fixed and change the third, you learn what the third does. Your iteration loop is built around that.
Step 1: Establish a baseline
Write the full prompt from your brief and generate a batch of at least four images. One image tells you almost nothing, because it may be a lucky or unlucky draw. Four to eight images show the typical output of that prompt.
Pick the one or two images that best represent the batch. These are your baseline. Save the exact prompt, the settings, and the seed if the tool shows it.
Then judge the batch against the brief, not against your taste in the moment. A short checklist works well:
- Does the image support the goal and channel in the brief?
- Is the subject correct and recognizable?
- Does the composition leave the space you need for a headline?
- Do the colors match the palette?
- Are any excluded elements present?
Write down which items fail. The failures tell you which element to change first.
Step 2: Change one element
Choose the element that causes the most important failure. Typical elements are:
| Element | Example change |
|---|---|
| Subject | "water bottle" becomes "stainless steel water bottle with a matte finish" |
| Style | "product photography" becomes "editorial product photography" |
| Lighting | "soft natural light" becomes "low golden morning light" |
| Composition | "right third" becomes "lower right, wide shot" |
| Palette | "cool blues" becomes "cool blues with one amber accent" |
| Exclusions | add "no people" |
| Setting | change aspect ratio or guidance strength |
Change that one cell and nothing else. If the lighting is wrong, edit the lighting phrase only. Resist the urge to also tidy the subject description while you are there.
Keep the prompt in structured fields
Editing a long sentence by hand makes accidental changes easy. Keeping the prompt as named fields, as in the earlier brief example, makes a one-field change obvious and repeatable. The script below builds a prompt from a baseline and applies exactly one override. It also records what changed.
BASELINE = {
"subject": "a stainless steel water bottle on a flat rock beside a mountain lake",
"style": "clean product photography, soft natural light, shallow depth of field",
"palette": "cool blues and warm gray",
"composition": "bottle on the right third of the frame, empty space on the left for a headline",
"avoid": "text, logos, people",
}
def build_prompt(brief):
parts = [
brief["subject"],
brief["style"],
f"Color palette: {brief['palette']}",
f"Composition: {brief['composition']}",
f"Do not include: {brief['avoid']}",
]
return ". ".join(parts) + "."
def vary_one(baseline, field, new_value):
if field not in baseline:
raise KeyError(f"Unknown field: {field}")
variant = dict(baseline)
variant[field] = new_value
return variant
variant = vary_one(
BASELINE,
"style",
"clean product photography, low golden morning light, shallow depth of field",
)
print("BASELINE:", build_prompt(BASELINE))
print("VARIANT: ", build_prompt(variant))
print("CHANGED: style")vary_one copies the baseline and replaces a single field. That structure makes it hard to change two things by mistake. The KeyError catches typos in field names.
Step 3: Control for randomness
Because outputs vary by run, a single new image cannot confirm that your edit worked. There are two ways to handle this.
- Fix the seed. If the tool lets you set a seed, reuse the baseline seed. With the same seed, same settings, and a small prompt edit, the new image usually stays close to the old one, so the differences are easier to attribute. This is not a guarantee. Large edits can still change the whole image, and some tools ignore or do not expose seeds.
- Compare batches. If you cannot fix the seed, generate the same number of images for the variant as for the baseline and compare typical results. Look for a pattern across the batch, such as "five of six images now show warm light."
Use the same batch size for every comparison. Comparing a batch of eight against a batch of two favors the larger batch, since it has more chances to contain a good image.
Step 4: Decide and log
After each pass, make one of three decisions:
- Keep. The change fixed the problem and did not break anything else. The variant becomes the new baseline.
- Revert. The change did not help or caused a new defect. Go back to the baseline.
- Refine. The direction was right but the effect was too weak or too strong. Adjust the same element again, for example "low golden light" to "very low golden light, long shadows."
Log every pass, including the failures. A log prevents you from retrying a change that already failed, and it lets a colleague reproduce your result. A simple file is enough.
import csv
from datetime import datetime, timezone
from pathlib import Path
LOG_PATH = Path("iteration_log.csv")
FIELDS = ["time_utc", "pass_no", "changed_field", "old_value", "new_value", "seed", "batch_size", "decision", "note"]
def log_pass(pass_no, changed_field, old_value, new_value, seed, batch_size, decision, note=""):
if decision not in {"keep", "revert", "refine"}:
raise ValueError("decision must be keep, revert, or refine")
is_new = not LOG_PATH.exists()
with LOG_PATH.open("a", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=FIELDS)
if is_new:
writer.writeheader()
writer.writerow({
"time_utc": datetime.now(timezone.utc).isoformat(timespec="seconds"),
"pass_no": pass_no,
"changed_field": changed_field,
"old_value": old_value,
"new_value": new_value,
"seed": seed,
"batch_size": batch_size,
"decision": decision,
"note": note,
})
log_pass(
pass_no=1,
changed_field="style",
old_value="soft natural light",
new_value="low golden morning light",
seed=421,
batch_size=4,
decision="keep",
note="Warmer mood in 4 of 4; palette still reads cool.",
)
print(LOG_PATH.read_text(encoding="utf-8"))Choosing what to change first
Not every failure deserves the same fix. Work from the largest structural problems to the smallest details. Fixing fine details before the structure is right wastes passes, because a structural change will undo them.
- Subject and composition. Is the right object in the right place with room for the headline? Fix this first.
- Style and lighting. These set the mood and the overall look.
- Palette. Adjust color once the scene is stable.
- Exclusions. Add exclusions for unwanted elements that keep appearing.
- Fine defects. Hands, edges, reflections, and small artifacts are best handled last, often with editing tools covered in the next chapter.
Common errors
- Changing several things at once. You cannot tell which edit helped. If you are short on time, group only edits that are clearly one idea, such as a lighting phrase that takes two words.
- Judging from one image. A single output may be an outlier. Compare batches of equal size.
- Drifting from the brief. After many passes, a pretty image can stop serving the goal. Re-read the brief every few passes.
- Piling on adjectives. Long prompts full of stacked descriptors often dilute each other. If a prompt keeps growing, remove something rather than adding more.
- Adding negatives that mention the unwanted thing. In some tools, naming an element in the main prompt, even with "no," makes it more likely to appear. If this happens, use the tool's separate negative prompt field when one exists, or rephrase positively.
- Not saving the baseline. Without the saved prompt and settings, you cannot revert.
When to stop iterating
Stop when the image meets every must-have in the brief. Do not wait for perfect. Small flaws can be fixed in post-processing, and text and logos are added afterward anyway.
Stop early and change approach in these cases:
- The same defect survives three passes. Try a reference image or an inpainting edit.
- Changes keep trading one defect for another. The prompt may be asking for something the model handles poorly, so simplify the request.
- You have spent your pass limit. Revisit the brief.
Exercise
Your baseline batch of four images has the right subject and composition, but the light looks flat and gray, and a person appears in two of the four images. What do you change first, and how do you handle the other problem?
Show answer
Make one change per pass. Start with the problem that matters most to the brief. If the brief says no people, add or strengthen the exclusion first, for example "Do not include: people" or the negative prompt field, then generate a batch of four and count how many still show a person. Next, in a separate pass, change only the lighting phrase, for example to "low golden morning light." Keep each change only if the new batch is better than the baseline, and log both passes.
Exercise
You rewrote the style, the palette, and the composition in one pass, and the new image looks much better. Why is that result still a problem for your workflow?
Show answer
You cannot tell which of the three edits caused the improvement, and one of them may have made something worse that the others hid. You cannot reuse the lesson on the next image or revert only the bad part. Go back to the baseline and apply the edits one at a time, comparing equal-sized batches, so each change is judged on its own.