Edit With AI is the new name of the feature that used to be called Describe Any Change.
Overview
Edit With AI allows you to automatically edit the input image by providing a textual description of the changes that you want to make.
For example, you can ask to add or remove objects from the image, change a color, etc.
To use Edit With AI, set the parameter editWithAI.mode to ai.autoand use the parameter editWithAI.prompt to describe the changes:
(original image)
(edited image)
editWithAI.prompt="Change the shoes color to red"
editWithAI.prompt="Remove all the objects on the table"
editWithAI.prompt="Remove all the people"
If you want to give it a try, here's the code to reproduce the first example above:
curl--requestPOST\--urlhttps://image-api.photoroom.com/v2/edit\--header'x-api-key: YOUR_API_KEY_HERE'\--formimageFile=@/path/to/image.png\--formremoveBackground=false\--formreferenceBox=originalImage\--formeditWithAI.mode=ai.auto\--formeditWithAI.prompt='Change the shoes color to red'\--outputresult.png
You can use Edit With AI to create a new image from a different angle.
To do so, set the following value for the argument editWithAI.prompt:
If you need to create images from a specific angle, it can be achieved by editing the prompt to explicitly mention which angle should be used.
For example, by replacing "Change the camera angle and viewpoint (e.g., frontal to 3/4 view or side view, high to low angle, wide to tight)" with "Change the camera angle and viewpoint to a 3/4 view".
Here are examples of the results it can produce:
(original image)
(edited image)
If you want to give it a try, here's the code to reproduce the results above:
If you make several calls to the Image Editing API with the same image and prompt, you will notice that it will generate a different edited image image every time.
In order to reduce the randomness, you can set a fixed value for the seed that the API's random generator will use. The value of the argument editWithAI.seed can be any positive integer.
If you provide a value for editWithAI.seed, then the API should produce similar-looking outputs for the same image and prompt.
Make it a professional lifestyle photoshoot with the provided object or subject as the focus of the scene. Ensure the image highlights what is unique about the object, with the goal of advertising it and showing how it impacts everyday life. The lighting should be perfectly set to create a natural and elegant atmosphere. The image should feature excellent composition and a refined mood, achieving the look of high-end lifestyle photography. Integrate a human presence or a subtle interaction with the object to enhance authenticity and visual appeal.
curl --request POST \
--url https://image-api.photoroom.com/v2/edit \
--header 'x-api-key: YOUR_API_KEY_HERE' \
--form imageFile=@/path/to/image.png \
--form removeBackground=false \
--form editWithAI.mode=ai.auto \
--form editWithAI.prompt='Make it a professional lifestyle photoshoot with the provided object or subject as the focus of the scene. Ensure the image highlights what is unique about the object, with the goal of advertising it and showing how it impacts everyday life. The lighting should be perfectly set to create a natural and elegant atmosphere. The image should feature excellent composition and a refined mood, achieving the look of high-end lifestyle photography. Integrate a human presence or a subtle interaction with the object to enhance authenticity and visual appeal.' \
--form editWithAI.seed=2016886668 \
--output result-product-staging.png
Create a new photograph of this exact same scene or setting with creative variations. Change the camera angle and viewpoint (e.g., frontal to 3/4 view or side view, high to low angle, wide to tight), adjust composition and framing, and optionally vary the lighting or time of day (morning, golden hour, blue hour, overcast, or dramatic shadows). Try creative approaches such as closer details, wider establishing shots, or alternative focal points. Keep the exact same physical location and environment so it remains clearly recognizable, with the same main subjects, key elements, style, and overall mood. If there's a person, change their pose, position, or activity. If there's a product, show it from a different angle or in different use. The result should feel like a fresh, creative variation taken in the same location during the same shoot, offering a distinctly different perspective while maintaining scene continuity.
curl --request POST \
--url https://image-api.photoroom.com/v2/edit \
--header 'x-api-key: YOUR_API_KEY_HERE' \
--form imageFile=@/path/to/image.png \
--form removeBackground=false \
--form editWithAI.mode=ai.auto \
--form editWithAI.prompt="Create a new photograph of this exact same scene or setting with creative variations. Change the camera angle and viewpoint (e.g., frontal to 3/4 view or side view, high to low angle, wide to tight), adjust composition and framing, and optionally vary the lighting or time of day (morning, golden hour, blue hour, overcast, or dramatic shadows). Try creative approaches such as closer details, wider establishing shots, or alternative focal points. Keep the exact same physical location and environment so it remains clearly recognizable, with the same main subjects, key elements, style, and overall mood. If there's a person, change their pose, position, or activity. If there's a product, show it from a different angle or in different use. The result should feel like a fresh, creative variation taken in the same location during the same shoot, offering a distinctly different perspective while maintaining scene continuity." \
--form editWithAI.seed=2016886668 \
--output result-other-angle.png