Back to generator

Core pipeline reference

What the model sees, step by step.

Every card below represents one gpt-image-2 edit request. Images are shown in the exact order sent by the server, followed by their interpretation and instruction template.

Runtime template variables

${foamInsideColorId}${foamOutsideColorId}${AMLogoColorId}${soleColorId}${laceColorId}

The docs preserve placeholders. Runtime values are only interpolated when the generator builds a request.

5

edit requests currently triggered

3

additional edit requests defined

1024 x 1024

high-quality output from each call

1

Hero side view

Runs now

Recolors the AM logo and layered sole materials from one base image and one multi-color mask.

Output

generatedImage1

Ordered image payload

main-image1.pngIMAGE 1

main-image1.png

Primary/base image

image1-mask.pngIMAGE 2

image1-mask.png

Multi-color spatial mask

The server converts these references to files in this exact order, then sends the array as image to gpt-image-2.

How references are interpreted

Image 1 is the primary reference and must remain unchanged outside masked regions.
Image 2: black = AM logo, red = internal midsole, blue = outsole traction.
The prompt also requests a transparent outer shell color, but the mask list does not assign a separate shell region.
Instruction templateExpand prompt
Use the provided base image as the primary reference image. 
                The second image is a multi-color spatial mask that defines the only regions where edits are allowed. 
                Interpret mask colors independently. Each mask color represents a separate edit layer. 
                Do not blend, merge, or cross-apply edits between mask regions. Mask color assignments: 
                Black mask region = AM logo 
                Red mask region = Internal midsole layer 
                Blue mask region = Outsole traction/gripper elements 
                Only modify the regions corresponding to their assigned mask colors. 
                Do not modify any areas outside the mask. 
                Preserve the original composition, shoe geometry, proportions, stitching, mesh materials, textures, layered sole construction, lighting, shadows, reflections, camera framing, exposure, contrast, white balance, background, and premium commercial footwear product photography appearance. 
                Preserve maximum fidelity to the original image and apply only the minimum modifications required for the specified color changes. 
                The shoe contains a layered sole construction consisting of: 
                A bottom outsole traction/gripper layer, 
                An internal colored midsole layer, 
                An outer translucent rubber shell surrounding the sole. 
                The translucent outer rubber shell must remain completely unchanged in material appearance, translucency, opacity, texture, thickness, cream coloration, and light diffusion behavior. 
                Apply the following edits:

                Black Mask Region (AM Logo): Change the AM logo color to ${AMLogoColorId}. 
                Preserve the original logo material properties, texture detail, shading, highlights, surface response, and realistic lighting interaction. 
                Maintain the appearance of molded footwear branding with natural reflections and material realism. 

                Red Mask Region (Internal Midsole Layer): Change only the underlying internal midsole layer to a ${foamInsideColorId} tone. 
                Do not recolor the outer translucent rubber shell. 
                The ${foamInsideColorId} color must appear naturally diffused, softened, and slightly desaturated through the semi-translucent cream rubber surrounding the sole. 
                Preserve realistic translucency, subsurface scattering, shadow gradients, edge highlights, depth, and optical behavior of the layered sole construction. 
                Maintain the perception that the ${foamInsideColorId} color exists beneath the translucent shell rather than on its surface.

                Change the translucent sidewall shell to a very ${foamOutsideColorId} transparent TPU/rubber material while preserving strong visibility of the underlying ${foamInsideColorId} midsole beneath it. 
                The ${foamOutsideColorId} sidewall must behave like a low-opacity transparent dyed material rather than an opaque or frosted rubber. 
                The underlying ${foamInsideColorId} midsole should remain clearly readable and visually dominant through the ${foamOutsideColorId} translucent shell.

                Preserve the layered optical separation between: 
                the ${foamOutsideColorId} transparent outer shell the internal ${foamInsideColorId} midsole core. 
                The ${foamOutsideColorId} shell should function as a subtle transparent color filter over the ${foamInsideColorId} layer rather than obscuring it. 
                Maintain realistic optical depth, translucency, internal light transmission, edge glow, soft subsurface scattering, thickness variation, and transparent material realism. 
                Avoid cloudy, milky, opaque, heavily frosted, or highly diffuse ${foamOutsideColorId} rubber appearances.

                The material should resemble lightly dyed transparent TPU or clear tinted urethane commonly used in premium performance footwear. 
                Preserve realistic reflections, shadow gradients, sole geometry, stitching alignment, edge highlights, and layered construction details. 
                Maintain the original studio lighting, clean white background, and high-end commercial footwear photography aesthetic. 
                Apply only the minimum necessary modification required for the material color change.

                Blue Mask Region (Outsole Gripper / Traction Elements): Change the outsole traction/gripper components to a ${soleColorId} rubber material. 
                Preserve the original tread geometry, edge sharpness, contact shadows, material texture, and physical realism. 
                The ${soleColorId} outsole should appear as durable performance footwear rubber with subtle matte texture. 
                Maintain clear separation between the outsole components and the translucent sidewall shell above them. 
                Maintain the original studio lighting, clean white background, premium commercial footwear photography aesthetic, and maximum fidelity to the source image. 
                Do not alter Shoe geometry, Upper mesh material, Stitching, Sole construction, Translucent outer sole shell, Shadows, Reflections, Studio lighting, Camera angle, Background, Overall image color grading. 
                Do not perform global image modifications or regenerate the entire product. 
                Restrict all edits exclusively to their corresponding mask-color regions while preserving maximum pixel fidelity and realism throughout the remainder of the image.
