Sub topic 5
Setting constraints and excluding unwanted elements
This chapter assumes you can write a basic image prompt with subject, style, composition, lighting, and color, and that you have a creative brief like the one from the earlier chapter. Constraints are the part of the brief that says what the image must not contain and what limits it must respect. They matter because an image can match your prompt and still be unusable: a stray logo, a face you cannot clear, or a crowded corner where the headline should go.
What a constraint is
A constraint is a rule the finished image must obey. It comes from one of four places.
- Brand rules. No competitor colors, no off-palette backgrounds.
- Channel rules. Empty space for a headline, a safe zone for story overlays.
- Legal and ethical rules. No readable brand names, no identifiable real people, no copyrighted characters.
- Taste and context. No clutter, no stock-photo smiles, no alcohol in a fitness campaign.
Some constraints are positive ("empty space on the left for a headline"). Others are exclusions ("no text"). Treat both kinds as requirements, and write them into the brief before you write the first prompt.
Where exclusions live in a prompt
Tools handle exclusions in one of two ways. Check which your tool uses, because the wrong style can backfire.
| Tool behavior | How to exclude | Example |
|---|---|---|
| Separate negative prompt field (common in Stable Diffusion-style tools and some APIs) | List the unwanted items in that field, with no "no" or "don't" | `text, watermark, logo, extra fingers` |
| No negative field (most chat-based and conversational generators) | Write the exclusion as a sentence in the main prompt | `Do not include text, logos, or people.` |
| Tool-specific parameter (for example a flag that takes excluded terms) | Follow the tool's documentation | Varies |
In a negative prompt field, write the thing itself. Writing "no people" there can add the concept of people to the exclusion list in a confusing way for some models. In a plain-language prompt, a clear sentence works better than a bare list.
Why exclusions sometimes fail
Image models do not read a prompt as a set of logical rules. They turn the words into numeric representations and generate an image that is statistically consistent with them. This causes three common failures.
- Mentioning an item primes it. Writing "a beach with no umbrellas" puts the word "umbrellas" in the prompt. Some models will draw one. If a plain-language exclusion keeps failing, try rephrasing it as a positive description: "an empty beach with only sand and waves."
- Defaults leak in. If you ask for "a runner on a trail," many models add a person's face, a watch, or a branded shoe by default. Name the version you want: "a runner seen from behind, no visible logos on clothing."
- Long lists dilute. Ten exclusions compete with the rest of the prompt. Keep the list to the items that have actually appeared or that carry real risk.
The practical rule: start with a short exclusion list, then add items only when you see them in a result.
Turning a brief into constraints
The brief from the earlier chapter already holds the raw material. Here is the must_include and must_avoid section again, followed by how each line becomes prompt language.
{
"goal": "Drive sign-ups for the spring trail-running promotion",
"channel": "Instagram feed, 4:5 portrait",
"audience": "Recreational runners aged 25-40",
"mood": "energetic, optimistic",
"must_include": ["trail setting", "morning light", "space for a headline at the top"],
"must_avoid": ["readable text", "brand logos", "identifiable real people"],
"brand_colors": ["#0B3D91", "#F2A900"]
}| Brief line | Prompt language |
|---|---|
| `space for a headline at the top` | "Empty sky occupying the top third of the frame, no objects in that area." |
| `readable text` | "No text, letters, signs, or numbers anywhere in the image." |
| `brand logos` | "Plain clothing and shoes with no logos or markings." |
| `identifiable real people` | "A runner seen from behind at a distance, face not visible." |
| `brand_colors` | "Color palette of deep blue and amber." |
Notice that the "identifiable people" rule became a positive composition choice. That is more reliable than asking the model to avoid a concept. Hex codes in a prompt are inconsistent across tools, so describe the colors in words and match them exactly later in post-processing.
Building constraints in code
Structured fields make constraints easy to test one at a time. This extends the brief-to-prompt pattern: exclusions are a separate list, and the function either writes them into the prompt or returns them for a negative prompt field.
BRIEF = {
"subject": "a runner on a forest trail, seen from behind at a distance",
"style": "photographic, soft morning light, shallow depth of field",
"palette": "deep blue and amber",
"composition": "runner in the lower right, empty sky across the top third",
"avoid": ["text", "logos", "visible faces", "watermarks"],
}
def build_prompt(brief, supports_negative_field):
parts = [
brief["subject"],
brief["style"],
f"Color palette: {brief['palette']}",
f"Composition: {brief['composition']}",
]
avoid = ", ".join(brief["avoid"])
if supports_negative_field:
return ". ".join(parts) + ".", avoid
parts.append(f"Do not include: {avoid}")
return ". ".join(parts) + ".", None
prompt, negative = build_prompt(BRIEF, supports_negative_field=False)
print("PROMPT:", prompt)
print("NEGATIVE:", negative)
prompt, negative = build_prompt(BRIEF, supports_negative_field=True)
print("PROMPT:", prompt)
print("NEGATIVE:", negative)The second call shows the split: the main prompt stays clean and the exclusions go to a separate field. Keeping avoid as a list also lets you add or remove one item between runs, which is how you find out which exclusion does the work.
Layout constraints
Space for a headline is an exclusion too: you are excluding objects from a region. Describe it in three parts.
- Where. "Top third," "left half," "bottom quarter."
- What fills it. "Smooth sky," "blurred background," "plain wall." A named filler works better than "empty."
- What stays out. "No objects, horizon lines, or bright highlights in that area."
Models are weak at precise placement. Expect the space to be roughly where you asked, not exact. Check it by overlaying your real text box on the result. If the subject creeps into the zone, you can extend the canvas or crop in post-processing rather than regenerating.
Safe zones
Some channels cover part of the image with interface elements. Stories and short-video formats place profile names and reply bars near the top and bottom edges. Put important content away from those edges, and add a constraint such as "keep the main subject within the central 60 percent of the frame." Confirm the exact safe-zone dimensions in each platform's current ad specifications, because they change.
Checking results against constraints
Make the check mechanical. After each generation, go down the brief and mark each constraint pass or fail. A short checklist is enough.
- Is any text, number, or symbol visible, including on signs, clothing, or packaging?
- Is any logo or recognizable brand mark visible, including partial ones?
- Is any real or realistic identifiable face visible?
- Is the headline zone clear of objects and bright highlights?
- Is the subject outside the platform's safe zones?
- Are the colors close to the brand palette?
Zoom to 100 percent when you check. Small background details, such as tiny text on a distant sign, are where exclusions most often fail.
Edge cases
- Constraints that conflict. "Busy market scene" and "empty space for a headline" pull in opposite directions. Resolve the conflict in the brief, for example by choosing a blurred market in the lower half only.
- Exclusions that remove too much. "No people, no objects, no text" may give a bland, lifeless image. Keep exclusions to what is actually risky and describe what you do want.
- Models that ignore the exclusion every time. Stop retrying. Either remove the element in an editing step (inpainting or a retouching tool) or add the opposite as a positive description.
- Hidden text. Models often render pseudo-letters on shirts, boxes, and signs. Excluding "text" reduces it but rarely eliminates it. Plan to check for it and fix it afterwards.
- Brand names in prompts. Naming a competitor or a copyrighted character as a style reference can bring their marks and look into the image. Avoid it unless you have the rights.
Exercise
A prompt says "a street cafe with no people." Three of four generations show people in the background. Name two changes to try, and explain why the first one often works.
Show answer
First, rephrase positively: "an empty street cafe, tables and chairs only, early morning, quiet street." This often works because the original wording puts "people" into the prompt, which primes the model to draw them, while a positive description of an empty scene gives it nothing to latch onto. Second, if your tool has a negative prompt field, move the word "people" there (without "no"). If people still appear, remove them afterwards with inpainting.
Exercise
Your brief requires a clear top third for a headline, but generations keep placing treetops in that area. List three ways to fix this without changing the whole concept.
Show answer
(1) Describe what fills the zone: "clear blue sky across the top third." (2) Move the subject or camera in the prompt, for example "low camera angle looking up at the runner against open sky." (3) Generate on a taller canvas or crop so the extra sky is included, or extend the canvas in an editing tool and fill the new area with sky. Each keeps the concept and changes only the layout constraint.