Guide
Ideogram v4.5 Image-to-Image Prompt Recipes for Developers
Copy-paste editing prompts for subject fidelity, background swaps, and text preservation
On this page
Why Image-to-Image Prompts Need a Different Structure
Text-to-image prompts describe a scene. Image-to-image prompts negotiate with an image that already exists. That difference is structural, not cosmetic, and it is the main reason prompts that work well from scratch produce muddy results when fed a reference.
When you describe a scene, every token is additive: you are filling an empty canvas. When you edit an image, every token is either a preservation instruction or a mutation instruction, and the model has to decide which is which. A prompt that says only "a woman in a red jacket in a cafe" leaves the model free to redraw the face, restyle the jacket cut, and reinvent the room. It has no reason to keep anything, because you never asked it to.
The fix is to write edits as a two-lane instruction: one lane states what must survive the edit, the other states what should change. Everything later in this guide assumes that split. The keep lane is not decoration — it is the contract that stops the model from re-rolling details you already approved.
A quick mental test before you write any edit prompt: read your draft and ask "if the model changed this, would the output be wrong?" If yes, the detail belongs in the keep lane. If it belongs in the keep lane but you only mentioned it in passing inside a descriptive sentence, move it to the front and phrase it as an instruction.
Two consequences follow from this. First, edit prompts are usually shorter than generation prompts, because you are not re-describing what the reference already shows — you are describing the delta. Second, they are more literal: imperative phrasing ("keep", "do not change", "replace only") reads more reliably than adjectives. The recipes below are all built on those two habits.

The Base Recipe: Anatomy of an Edit Instruction
Every recipe in this guide is a variation on one skeleton. Learn the skeleton and you can rebuild any recipe from memory.
The five slots
- Edit intent — one sentence naming the operation and its scope ("Change only the background of this product photo.").
- Preserve clause — an explicit list of what must not change (identity, geometry, text, color, crop).
- Change clause — what to modify, described concretely enough to be actionable.
- Style / integration clause — how the new element must blend with the old one (lighting direction, shadow softness, perspective, grain).
- Constraints — hard limits and exclusions (no new objects, no text changes, no reframing).
A fill-in-the-slots template
Edit intent: <operation> on <target region>.
Preserve: <subject identity>, <geometry/pose>, <text and layout>, <color and material>.
Change: <what to replace or add>, <how much of the frame it covers>.
Integrate: match <light direction>, <shadow behavior>, <perspective>, <film grain / noise>.
Constraints: do not <failure mode 1>; do not <failure mode 2>; keep <critical edge> clean.
Order matters more than you might expect. Putting the preserve clause before the change clause anchors the subject before the model starts painting the new region, which measurably reduces identity drift in practice. Putting integration after the change clause keeps blending instructions attached to the thing being blended.
Keep the edit intent narrow
One prompt, one operation. "Swap the background and also update the headline font" is two edits, and models tend to do the harder one at the expense of the easier one. Run them as two passes instead, feeding the output of the first into the second. That chaining pattern is what the layout and text recipe later in this guide relies on.
Make slots reusable
Teams get reproducibility by freezing the wording of slots that rarely change — preserve and constraints — and editing only the change and integration clauses per job. Write those frozen strings down once, keep them in a shared constant, and your prompts stop drifting between authors. The rest of this guide gives you starting values for each slot family.

Recipes for Subject Fidelity
Subject fidelity is the slot most people under-specify. "Keep the subject" is too vague to bind anything; models interpret it as "keep something subject-like." Name the attributes you care about.
Recipe: face-preserving context change
Edit intent: change the setting around the person in this photo; the person is not the edit target.
Preserve: the person's facial identity, facial proportions, skin tone, hairline and hairstyle, expression, pose, and body proportions.
Change: the environment behind and around the person to <new scene>.
Integrate: relight the person's edges to match the new scene's <light direction> and <color temperature>; keep shadow softness consistent with the new environment.
Constraints: do not smooth, beautify, or re-synthesize the face; do not change the head angle; do not alter clothing cut or color.
The do not smooth or beautify line earns its place. Photo models default toward cosmetic retouching, and without that constraint a background swap quietly returns a different-looking person.
Recipe: product and packaging consistency
Edit intent: place the product from this image into a new scene.
Preserve: product silhouette, proportions, label placement, typography on the label, cap and seam geometry, material finish, and brand colors.
Change: the surface it rests on and the surrounding scene to <new setting>.
Integrate: match perspective and horizon; add a contact shadow and a plausible reflection on <surface>; match overall exposure to the new scene.
Constraints: do not redraw the label; do not add or remove product features; do not change the camera angle.
For packaging, the label is the identity. If it distorts, the edit fails commercially even if the render looks good.
Recipe: character and illustration continuity
Edit intent: keep the character exactly as drawn and change only their surroundings.
Preserve: character proportions, line weight, facial design, marking and pattern placement, outfit design, and palette.
Change: the background and props around the character to <new context>.
Integrate: keep the illustration style, stroke consistency, and shading language identical to the reference.
Constraints: do not add costume details; do not change the art style; do not alter character scale relative to the frame.
What to do when fidelity still slips
If identity drifts after two attempts, stop rewording the change clause — the problem is usually scope. Crop the reference tighter around the subject so it occupies more of the frame, or reduce the size of the region you are asking the model to replace. Fidelity problems are frequently framing problems wearing a prompt costume.