2

Front three-quarter view

Runs now

Recolors the sole and laces, then integrates the user-uploaded tongue logo.

Output

generatedImage2

Ordered image payload

main-image2.jpgIMAGE 1

main-image2.jpg

Primary/base image

image2-mask.pngIMAGE 2

image2-mask.png

Multi-color spatial mask

Runtime image
IMAGE 3

Tongue logo upload

Example artwork supplied at runtime

The server converts these references to files in this exact order, then sends the array as image to gpt-image-2.

How references are interpreted

Image 1 is the primary reference.
Image 2: blue = internal midsole, green = tongue logo, red = translucent sidewall, lace-colored region = laces.
Image 3 is the replacement artwork referenced by the prompt.
Instruction templateExpand prompt
Use the provided base image as the primary reference image. 
                The second image is a multi-color spatial mask defining the only regions where edits are allowed. 
                Mask color assignments: 
                Interpret mask colors independently. 
                Each mask color represents a separate edit layer. 
                Do not blend, merge, or cross-apply edits between mask regions. 
                * Blue mask region = Internal midsole layer 
                * Green mask region = Tongue logo area 
                * Red mask region = Transparent outsole / translucent rubber sidewall shell 
                * Lace mask region = Shoe laces 
                
                The third image contains the replacement tongue logo artwork that must be applied within the green mask region. 
                Interpret each mask color as an independent edit layer. 
                Apply only the modification assigned to that mask color. 
                Do not blend, merge, overlap, or cross-apply edits between mask regions. 
                Do not modify any areas outside the mask. Preserve the original: 
                * Shoe geometry 
                * Proportions 
                * Perspective 
                * Stitching 
                * Mesh materials 
                * Textures 
                * Sole construction 
                * Lighting 
                * Shadows 
                * Reflections 
                * Exposure 
                * Contrast 
                * White balance 
                * Camera framing 
                * Background 
                * Overall product photography appearance 
                
                Maintain maximum fidelity to the original image and apply only the minimum modifications required for the specified edits. 
                The shoe contains a layered sole construction consisting of: 
                * A bottom outsole/grip layer 
                * A visible internal orange midsole core 
                * An outer translucent rubber sidewall shell 
                
                Apply the following edits: 
                1. Blue Mask Region (Internal Midsole): 
                Preserve the translucent outer rubber shell exactly as it currently appears. 
                Do not alter: 
                * Translucency 
                * Opacity 
                * Material finish 
                * Texture 
                * Thickness 
                * Edge softness 
                * Optical behavior 
                
                Only adjust the underlying internal midsole color visible beneath the translucent shell. 
                Change the internal midsole layer to a ${foamInsideColorId} tone. 
                The resulting color shift should remain subtle and naturally diffused through the translucent rubber shell. 
                The shoe should continue to appear predominantly white and cream overall. 
                The ${foamInsideColorId} coloration should appear beneath the translucent material rather than on its surface. 
                Avoid: 
                * Highly saturated ${foamInsideColorId} 
                * Opaque coloration 
                * Painted appearances 
                * Expanded colored regions 
                * Structural reinterpretation of the sole 
                
                Preserve realistic translucency, light diffusion, shadow gradients, edge highlights, and premium footwear material realism. 
                
                2. Red Mask Region (Transparent Outsole / Sidewall Shell): 
                Change the translucent rubber sidewall shell to a ${foamOutsideColorId} transparent TPU/rubber material. 
                Preserve strong visibility of the underlying ${foamInsideColorId} midsole beneath the translucent shell. 
                The ${foamOutsideColorId} shell must behave as a low-opacity transparent dyed material rather than an opaque, frosted, cloudy, or heavily diffused rubber. 
                Maintain clear optical separation between: 
                * The ${foamOutsideColorId} transparent outer shell 
                * The underlying ${foamInsideColorId} midsole core 
                
                The ${foamInsideColorId} midsole should remain clearly readable and visually dominant through the ${foamOutsideColorId} shell. 
                The ${foamOutsideColorId} material should function as a subtle transparent color filter rather than obscuring the layer beneath it. 
                Preserve realistic: 
                * Optical depth 
                * Light transmission 
                * Edge glow 
                * Internal reflections 
                * Thickness variation 
                * Refraction 
                * Transparency gradients 
                * Subsurface scattering 
                * TPU material realism 
                
                Avoid: 
                * Opaque ${foamOutsideColorId} rubber 
                * Milky ${foamOutsideColorId} materials 
                * Cloudy sidewalls 
                * Heavy frosting 
                * Excessive diffusion 
                
                The material should resemble lightly dyed transparent TPU or clear tinted urethane commonly used in premium performance footwear. 
                
                3. Lace Mask Region (Laces): 
                Only edit the laces within the masked region. 
                Change the lace color to a ${laceColorId} tone. 
                Preserve: 
                * Original lace weave texture 
                * Fabric material response 
                * Surface detail 
                * Shading 
                * Highlights 
                * Folds 
                * Lace thickness 
                * Realistic lighting interaction 
                
                Do not alter the surrounding upper materials. 
                Maintain realistic footwear photography appearance and material fidelity. 
                
                4. Green Mask Region (Tongue Logo): 
                Only modify the tongue logo area within the masked region. 
                Replace the existing tongue logo with the artwork provided in Image 3. 
                The replacement logo must appear naturally integrated into the original tongue label construction. 
                Preserve: 
                * Original label material 
                * Fabric weave texture 
                * Stitching 
                * Embroidery or print style 
                * Surface detail 
                * Shading 
                * Highlights 
                * Folds 
                * Perspective 
                * Lighting interaction 
                * Product photography realism 
                
                The replacement logo should follow the natural curvature, angle, and material behavior of the original tongue label. 
                Do not place the logo as a flat overlay or sticker. 
                The replacement logo must appear physically manufactured as part of the original label. 
                Do not modify any surrounding tongue materials outside the masked region. 
                Maintain the original studio lighting, clean white background, premium commercial footwear photography aesthetic, and maximum fidelity to the source image. 
                Apply only the minimum modifications necessary for each masked edit while preserving all unmasked regions with maximum pixel consistency.
                This is a localized editing task, not a redesign or regeneration task. Preserve the original shoe identity, shape, construction, materials, and photography. 
                Only perform the explicitly requested color and logo modifications within their assigned mask regions.
