How to change the color of an object in an image with AI
Send the photo to an AI image model, name the object and its new color, and list what must stay. One request per color, checked against the original.

To change the color of an object in an image with AI, send the photo to an image model that edits from reference images, with a prompt that names the object, its new color, and everything that must stay: “Change only the jacket to navy blue; keep the person, the pose, the background, and the lighting the same.” For several colors, send one request per color, each from the same original photo. The model redraws the whole picture, so compare every result with the original.
On Sume, that is one POST /v1/images request. The facts below come from the Image API docs and the request schema in the Sume API reference, read on 2026-09-28.
How do I recolor an object with the Image API?
It is the same kind of edit request as changing the background of a photo with AI; what changes is the prompt.
- Put the photo at a public HTTPS URL and send it in
input_referencesto a model that edits from reference images, such asopenai/gpt-image-2.5(ChatGPT Image 2.5). A text-to-image-only model rejects it. - Set
aspect_ratio: "auto"so the result keeps the photo's shape. Leaving the field out is not the same asauto. - The call waits up to 30 seconds and returns
200with the images. A slower generation returns202with a job to poll instead.
curl -X POST "https://api.sume.com/v1/images" \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2.5",
"prompt": "Change only the jacket to navy blue. Keep the person, their face, the pose, the zipper, the background, and the lighting exactly as they are.",
"input_references": [
{ "type": "image_url", "image_url": { "url": "https://example.com/jacket.jpg" } }
],
"aspect_ratio": "auto",
"n": 2
}'What should a recolor prompt say?
Three things, in this order: the object, the new color, and what stays. Name the object so it can't be confused with anything else in the picture (“the red car in the foreground”, “the mug on the left”), and describe the color in words, with a finish if it matters (“deep forest green, matte”). Five examples, the last for the whole picture:
- Clothes: “Change the hoodie from gray to mustard yellow; keep the print, the person, the pose, and the background the same.”
- Car: “Repaint the car in glossy pearl white; keep the wheels, the windows, the reflections, the road, and the sky the same.”
- Product: “Make the water bottle matte black; keep the lid, the logo, the shadow, and the white background the same.”
- Room: “Paint the back wall sage green; keep the furniture, the floor, the window, and the light the same.”
- Whole image: “Give the whole photo a warm, faded film look; keep every person and object where they are.”
How do I make every colorway of a product?
One request carries one prompt, and n returns several takes of that same prompt, so ask for one color per request. For a set of colorways:
- Send one request per color, each with the original photo as the reference.
- Keep the prompt, the model, and the settings identical, and change only the color words, so the results are comparable.
- Don't chain edits. A recolored result used as the next reference is a redraw of a redraw, and it can drift further from the product.
- From each request, keep the take whose shape, seams, and logo still match the product.
Can I select the object with a mask?
Only on ChatGPT Image 2.5, and only partly documented. It takes an optional mask_url on edits, but the docs don't say what the mask image should contain, so this guide names the object in the prompt instead. GPT Image 2.5 API on Sume shows where the field goes.
Will the new color come out exactly right?
Not guaranteed. The new color is the model's reading of your words, not a measured match to a hex code or a brand swatch. The rest of the object is redrawn along with it, so check its logo, print, and texture, not only the color. Treat the result as close to what you asked for, and compare it with the real product before the image goes on a listing.
What does a recolor cost, and which fields does it need?
- Each completed image is billed, so
n: 2is two images, and a failed or cancelled generation is not billed. Each model's price is in thepricingline ofGET /v1/images/models/{model_id}/endpoints, andusage.costin the response is the USD amount billed. - Result URLs are Sume-hosted and signed. Download the images you keep.
| Field | What to send | Limit |
|---|---|---|
model | An id that edits from references, such as openai/gpt-image-2.5 | Text-to-image-only models reject the photo |
prompt | The object, the new color, and what stays | Required |
input_references | The original photo | Public HTTPS URLs |
aspect_ratio | "auto", to keep the photo's shape | Only on models that list auto |
n | How many takes of the one color | Up to 4 on ChatGPT Image 2.5 and the Nano Banana models; Seedream 4.5 returns 1 with a reference |
Sources
Related posts
More in Models
- How to change the background of a video with AI
Give a video-to-video AI model your clip and a prompt that names the new background and what must stay. How to do it on Sume and what to check.
- Day to night video with AI: edit, generate, or grade
Turn a day video into night with a video-to-video AI edit, generate a day-to-night clip from two stills, or darken it with a color grade.
- Dreamina vs Seedance: the app and the model it runs
Dreamina vs Seedance: Seedance is ByteDance Seed's video model; Dreamina is a creative app that runs it. When to use the app and when an API.
- FLUX.2 API pricing: Pro and Flex cost per image
FLUX.2 API pricing is per image. What FLUX.2 [pro], [flex] and the other variants cost on Black Forest Labs' API, and per image through Sume.
Written by Sume