Recipes for Background Replacement
Background swaps fail in two characteristic ways: a halo or fringe around the subject edge, and a new scene whose light does not agree with the subject's original lighting. Both are addressed by the integration clause, not by describing the new background in more detail.
Recipe: clean-edge studio swap
Edit intent: replace the background only; the subject remains untouched.
Preserve: the subject's outline down to fine edges — hair strands, fur, fabric edges, transparent or reflective parts.
Change: the background to <seamless backdrop / gradient / studio sweep>.
Integrate: light the backdrop independently of the subject; keep the subject's existing key light direction; do not add a colored spill onto the subject.
Constraints: no fringe or halo at the subject edge; no background color bleeding into hair or translucent materials; do not crop or rescale the subject.
Naming the fringe explicitly is the highest-value line here. Without it, matte-style halos are a common default on hair and translucent packaging.
Recipe: environment swap with matched lighting
Edit intent: replace the location around the subject.
Preserve: subject identity, pose, scale, and position in frame; existing shadow shape on the subject is the reference for light direction.
Change: the environment to <new location>, including depth cues appropriate to that location.
Integrate: derive the new light direction and color temperature from the subject's existing highlights; add environment contact shadows under the subject; match depth of field and grain to the reference.
Constraints: no duplicated light sources; do not introduce reflections that contradict the new scene; do not change the subject's cast shadow direction relative to the new light.
Telling the model to derive lighting from existing highlights is more reliable than describing the light in prose. The reference already encodes the truth; your prompt just points at it.
Recipe: partial background edit
Edit intent: modify only the region behind the subject below the shoulder line.
Preserve: everything above that line, including the subject and the existing upper background.
Change: the lower background to <new content>.
Integrate: continue the perspective and color grade of the untouched upper region seamlessly across the boundary.
Constraints: no visible seam; no change to subject edges; do not shift the subject.
Region-scoped edits are how you avoid re-rolling a background you already like. State the boundary in plain spatial language — models read it more consistently than percentage coordinates.
Recipes for Preserving Layout and Text
Typography is where a single generic prompt leaks worst. Text is the first thing to melt and the last thing you notice until a client sees it. Treat text as a locked layer and say so.
Recipe: poster with locked typography
Edit intent: change the imagery in this poster; the text layer is locked.
Preserve: every character of existing text, including exact spelling, capitalization, punctuation, font style, weight, size, line breaks, alignment, and position in the layout.
Change: the photographic or illustrative elements <describe region>.
Integrate: keep the same margins and grid; ensure the new imagery does not sit behind or overlap any text.
Constraints: do not re-render, re-typeset, or paraphrase any text; do not add new copy; do not change contrast between text and its immediate background.
The do not paraphrase constraint matters: models sometimes "correct" copy while preserving its shape, which is worse than visible corruption because it passes a quick glance.
Recipe: screenshot and UI asset edit
Edit intent: update visual styling of this interface asset without changing its content.
Preserve: all labels, numbers, icons' meaning, component positions, spacing, and reading order.
Change: <color theme / border radius / shadow depth> only.
Integrate: apply the change consistently across all matching components.
Constraints: do not add, remove, or reorder UI elements; do not alter any glyph; keep text legible at the original size.
Recipe: branded asset with logo
Edit intent: place this branded asset into a new context.
Preserve: logo geometry, letterforms, clear space around the mark, and brand colors exactly.
Change: the surrounding composition to <new layout or scene>.
Integrate: match the new composition's perspective while keeping the logo flat and undistorted.
Constraints: do not redraw, restyle, or outline the logo; do not place the logo on a busy area that reduces contrast; do not crop the clear space.
Practical note on chaining
If both imagery and text must change, run two passes: lock the text and edit imagery first, then edit the text layer alone with the imagery locked. Multi-operation prompts fight each other; sequential passes do not. Keep the preserve clause from pass one intact in pass two so the text edit does not undo the imagery work.
Building a Negative Checklist
Negative instructions in image-to-image are not a second prompt — they are a regression list. Keep it short, keep it specific to the failure modes you have actually seen, and attach it to the constraints slot of your template rather than appending it as an afterthought.
The recurring failure modes
- Identity drift — face or product subtly resynthesized. Negative:
do not alter facial features; do not smooth or beautify skin; do not redraw the product label. - Edge artifacts — halos, fringes, jagged mattes on hair or translucent materials. Negative:
no halo or fringe at subject edges; no background bleed into hair. - Lighting mismatch — new scene disagrees with subject highlights or shadows. Negative:
no conflicting light directions; no duplicated shadows; no colored spill on the subject. - Text corruption — melted, misspelled, or silently paraphrased copy. Negative:
do not re-typeset or paraphrase any text; do not add copy. - Layout creep — elements shift, margins change, components reorder. Negative:
do not move, resize, or reorder existing elements. - Scope bleed — the model edits regions you did not ask about. Negative:
change only <region>; leave the rest of the frame untouched. - Style substitution — a photo becomes illustration, or a flat illustration gains photoreal shading. Negative:
do not change the medium or rendering style.
Keep the list disciplined
Three to six negatives per prompt is the practical range. A long negative list dilutes attention and can suppress legitimate detail, so prune anything you have not personally observed regressing. Store the checklist as a shared list, let each recipe reference the subset it needs, and version it — when a new failure mode appears in review, it gets added once and inherited everywhere.
One more habit worth adopting: when an edit fails, write the failure down as a candidate negative before you rewrite the positive prompt. Teams that do this converge on stable prompts much faster than teams that rewrite from scratch each time.
Testing and Iterating Recipes in Code
Prompt recipes only become assets when they are executable. A lightweight loop is enough: hold the recipe constant, vary one slot, generate, compare, tighten.
Structure recipes as data
Keep the frozen slots as constants and the variable slots as parameters. That way a "test" is just a different argument, not a different string assembled by hand.
RECIPE = {
"intent": "Change only the background of this product photo.",
"preserve": "product silhouette, label typography, brand colors, camera angle",
"integrate": "match the new scene's light direction and add a contact shadow",
"constraints": [
"do not redraw the label",
"no fringe at the product edge",
"do not change the camera angle",
],
}
def build_prompt(recipe, change, negatives):
return (
f"Edit intent: {recipe['intent']}\n"
f"Preserve: {recipe['preserve']}.\n"
f"Change: {change}.\n"
f"Integrate: {recipe['integrate']}.\n"
f"Constraints: {'; '.join(recipe['constraints'] + negatives)}."
)
The iteration loop
- Freeze the reference image and every slot except the one under test.
- Vary one thing — usually the change clause or a single negative.
- Generate the variants through the same image-to-image call so the only difference is prompt text.
- Compare against the preserve clause item by item: identity, geometry, text, light. Score pass/fail per item rather than "looks good."
- Revise the wording, then rerun. Promote a wording to the shared recipe only after it passes twice.
What to log
Store the full prompt, the recipe version, the reference image identifier, and the pass/fail per preserve item. When someone asks why a recipe is worded oddly, that log is the answer — and when a model or endpoint changes behavior, you can diff against the last known-good run instead of guessing.
Ship the recipes, not the prompts
A prompt is a one-off; a recipe with named slots and a negative checklist is a team artifact. Version it, review changes to it like code, and keep the change history attached. That is what makes image-to-image editing reproducible across people and across time.
When you are ready to wire these recipes into a real pipeline, the image-to-image endpoint on HiAPI.ai accepts the same prompt structure and keeps billing tied to your usage, with current rates on the pricing panel.
Related articles
View all articles →-
Guide
gpt-6.2-sol Getting Started Guide: Capability Boundaries, API Integration, and Token Pricing Essentials
Integration decisions and practical essentials for engineering teams
-
Guide
gpt-6.2-astra Getting Started Guide: Text Model Capability Boundaries, Integration Essentials, and Cost Control
-
Guide
Tripo H3.1 Getting Started Guide: Choosing Among Three Input Modes, Parameters, and Pricing
A practical guide for developers on 3D generation integration decisions and cost control