3

Rear three-quarter view

Runs now

Uses another multi-color mask and the same uploaded tongue logo to edit the rear angle.

Output

generatedImage3

Ordered image payload

main-image3.jpgIMAGE 1

main-image3.jpg

Primary/base image

image3-mask.pngIMAGE 2

image3-mask.png

Multi-color spatial mask

Runtime image
IMAGE 3

Tongue logo upload

Example artwork supplied at runtime

The server converts these references to files in this exact order, then sends the array as image to gpt-image-2.

How references are interpreted

Image 1 is the primary reference.
Image 2: green = internal midsole, red = sidewall shell, black = traction, blue = tongue logo, lace-colored region = laces.
Image 3 is the replacement artwork referenced by the prompt.
Instruction templateExpand prompt
Mask colors are authoritative. 
                Ignore visual content inside mask regions and apply edits according to mask-color assignment only. 
                Use the provided base image as the primary reference image. 
                The second image is a multi-color spatial mask defining the only regions where edits are allowed. 
                Mask color assignments: 
                * Green mask region = Internal midsole layer 
                * Red mask region = Translucent rubber sidewall shell 
                * Black mask region = Outsole traction / gripper elements 
                * Blue mask region = Tongue logo area 
                * Lace mask region = Shoe laces 
                
                The third image contains the replacement tongue logo artwork that must be applied within the blue mask region. 
                Interpret each mask color as an independent edit layer. 
                Apply only the modification assigned to that mask color. 
                Do not blend, merge, overlap, or cross-apply edits between mask regions. 
                Do not modify any areas outside the mask. 
                Preserve the original: 
                * Shoe geometry 
                * Proportions 
                * Perspective 
                * Stitching 
                * Mesh materials 
                * Textures 
                * Sole construction 
                * Lighting 
                * Shadows 
                * Reflections 
                * Exposure 
                * Contrast 
                * White balance 
                * Camera framing 
                * Background 
                * Overall commercial footwear product photography appearance 
                
                Maintain maximum fidelity to the original image and apply only the minimum modifications required for the specified edits. 
                The shoe contains a layered sole construction consisting of: 
                * A bottom outsole/grip layer 
                * An internal colored midsole layer 
                * An outer translucent rubber shell surrounding the sole 
                
                Apply the following edits: 
                1. Green Mask Region (Internal Midsole): 
                The translucent outer rubber shell must remain unchanged in material appearance, translucency, opacity, texture, thickness, coloration, and light diffusion behavior. 
                The edit should affect only the internal midsole color visible beneath the translucent shell. 
                Change the underlying midsole layer to a ${foamInsideColorId} tone. 
                The ${foamInsideColorId} color should appear naturally diffused, softened, and slightly desaturated through the translucent rubber surrounding the sole. 
                Do not recolor the outer translucent rubber material itself. 
                Preserve realistic: 
                * Subsurface scattering 
                * Translucency 
                * Shadow gradients 
                * Edge highlights
                * Optical depth 
                * Material realism 
                
                Maintain the appearance that the ${foamInsideColorId} coloration exists beneath the translucent shell rather than on its surface.

                2. Red Mask Region (Translucent Rubber Sidewall Shell): 
                The edit should affect only the translucent rubber sidewall shell. 
                Change the translucent sidewall shell to a ${foamOutsideColorId} transparent TPU/rubber material. 
                Preserve strong visibility of the underlying ${foamInsideColorId} midsole beneath the shell. 
                The ${foamOutsideColorId} shell must behave as a low-opacity transparent dyed material rather than an opaque, cloudy, frosted, milky, or heavily diffused rubber. 
                Preserve clear optical separation between: 
                * The ${foamOutsideColorId} transparent outer shell 
                * The internal ${foamInsideColorId} midsole core 
                
                The ${foamOutsideColorId} material should function as a subtle transparent color filter rather than obscuring the underlying layer. 
                Maintain realistic: 
                * Optical depth 
                * Internal light transmission 
                * Edge glow 
                * Thickness variation 
                * Transparency gradients 
                * Refraction 
                * Subsurface scattering 
                * Transparent TPU material realism 

                The material should resemble lightly dyed transparent TPU or clear tinted urethane commonly used in premium performance footwear. 

                3. Black Mask Region (Outsole Gripper / Traction Elements): 
                Only modify the outsole traction and gripper elements visible within the masked region. 
                Change the outsole grip/tread components to a ${soleColorId} rubber material. 
                Preserve: 
                * Original tread geometry 
                * Edge sharpness 
                * Contact shadows 
                * Material texture 
                * Physical realism 
                * Sole depth 

                The ${soleColorId} outsole should appear as durable performance footwear rubber with subtle matte texture. 
                Maintain clear separation between: 
                * The ${soleColorId} outsole grips 
                * The translucent ${foamOutsideColorId} sidewall shell above them 

                Do not alter: 
                * The translucent shell 
                * The internal ${foamInsideColorId} midsole 
                * The upper materials 
                * Lighting or exposure 

                Preserve realistic microtexture, reflections, edge highlights, and layered sole construction details. 

                4. Lace Mask Region (Laces): 
                Only edit the laces within the masked region. 
                Change the lace color to ${laceColorId}. 
                Preserve: 
                * Original lace texture 
                * Weave detail 
                * Fabric material response 
                * Shading 
                * Highlights 
                * Folds 
                * Realistic lighting interaction 

                Do not alter surrounding upper materials. 
                Maintain realistic studio product photography appearance and maximum material fidelity. 

                5. Blue Mask Region (Tongue Logo): 
                Only modify the tongue logo area within the masked region. 
                Replace the existing tongue logo with the artwork provided in Image 3. 
                The replacement logo must appear naturally integrated into the original tongue label construction. 
                
                Preserve: 
                * Original label material 
                * Fabric weave texture 
                * Stitching 
                * Embroidery or print characteristics 
                * Surface detail 
                * Shading 
                * Highlights 
                * Folds 
                * Perspective 
                * Lighting interaction 

                The replacement logo should follow the natural curvature, angle, and material behavior of the original tongue label. 
                Do not place the logo as a flat overlay, sticker, decal, or floating graphic. 
                The replacement logo must appear physically manufactured into the label and consistent with premium footwear branding. 

                Maintain the original studio lighting, clean white background, commercial product photography aesthetic, and maximum fidelity to the source image. 
                This is a localized editing task, not a redesign or regeneration task. 
                Preserve the original shoe identity, construction, materials, shape, and photography. 
                Perform only the explicitly requested modifications within their assigned mask regions while preserving all unmasked areas with maximum pixel consistency.
