Warning: Edit With AI is available as an alpha feature.
This means that the feature (or parts of it) might be deprecated with two week warning.
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
Give the main garment a natural worn look with real volume and depth. The item must always appear shaped as if worn by an invisible person, never flat. Present it front facing and straight, with a realistic fit that shows contours, curves, and natural tension lines while keeping the wearer fully invisible. Only the product should appear, floating. Use the most flattering perspective and make the item look new with very sharp and clean resolution. Show only the main subject on a plain white background. If the original product is flat, add natural 3D structure so it looks worn while keeping the wearer invisible. Remove wrinckles if any.
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 editWithAI.mode=ai.auto \
--form editWithAI.prompt='Give the main garment a natural worn look with real volume and depth. The item must always appear shaped as if worn by an invisible person, never flat. Present it front facing and straight, with a realistic fit that shows contours, curves, and natural tension lines while keeping the wearer fully invisible. Only the product should appear, floating. Use the most flattering perspective and make the item look new with very sharp and clean resolution. Show only the main subject on a plain white background. If the original product is flat, add natural 3D structure so it looks worn while keeping the wearer invisible. Remove wrinckles if any.' \
--form editWithAI.seed=2016886668 \
--output result-ghost-mannequin.png
Create a Flat Lay of the subject. The background must be pure white, with strong contrast and subtle cast shadows to enhance and beautify the subject. The photo should be taken from the top. Remove wrinkles make the subject look new, steam-press the garnment. The goal is to deliver a flawless, high-quality image suitable for professional product listings and premium website showcases. The subject should display exceptionally sharp and clean resolution. Ensure the image shows only the main subject.
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 editWithAI.mode=ai.auto \
--form editWithAI.prompt='Create a Flat Lay of the subject. The background must be pure white, with strong contrast and subtle cast shadows to enhance and beautify the subject. The photo should be taken from the top. Remove wrinkles make the subject look new, steam-press the garnment. The goal is to deliver a flawless, high-quality image suitable for professional product listings and premium website showcases. The subject should display exceptionally sharp and clean resolution. Ensure the image shows only the main subject.' \
--form editWithAI.seed=2016886668 \
--output result-flat-lay.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