4

Outsole angle, material pass 1

Runs now

First active edit for the fourth rendered view. It uses the original base image plus the first two masks to recolor the translucent sidewall and traction elements.

Output

Step1Image

Ordered image payload

main-image4.pngIMAGE 1

main-image4.png

Primary/base image

image4-mask1 .pngIMAGE 2

image4-mask1 .png

Mask 1

image4-mask2.pngIMAGE 3

image4-mask2.png

Mask 2

The server converts these references to files in this exact order, then sends the array as image to gpt-image-2.

How references are interpreted

Image 1 is the primary reference.
Image 2 / Mask 1 = translucent sidewall section with an internal ${foamInsideColorId} core.
Image 3 / Mask 2 = outsole traction and gripper elements recolored to ${soleColorId}.
The returned base64 image is used immediately as the input image for the next image 4 edit.
Instruction templateExpand prompt
STRICT MASKED EDIT

BASE IMAGE INSTRUCTION

Image 1 is the base product photograph.

Use Image 1 as the only visual source for:

* Geometry
* Shape
* Silhouette
* Materials
* Construction
* Lighting
* Camera angle
* Perspective
* Background

Images 2 and Image 3 are edit masks only.

Only use mask images to determine where edits are permitted.

Do not use mask images as visual references.

Do not infer design information from mask images.

The goal is localized recoloring only.

Treat Image 1 as an existing finished product photograph.

Do not regenerate the shoe.

Do not reinterpret the shoe.

Do not redesign the shoe.

Only modify masked pixels.

Image 4 is an example of how the milky translucent white TPU should look like.

Use reference only for optical/material effect: milky translucent white TPU with internal tint, not clear glass.

---

Modify only pixels contained within the provided masks.

Outside the masks:

NO CHANGES.

Preserve exactly:

* Shoe geometry
* Proportions
* Silhouette
* Materials
* Camera angle
* Perspective
* Lighting
* Exposure
* Shadows
* Reflections
* White balance
* Textures
* Stitching
* Upper construction
* Laces
* Sole construction
* Background

Do not:

* Redesign the shoe
* Regenerate the shoe
* Change shape
* Change proportions
* Modify unmasked areas
* Introduce new design elements

The masks define independent edit regions.

MASK ASSIGNMENTS

Mask 1 = Translucent Sidewall Section

Mask 2 = Outsole Traction / Gripper Elements

Apply only the modifications described for each mask.

Never transfer color between masks.

Never blend mask effects.

Never recolor areas outside the assigned mask.

MASK PRIORITY

Mask 2 > Mask 1

If any ambiguity exists, follow the higher-priority mask.

---

MASK 1 — TRANSLUCENT SIDEWALL SECTION

The masked region is a translucent milky TPU/rubber sidewall.

Keep the original TPU material exactly as it exists.

Keep:

* Original translucency
* Original opacity
* Original reflections
* Original material appearance
* Original surface characteristics

Only introduce internal color visible within the material.

Internal color: ${foamInsideColorId}


The color must appear behind/inside the TPU material.

Do not paint the outer surface.

Do not make it clear, glass-like, transparent, or see-through.

The TPU remains milky-white.

The color is visible through the TPU.

The original white scattering/frosted opacity must remain dominant.

Maintain the original appearance of the TPU while introducing the internal color.

Only recolor the existing material.

Do not regenerate the material.

The color should appear as coloration contained within the TPU thickness.

Maintain the original transparency level of the TPU.

Do not increase translucency.

Do not decrease translucency.

Do not add glow effects.

Do not add haze effects.

Do not create new material behavior.

The color should be subtle, embedded behind/inside the milky TPU, like pigment diffused under a semi-opaque white rubber layer.
Preserve the original luminance and whiteness of the TPU.

Use the reference image, image 4, as an example on how the TPU should look like over the ${foamInsideColorId} inside.
Target result: tinted milky TPU, not transparent colored TPU.

---

MASK 2 — OUTSOLE TRACTION ELEMENTS

Interpret all pixels inside Mask 2 as traction geometry.

This includes:

* Bottom traction pods
* Traction lugs
* Grip structures
* Side-visible traction elements
* Rear traction elements
* Edge traction geometry

All visible traction geometry contained within Mask 2 must be recolored.

Keep the original traction material exactly as it exists.

Keep:

* Original transparency
* Original translucency
* Original material appearance
* Original tread geometry
* Original molded details

Only recolor the existing traction material.

Traction color: ${soleColorId}


The color must exist within the material.

Do not create an opaque coating.

Do not repaint the surface.

Maintain the original transparency and material behavior.

Every traction element contained within Mask 2 must receive the assigned color.

Do not allow traction geometry to inherit coloration from adjacent regions.

Do not change traction shape.

Do not change traction depth.

Do not change tread definition.

---

RENDERING GOAL

Photorealistic footwear product photograph.

Only change:

* Internal sidewall coloration in Mask 1
* Traction coloration in Mask 2

Everything else remains unchanged.

Preserve maximum fidelity to the original product photograph.The TPU coloration must extend through the entire masked TPU region, including all visible edge pixels, contour pixels, anti-aliased boundary pixels, partially transparent pixels, and silhouette-adjacent TPU pixels, with no remaining untinted TPU perimeter and no visible uncolored outline along the mask boundary.
5

Outsole angle, material pass 2

Runs now

Second active edit for the fourth rendered view. It uses the output from pass 1 as the base image, then applies lace and exposed-sidewall edits with the remaining two masks.

Output

generatedImage4

Ordered image payload

Runtime image
IMAGE 1

Step1Image

Generated output from image 4 material pass 1

image4-mask3.pngIMAGE 2

image4-mask3.png

Mask 1

image4-mask4.pngIMAGE 3

image4-mask4.png

Mask 2

The server converts these references to files in this exact order, then sends the array as image to gpt-image-2.

How references are interpreted

Image 1 is the generated result from image 4 material pass 1.
Image 2 / Mask 1 = laces recolored to ${laceColorId}.
Image 3 / Mask 2 = exposed sidewall insert recolored directly to ${foamInsideColorId}.
The returned base64 image becomes the fourth image shown in the results dialog.
Instruction templateExpand prompt
STRICT MASKED EDIT 
BASE IMAGE INSTRUCTION 
Image 1 is the base product photograph. 

Use Image 1 as the only visual source for: 
* Geometry 
* Shape 
* Silhouette 
* Materials 
* Construction 
* Lighting 
* Camera angle 
* Perspective 
* Background 

Images 2 onward are edit masks only. 
Only use mask images to determine where edits are permitted. 
Do not use mask images as visual references. 
Do not infer design information from mask images. 
The goal is localized recoloring only. 
Treat Image 1 as an existing finished product photograph. 
Do not regenerate the shoe. 
Do not reinterpret the shoe. 
Do not redesign the shoe. 
Only modify masked pixels.

--- Modify only pixels contained within the provided masks. 
Outside the masks: NO CHANGES. 

Preserve exactly: 

* Shoe geometry 
* Proportions 
* Silhouette 
* Materials 
* Camera angle 
* Perspective 
* Lighting 
* Exposure 
* Shadows 
* Reflections 
* White balance 
* Textures 
* Stitching 
* Upper construction 
* Sole construction 
* Background 

Do not: 
* Redesign the shoe 
* Regenerate the shoe 
* Change shape 
* Change proportions 
* Modify unmasked areas 
* Introduce new design elements 

The masks define independent edit regions. 
MASK ASSIGNMENTS Mask 1 = Laces 
Mask 2 = Exposed Sidewall 
Insert Apply only the modifications described for each mask. 
Never transfer color between masks. 
Never blend mask effects. 
Never recolor areas outside the assigned mask.

MASK PRIORITY Mask 2 > Mask 1 
If any ambiguity exists, follow the higher-priority mask.
 
--- MASK 1 — LACES 
Modify only the laces contained within Mask 1. 
Lace Color: #${laceColorId} 

Preserve: 
* Original weave structure 
* Original fabric texture 
* Original shading 
* Original highlights 
* Original folds 
* Original lace thickness 
* Original material appearance 
* Original lighting response 

Only change lace color. 
Do not modify surrounding upper materials. 
Do not modify eyelets. 
Do not modify tongue materials. 
Do not modify stitching. 

--- MASK 2 — EXPOSED SIDEWALL INSERT 
Modify every pixel contained within Mask 2. 
Mask 2 is mandatory. 
Do not omit Mask 2. 
Do not partially recolor Mask 2. 
Every pixel within Mask 2 must receive the assigned color. 

Color: ${foamInsideColorId} 
Display this color directly. 
Full saturation. 
No translucency. 
No frosting. 
No haze. 
No whitening. 
No diffusion. 
No transparency. 

The color should appear as a direct material coloration. 
Maintain: 
* Original geometry 
* Original texture 
* Original shading 
* Original highlights 
* Original molded details 
* Original material response 

Only recolor the existing material.
Do not change material properties. 
Do not change surface finish. 
Mask 2 must appear visibly stronger and more saturated than the color visible through the translucent sidewall.

--- RENDERING GOAL Photorealistic footwear product photograph. 
Only change: 

* Lace color in Mask 1 
* Exposed insert color in Mask 2 
* 
Everything else remains unchanged. 
Preserve maximum fidelity to the original product photograph.
6

Outsole angle, artwork transfer

Defined, not invoked

Takes a caller-provided image4Step1 image and transfers outsole artwork from a user upload. This call belongs to image4_2_5.runFunction(), which the current Generate button does not call.

Output

editedImage4

Ordered image payload

Runtime image
IMAGE 1

image4Step1

Generated output from the previous recolor pass

Runtime image
IMAGE 2

Sole logo upload

Example artwork supplied at runtime

The server converts these references to files in this exact order, then sends the array as image to gpt-image-2.

How references are interpreted

Image 1 is treated as the base render.
Image 2 is treated as the outsole design and embedded logo reference.
The prompt requests perspective-aware transfer without mirroring or flattening the artwork.
Instruction templateExpand prompt
Use the first image as the primary/base render and preserve it as closely as possible without redesigning the shoe. 
                Maintain the exact: camera angle, composition, lighting, materials, translucency, tread geometry, sole thickness, reflections, premium CGI product-render quality from the second image. 
                Transfer the outsole design and embedded logo from the second image onto the outsole of the shoe in the first image.
                
                Do not: 
                Mirror the logo, invert the typography, reverse the text orientation.

                Preserve the logo’s relative placement within the outsole geometry while adapting it correctly to the perspective, curvature, and foreshortening of the first image. 
                The logo must: conform accurately to the sole curvature warp naturally with perspective appear embedded beneath the translucent rubber exhibit realistic depth and refraction remain partially diffused through the milky translucent sole material 
                Preserve the exact original logo coloration from the first image. 
                Do not introduce new hues, gradients, color variation, or artistic reinterpretation. 
                The logo should have a muted translucent appearance.

                Color fidelity is critical. 
                Transfer the outsole artwork exactly as shown in the source reference. 
                Preserve the translucent rubber appearance exactly as seen in the first image, including: subsurface scattering, internal depth, soft diffusion, realistic refraction, soft internal blur. 
                Treat the outsole artwork as a physically molded internal outsole layer, not as a flat texture overlay. 
                Do not alter: shoe silhouette, outsole shape, tread structure, sole translucency, mesh, upper, render angle, floating composition, lighting setup. 
                The final image should look as though the second render was originally manufactured with the outsole/logo design integrated into the sole from the beginning, with physically accurate orientation, perspective distortion, material embedding, optical behavior, and exact original monochrome coloration preserved from the source image.
7

Second outsole angle, recolor pass

Defined, not invoked

Recolors the fifth source image in parallel with the artwork transfer call above.

Output

editedImage5_1

Ordered image payload

main-image5.pngIMAGE 1

main-image5.png

Primary/base image

image5-mask1.pngIMAGE 2

image5-mask1.png

Mask 1

image5-mask2.pngIMAGE 3

image5-mask2.png

Mask 2

image5-mask3.pngIMAGE 4

image5-mask3.png

Mask 3

image5-mask4.pngIMAGE 5

image5-mask4.png

Mask 4

The server converts these references to files in this exact order, then sends the array as image to gpt-image-2.

How references are interpreted

Image 1 is the primary reference.
Image 2 / Mask 1 = heel logo.
Image 3 / Mask 2 = internal midsole core.
Image 4 / Mask 3 = transparent TPU shell.
Image 5 / Mask 4 = outsole traction and gripper elements.
Instruction templateExpand prompt
IMPORTANT: Use the base image as the primary reference image. 
                Image 2 to image 5 are spatial edit masks defining the ONLY regions where modifications are permitted. 
                Image 6 is an example image that shows how the TPU and internal midsole should looklike togheter.
                Interpret each mask region as a completely independent edit layer. 

                MASK ASSIGNMENTS 
                • Mask 1 = Heel Logo Only 
                • Mask 2 = Internal Midsole Core Only 
                • Mask 3 = Transparent TPU Sidewall Shell and TPU Perimeter Shell Only 
                • Mask 4 = Outsole Traction / Gripper Elements Only 

                MODIFICATION RESTRICTIONS 
                Only modify pixels contained within their assigned mask region. 
                Do not modify any area outside the masks. 
                Do not blend, merge, reinterpret, overlap, or cross-apply edits between mask regions. 
                SOURCE FIDELITY LOCK The source photograph is the absolute ground truth for all appearance and material behavior.

                Preserve exactly: 
                • Shoe geometry 
                • Sole geometry 
                • Construction 
                • Proportions 
                • Perspective 
                • Camera position 
                • Mesh materials 
                • Knit structure 
                • Stitching 
                • Molded details 
                • Surface textures 
                • Material textures 
                • Material roughness 
                • Material density appearance 
                • Transparency 
                • Refraction 
                • Reflection intensity 
                • Optical depth 
                • Subsurface scattering 
                • Internal shadows 
                • Edge transmission 
                • Highlight behavior 
                • Lighting 
                • Exposure 
                • Contrast 
                • White balance 
                • Background 
                • Overall color grading 
                • Premium commercial product photography appearance 
                
                The edited result must appear identical to the original source photograph except for the specified material pigmentation changes.

                TEXTURE AND MATERIAL PRESERVATION LOCK 
                Preserve the exact texture characteristics of the original image. 
                The recolored regions must inherit the identical texture present in the source photograph. 
                Do not generate new texture. 
                Do not enhance texture. 
                Do not smooth texture. 
                Do not sharpen texture. 
                Do not reinterpret texture. 
                Do not replace texture. 
                Do not create procedural texture variation. 
                Every pore, grain, weave pattern, molded detail, edge detail, micro-surface variation, manufacturing artifact, tread feature, TPU surface characteristic, and outsole detail must remain identical to the source image. 
                The recoloring operation must function as a pure material pigmentation replacement while preserving original texture information at maximum fidelity. 

                COLOR REPLACEMENT ONLY MODE 
                Treat this edit as a localized material color replacement operation. 
                The source image must remain unchanged in every aspect except hue and pigmentation within the masked regions. 
                No redesign. 
                No regeneration. 
                No reinterpretation. 
                No material conversion. 
                No visual enhancement. 
                No shape modification. 
                No construction changes. 
                No material changes. 
                Only color substitution.

                GLOBAL CONSISTENCY REQUIREMENTS 

                All recolored regions must exhibit spatially uniform coloration and material behavior. 

                Maintain consistent: 
                • Color density 
                • Transparency 
                • Saturation 
                • Optical properties 
                • Material response 
                • Surface quality Do not create: 
                • Color banding 
                • Patchy saturation 
                • Random bright zones 
                • Random dark zones 
                • Uneven dye concentration 
                • Material inconsistencies 
                • Clouding 
                • Marbling 
                • Color pooling 
                • Surface paint effects 
                
                The recoloring must appear as physically manufactured material with factory-consistent pigmentation rather than a painted overlay or AI-generated variation. 
                
                LAYER SEPARATION REQUIREMENTS 
                Maintain strict visual separation between: 
                1. Deep ${foamInsideColorId} Internal Midsole Core 
                2. Transparent ${foamOutsideColorId} TPU Shell 
                3. Translucent ${soleColorId} Traction Elements 

                No color bleeding. 
                No color mixing. 
                No color averaging. 
                No shared coloration. 
                No material merging. 
                No reinterpretation of traction geometry as TPU geometry. 
                No reinterpretation of TPU geometry as traction geometry. 
                Preserve the original layered sole construction exactly as shown in the source image. 
                The layers must remain optically independent and physically believable. 

                MASK 1 — LOGO ONLY Modify only the logo. 
                Change logo color to: ${AMLogoColorId} 
                Preserve: 
                • Original weave structure 
                • Fabric texture 
                • Material response 
                • Shading 
                • Highlights 
                • Texture detail 
                • Logo thickness 
                • Studio lighting interaction 
                Do not alter surrounding upper materials. 

                MASK 2 — INTERNAL MIDSOLE CORE ONLY 
                Modify only the internal midsole core visible beneath the transparent shell. 
                Change internal midsole core to: Deep Premium ${foamInsideColorId} 
                The ${foamInsideColorId} coloration must appear embedded within the sole construction. 
                The ${foamInsideColorId} coloration must remain visible through surrounding transparent materials.
                 
                INTERNAL MIDSOLE CORE CONSISTENCY 
                The ${foamInsideColorId} coloration must be perfectly consistent throughout the entire visible internal core volume. 
                Use a single uniform Deep Premium ${foamInsideColorId} dye concentration.

                Avoid: 
                • Gradient shifts 
                • Clouding 
                • Patchiness 
                • Marbling 
                • Color pooling 
                • Uneven internal brightness 

                The internal core should appear as a production-grade molded component with homogeneous coloration throughout the material volume. 
                Preserve: 
                • Optical depth 
                • Internal shadows 
                • Light diffusion 
                • Subsurface scattering 
                • Layer separation 
                • Material realism 
                
                Do not recolor: 
                • TPU shell 
                • Outsole shell 
                • Traction elements 
                
                MASK 3 — SEMI-TRANSPARENT TPU SHELL ONLY 
                Modify only the TPU sidewall shell, TPU perimeter shell, TPU edgewall thickness regions, and visible TPU wall geometry. 
                Change TPU shell to: Lightly Dyed Semi-transparent ${foamOutsideColorId} 
                TPU 
                The TPU must remain Semi-transparent. 
                The coloration should exist naturally within the TPU material thickness. 
                The TPU must behave like premium Semi-transparent dyed urethane.

                TPU SHELL CONSISTENCY 
                The Semi-transparent ${foamOutsideColorId} TPU shell must exhibit uniform dye concentration across all shell thickness regions. 
                Color intensity may vary only according to physical material thickness and optical depth. 
                
                Do not introduce: 
                • Random darker ${foamOutsideColorId} areas 
                • Uneven transparency 
                • Color streaking 
                • Patchy translucency 
                • Surface paint effects 
                • Local saturation fluctuations

                Preserve exactly: 
                • Transparency level 
                • Refraction strength 
                • Internal reflections 
                • Optical depth 
                • Edge glow 
                • Thickness response 
                • Material density appearance 
                • Surface finish 

                Avoid: 
                • Opaque ${foamOutsideColorId} rubber 
                • Flat ${foamOutsideColorId} fills
                • Frosted appearance 
                • Loss of transparency 
                The ${foamInsideColorId} midsole core must remain partially visible beneath the transparent ${foamOutsideColorId} TPU. 

Use the example image, image 6, as an example on how the TPU should look like over the ${foamInsideColorId} inside.
Target result: tinted milky TPU, not transparent colored TPU.

                
                MASK 4 — OUTSOLE TRACTION / GRIPPER ELEMENTS ONLY 
                
                Interpret every pixel within Mask 4 as traction geometry. 
                
                This includes: 
                • Bottom traction pods 
                • Gripper elements 
                • Outsole lugs 
                • Raised traction structures 
                • Side-visible traction elements 
                • Rear outsole teeth 
                • Edge traction geometry 
                • Molded grip structures 
                • Visible traction protrusions 
                
                Recolor all Mask 4 geometry to: ${soleColorId} Transparent Rubber / Translucent Urethane 
                The traction elements must remain translucent. 
                The ${soleColorId} coloration must appear naturally within the material thickness rather than as an opaque surface coating. 

                TRACTION SYSTEM CONSISTENCY 
                All traction elements must share identical translucent ${soleColorId} material properties. 

                Every traction pod, lug, hex cell, edge tooth, grip structure, and visible traction feature must exhibit: 
                • Consistent color density 
                • Consistent transparency 
                • Consistent subsurface scattering 
                • Consistent refractive behavior 
                • Consistent material appearance 
                
                Do not create: 
                • Mixed ${soleColorId} shades 
                • Orange contamination 
                • Uneven translucency 
                • Variable material interpretation 
                • Opaque regions 
                
                Preserve and enhance: 
                • Material transparency 
                • Optical depth 
                • Edge transmission 
                • Internal refraction 
                • Subsurface scattering 
                • Internal reflections 
                • Thickness-based color density 
                • Perimeter glow 
                • Material realism 
                
                Preserve exactly: 
                • Hexagonal traction definition 
                • Lug depth 
                • Raised grip structure 
                • Molded details 
                • Edge sharpness 
                • Contact shadows 
                • Physical realism 
                The traction system should appear manufactured from a single premium translucent ${soleColorId} performance rubber compound with factory-consistent pigmentation. 
                
                FINAL REQUIREMENT 
                Maintain identical material fidelity, texture fidelity, transparency fidelity, optical fidelity, lighting fidelity, and manufacturing realism to the source image. 
                The result must be visually indistinguishable from the original product photograph except for the specified material pigmentation changes. 
                Apply only the minimum localized color modifications required by the mask definitions.
8

Second outsole angle, artwork transfer

Defined, not invoked

Combines both generated intermediates: the edited fourth image supplies the outsole artwork and the edited fifth image supplies the base render.

Output

editedImage5

Ordered image payload

Runtime image
IMAGE 1

editedImage4

Example artwork generated by the image 4 transfer

Runtime image
IMAGE 2

editedImage5_1

Primary/base render generated by the image 5 recolor

The server converts these references to files in this exact order, then sends the array as image to gpt-image-2.

How references are interpreted

The API receives editedImage5_1 as Image 1 because it is passed as inputImage.
The API receives editedImage4 as Image 2 because it is passed as exampleImage.
The prompt text calls Image 2 the base render, which conflicts with the actual input order and may reduce consistency.
Instruction templateExpand prompt
Use the second image as the primary/base render and preserve it as closely as possible without redesigning the shoe. 
                Maintain the exact: camera angle, composition, lighting, materials, translucency, tread geometry, sole thickness, reflections, premium CGI product-render quality from the second image. 
                Transfer the outsole design and embedded logo from the first image onto the outsole of the shoe in the second image. 
                The outsole artwork in the first image is shown from a flat upward-facing view, while the second image shows the outsole from a rotated 3/4 underside perspective. 
                Re-orient the outsole artwork in object space before applying it to the second shoe. 
                The logo must be rotated to match the physical orientation of the shoe in the second image, not the orientation seen in the reference image. 
                The text must read naturally left-to-right from the visible viewing angle of the final render. 
                Do not: mirror the logo invert the typography reverse the text orientation transpose the outsole artwork directly from image-space 
                The logo orientation should follow the longitudinal axis of the shoe exactly as if it were originally manufactured into the outsole. 
                Preserve the logo’s relative placement within the outsole geometry (heel-to-midfoot positioning) while adapting it correctly to the perspective, curvature, and foreshortening of the second image. 
                The logo must: conform accurately to the sole curvature warp naturally with perspective appear embedded beneath the translucent rubber exhibit realistic depth and refraction remain partially diffused through the milky translucent sole material 
                Preserve the exact original logo coloration from the first image. 
                Do not introduce new hues, gradients, color variation, or artistic reinterpretation. 
                The logo should remain the same muted translucent gray/taupe appearance visible in the reference image. 
                Color fidelity is critical. 
                Transfer the outsole artwork exactly as shown in the source reference. 
                Preserve the translucent rubber appearance exactly as seen in the second image, including: subsurface scattering internal depth soft diffusion realistic refraction soft internal blur 
                Treat the outsole artwork as a physically molded internal outsole layer, not as a flat texture overlay. 
                Do not alter: shoe silhouette outsole shape tread structure sole translucency mesh upper render angle floating composition lighting setup 
                The final image should look as though the second render was originally manufactured with the outsole/logo design integrated into the sole from the beginning, with physically accurate orientation, perspective distortion, material embedding, optical behavior, and exact original monochrome coloration preserved from the source image.