# AI Backgrounds Competitors Benchmark (Claid.ai, Phot.ai, Bria.ai)

On this page you will find a comparison of our [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds.md) (using our v3 model) against some of our competitors.

## Feature Comparison

<table data-full-width="true"><thead><tr><th width="176" align="center"></th><th align="center">Photoroom API</th><th align="center">Claid.ai API</th><th align="center">Phot.ai API</th><th align="center">Bria.ai API</th></tr></thead><tbody><tr><td align="center"><em>Pricing</em></td><td align="center"><strong>€0.10 per image</strong></td><td align="center">from $0.20 per image</td><td align="center">from $0.18 per image</td><td align="center">from $0.08 per image</td></tr><tr><td align="center"><em>Response time</em></td><td align="center"><strong>~5 seconds</strong></td><td align="center">~15 seconds</td><td align="center">~35 seconds</td><td align="center">~20 seconds</td></tr><tr><td align="center"># <em>of API calls required</em></td><td align="center"><strong>1 call</strong></td><td align="center">2 calls</td><td align="center">1 call</td><td align="center">1 call</td></tr><tr><td align="center"><em>Supports a different aspect ratio than that of the input image</em></td><td align="center"><strong>Yes</strong></td><td align="center">Yes</td><td align="center">No</td><td align="center">No</td></tr><tr><td align="center"><em>Supports sending an image file</em></td><td align="center"><strong>Yes</strong></td><td align="center">Yes</td><td align="center">No</td><td align="center">Yes</td></tr><tr><td align="center"><em>Supports sending an image URL</em></td><td align="center"><strong>Yes</strong></td><td align="center">Yes</td><td align="center">Yes</td><td align="center">Yes</td></tr><tr><td align="center"><em>Supports setting the</em> <a href="/pages/HApfqZOrLZgScroTLTtk#background.seed"><em>RNG seed</em></a></td><td align="center"><strong>Yes</strong></td><td align="center">No</td><td align="center">No</td><td align="center">Yes</td></tr></tbody></table>

## Result Comparison

### Food Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/AZkvmfEH20VKvBZGNuF3" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/nKFeNYUWbaa8X6AZCDKr" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/M94bhCYUp4rdDw6wMmQn" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/LTIad9hGm4XnqakJIlKh" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/eOAVzGjw8V5y5XFCzgdR" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/ue0ngp05IhjqSREd4iBW" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/AYmUAnlyek4JcmA8d6SR" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/yGy6Ph0EnaanDCKJZQAJ" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/dSNzjEsMmKUxM73MfrzP" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><em>This image failed to process</em></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/2LRB4aFxCEXTThVnlDM6" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a plate of chicken wings and dipping sauces on a black scampered wooden table.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/ePMI1pbWNMZRMKZiV2Gu" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/OQUg25oiSPdmgzPy5BtY" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/RFSlKfwxjuYgy69tkSc5" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/cyb5LrkfOvFc0hkXaVLB" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/LoA7LeMxqI0lkA3aoJYS" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/4QgCXlCWwNKahJIqsVsL" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/YuLsdeHp6pc0OQ0tjSUP" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/Gn3LnZqSkbPsPhkMEs6L" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/apQ7OS4yJzqFZmwssPqC" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/aHMfM67jKNrWpPrX3x4Q" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/U2AHvT07rc5WIIYo6czX" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/zhrCtKrLeE5nIm2gUHvC" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/hjoGp5iXFPUr2nbaHgnE" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/cy0dYdG0mgsKjr2q9YTI" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Cosmetic Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/i7MyBSNutaL5vrbtkkFJ" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/nOYqjAqtCGLK4IhGcCcp" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/I3qakwcQDLSmpbEo8R3S" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/lwejrTdkKzqMSKVz6t0L" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/6zLI6f2rUqQhCfbaePKD" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/eDI2k7EhIIJeESxfX25u" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/YMWC5rb0p4lRihpkeJt7" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/eF3KeSQjuBHFR91H1IBR" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/MRLvGjZ4wwcjBpB0rINV" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/BxErxbeOZEKpsT7l0juP" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/XDOYpCBq34pICa6AXABn" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/7Xe4mfoE1ukM5SjOMmgt" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/P3MXDH6EgToE6WuD33nv" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/yC9WNgnLb1jOPzJ49SkG" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/iEmdGDOO8y70gZuLPMTh" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/deYlBmh5WxPnO0QA4sO8" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/PNxE9PQ30H4GldatI7AQ" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/JuHl8fgCJUjPYoGRUgNt" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/IkTj05djcLFHJt4YAi1b" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/hme4wB4Zk4cRQvHJn563" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/WklilBGerPICE1FQbYun" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/D6WVk2cwhz2p0bD8qhNJ" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/lhjA5XWmiUOzyw1Vfxnp" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/PwhGJFrbV7RRR8IkINdI" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/tIUeotDEnCV0Q6e8986i" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Apparel Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/ZEKsfp3VcunEN8DWb86V" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/2Cl09M3h7d7UmioVmEj8" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/QzNh3b1HcsZYKTwyZLSJ" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/JD6qpcVxkC1p4s71cb1z" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/dIdy54jUvxz1k3VYuNjx" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/mWL254EYgpzWbVHeYCBF" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a baseball cap on a baseball field, with a bright sun in the background</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/Nlx7Kb0OPLJbeTChuoUe" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/CDTT9Oml4yG2cIXtKtil" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/fknfT40P7Fv2NfVON2ea" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/oB6gcNFY4m60ptmeOX3c" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/gEZemTEkZl3M4mln56sM" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a crocheted poncho on a fluffy blanket, with a soft green grass field in the background</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/nmH6ExSXYcSVKkS3NK6A" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/mkQOUUxCnqyHxocrhGRW" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/U9WrQ1fey4r38JRsDTlP" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/ItuxtJJ2R3m6jcF6Ykhw" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/3Hp2Aqur01MgufCqSNpM" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/DkjPqgvN1DJ1LQWoALFk" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/3iAv2kGroQZuIu5EEl4o" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/Sw7agTfHjGrMvfjd37Kv" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/ObDtQs6kzUkPgC6ec2qi" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/4YgJhhlmW4jXosIAmq8g" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/yjbyHMxS6fee0rWQOfLS" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/mlOzrZhtqbiHX58xTsCX" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/D9xGqoH3jPPODFbyPIeY" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/CDQPZl7frUCw58heVDvL" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Jewelry Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/qvGvbF5I4m7MqfV5vuzp" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/v1mCg7rN9MDUy1LhWRdO" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/J20fhZT0DptwcxR9R5XP" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/8JpNVewIUkrp2CCGhrKM" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/6HdjzHzTTjtKjgAl3Gqc" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/Op39BopimZjPkTgbRJXE" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a long necklace on a black velvet cushion, with a cream stone wall in the background</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/14MLkunBrXAk6AEglku4" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/KgO0Ysb9zYH0IjTxePcs" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/qw5r3At9dLs0ezOwA59n" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/hjY6po6DQn1QfftzGPQt" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/sn5JndlPIP1BLgzBXdBV" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center">th<em>e image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/rt7fhhvcr7b4mucTZdEh" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/xC5I9nlVj6U05qpnkTGY" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/jN2msXeop57ks9lhMYFv" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/4QLQo1chdAzB6BORrvOq" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/DuRgHZPZ8uXMakdNEbyd" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/VhQUOEenj28IXVRiXBYW" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/MjozperHYYCvSoTiCNyO" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/GIqmbuC0KyIdFzpYZCXR" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/JdX8JYLbUA1vpc092kCP" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/wjpXsLIdIyjrMmOQuA8T" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/NIE6pnkLE3PyAO0LctBE" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/ulajZmrrkmZnbji7KiMn" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/Q1IjukYMjTom2zMTG88U" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/YQKnHq6pzcyBa32yXwVh" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### People Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/oP58e7CiNiP8JHEIB3Wq" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/UQE9tRDoKmszEMZHZYod" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/EMyq4AEtoHaY51YSGQjg" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/gthcB5C5q5NnpP6GVtJy" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/DH5ak9TA1V4IeVa9TMux" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/dXAyJNqVrL4iDnlsxS94" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image features a person walking on a boulder with a breathtaking mountain view in the background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/N3Q6jzBZUZWReK2495qO" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/HhDe9anXGzij5X0M9tRS" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/ArIGJ2FpJqzThxtc6LCT" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/EmHSDGraefgrknrkCY5b" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/lgmdO7evOOa3gRXPXgFE" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/NyOOHpvFIOIKBep2HPlW" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/9mabWBn5oOITeDnJdurb" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/z2BRbeoQajuMmYHpQQ8L" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/ZoFoHYUOo5ArnOycSDdD" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/MVhmAxqc7LvVST08BqGZ" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/no23jIXXBpU7awvVmrwT" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/iatcb1ZeCbIcVlExWik6" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/FD1XDIYAOEFzGX8HdhCE" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/BQn241X6glmjoE4pZgiz" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="/files/KOQznDOHy019nAJqBvDH" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="/files/OEpfEPSU3fxKZFmIIrsV" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="/files/17tpn9a2YKuQ5uyDKbrI" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/QcVp4SWxCEftwXZfPDPH" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="/files/wGuHjmiYeayJpbDZE2lx" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Reproducing the results

If you want to reproduce the results of this benchmark, here are the Python scripts that were used to generate the images.

{% tabs %}
{% tab title="Photoroom API" %}

```python
import os
import requests
import concurrent.futures

API_KEY = "YOUR_PHOTOROOM_API_KEY"

SEEDS = [117879368, 55994449, 48672244, 65080068]

def process_image(image_url, prompt, variant_index, output_image_path):
    try:
        url = "https://image-api.photoroom.com/v2/edit"

        params = {
            "imageUrl": image_url,
            "referenceBox": "originalImage",
            "outputSize": "1024x1024",
            "background.prompt": prompt,
            "background.negativePrompt": "oversaturated, ugly, 3d, render, cartoon, grain, low-res, kitsch, text, lens, camera",
            "background.seed": SEEDS[variant_index]
        }

        headers = {
            "x-api-key": API_KEY,
            "pr-ai-background-model-version": "3"
        }

        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()

        with open(output_image_path, 'wb') as f:
            f.write(response.content)
            print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
    
def iterate_over(image_urls, prompts, file_names, result_directory):
    with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
        root = os.getcwd()

        for image_url, prompt, file_name in zip(image_urls, prompts, file_names):
            file_path = os.path.join(root, file_name)

            for variant in range(0, 5):
                result_file_name = f"photoroom-{file_name}-variant_{variant+1}.png"
                result_path = os.path.join(result_directory, result_file_name)

                executor.submit(process_image, image_url, prompt, variant, result_path)    

if __name__ == "__main__":
    # FOOD

    FOOD_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F1.jpg?alt=media&token=850ab5be-a503-40f1-a270-c7cdcc62bdeb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F2.png?alt=media&token=9c6e5512-efb8-47bc-b45d-01cb5b00b698",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F3.jpg?alt=media&token=04851dba-83bc-4d24-9549-ad029a838c33",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F4.jpeg?alt=media&token=191746c4-c528-4e2f-9e04-e1cac0b8d4b9",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F5.jpeg?alt=media&token=97421dcf-14b0-4353-913e-03428341e274",
    ]

    FOOD_PROMPTS = [
        "the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.",
        "a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background",
        "a plate of chicken wings and dipping sauces on a black scampered wooden table.",
        "the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.",
        "the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.",
    ]

    FOOD_OUTPUT_DIRECTORY = "./output-photoroom/food/"

    if not os.path.exists(FOOD_OUTPUT_DIRECTORY):
        os.makedirs(FOOD_OUTPUT_DIRECTORY)

    iterate_over(image_urls=FOOD_IMAGES_URLS, prompts=FOOD_PROMPTS, file_names=list(map(str, range(1, len(FOOD_IMAGES_URLS) + 1))), result_directory=FOOD_OUTPUT_DIRECTORY)

    # COSMETIC

    COSMETIC_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F1.jpeg?alt=media&token=837a3a2c-4621-44bc-84d7-ca1bafd7dad7",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F2.jpeg?alt=media&token=9327b3b6-68a6-4106-88cc-978afa5c048e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F3.png?alt=media&token=6c25d2aa-4a11-4b00-bac6-b98f59289b5c",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F4.jpg?alt=media&token=be6075e1-b754-4f98-8937-cba8d234942d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F5.jpg?alt=media&token=982083a1-b8df-40f7-88cc-c9185670f162",
    ]

    COSMETIC_PROMPTS = [
        "the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.",
        "the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.",
        "the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean",
        "the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry",
    ]

    COSMETIC_OUTPUT_DIRECTORY = "./output-photoroom/cosmetic/"

    if not os.path.exists(COSMETIC_OUTPUT_DIRECTORY):
            os.makedirs(COSMETIC_OUTPUT_DIRECTORY)

    iterate_over(image_urls=COSMETIC_IMAGE_URLS, prompts=COSMETIC_PROMPTS, file_names=list(map(str, range(1, len(COSMETIC_IMAGE_URLS) + 1))), result_directory=COSMETIC_OUTPUT_DIRECTORY)
    
    # APPAREL

    APPAREL_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F1.jpeg?alt=media&token=462bd079-f084-4a97-bdf5-51e1ea6454a3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F2.jpg?alt=media&token=7666a271-93c8-4fa5-bf46-e550f2832189",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F3.jpg?alt=media&token=3551ca21-e31a-4076-b810-1bc0aacbaceb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F4.jpg?alt=media&token=4a2d0c5d-b44a-479f-bc35-64fcc3d3d366",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F5.jpeg?alt=media&token=4624dafe-959b-4bfc-b230-7785780abcf7",
    ]

    APPAREL_PROMPTS = [
        "the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue",
        "a baseball cap on a baseball field, with a bright sun in the background",
        "a crocheted poncho on a fluffy blanket, with a soft green grass field in the background",
        "the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.",
    ]

    APPAREL_OUTPUT_DIRECTORY = "./output-photoroom/apparel/"

    if not os.path.exists(APPAREL_OUTPUT_DIRECTORY):
        os.makedirs(APPAREL_OUTPUT_DIRECTORY)

    iterate_over(image_urls=APPAREL_IMAGE_URLS, prompts=APPAREL_PROMPTS, file_names=list(map(str, range(1, len(APPAREL_IMAGE_URLS) + 1))), result_directory=APPAREL_OUTPUT_DIRECTORY)

    # JEWELRY

    JEWELRY_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F1.jpg?alt=media&token=0afec946-38cf-4773-a96a-d0c158358557",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F2.jpg?alt=media&token=9b93ee57-9343-4611-8156-76c512149002",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F3.jpg?alt=media&token=925a455c-1b58-469d-95c7-7db4ff5ac61e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F4.jpg?alt=media&token=c694560d-951d-4fe5-8390-a4c5df846f51",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F5.jpg?alt=media&token=38205d4d-ce4f-4168-9a91-94d872aed3fe",
    ]

    JEWELRY_PROMPTS = [
        "the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "a long necklace on a black velvet cushion, with a cream stone wall in the background",
        "the image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.",
        "the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.",
    ]

    JEWELRY_OUTPUT_DIRECTORY = "./output-photoroom/jewelry/"

    if not os.path.exists(JEWELRY_OUTPUT_DIRECTORY):
        os.makedirs(JEWELRY_OUTPUT_DIRECTORY)

    iterate_over(image_urls=JEWELRY_IMAGE_URLS, prompts=JEWELRY_PROMPTS, file_names=list(map(str, range(1, len(JEWELRY_IMAGE_URLS) + 1))), result_directory=JEWELRY_OUTPUT_DIRECTORY)

    # PEOPLE

    PEOPLE_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F1.jpg?alt=media&token=5b57a70d-e94d-4056-8e48-2b8a2c296028",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F2.jpg?alt=media&token=f0e8a0bb-9fd7-4cc3-bd90-b5655321d46d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F3.jpg?alt=media&token=37ade83a-611e-4346-b4fe-5ee484f69ea3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F4.jpg?alt=media&token=3569a732-9be2-4b2d-b685-c55a1093fca8",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F5.jpg?alt=media&token=38875d9b-8f48-4bec-a30a-ca10be2b86d5",
    ]

    PEOPLE_PROMPTS = [
        "a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background",
        "the image features a person walking on a boulder with a breathtaking mountain view in the background.",
        "the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York",
        "the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean",
    ]

    PEOPLE_OUTPUT_DIRECTORY = "./output-photoroom/people/"

    if not os.path.exists(PEOPLE_OUTPUT_DIRECTORY):
        os.makedirs(PEOPLE_OUTPUT_DIRECTORY)

    iterate_over(image_urls=PEOPLE_IMAGE_URLS, prompts=PEOPLE_PROMPTS, file_names=list(map(str, range(1, len(PEOPLE_IMAGE_URLS) + 1))), result_directory=PEOPLE_OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Claid.ai API" %}
{% hint style="info" %}
Please note that:

* Claid.ai requires to make a first API call to remove the original background, then make a second call to generate the new background
* Claid.ai doesn't support [providing the seed of the random number generator](https://docs.photoroom.com/resources/pages/HApfqZOrLZgScroTLTtk#background.seed), so you will **not** get exactly the same results than the ones shown above
  {% endhint %}

```python
import os
import requests

API_KEY = "YOUR_CLAID_AI_API_KEY"

def remove_background(input_image_url):
    try:
        url = "https://api.claid.ai/v1-beta1/image/edit"

        payload = {
            "input": input_image_url,
            "operations": {
                "background": {
                    "remove": True
                },
                "resizing": {
                    "width": 1024,
                    "height": 1024,
                    "fit": "bounds"
                }
            },
            "output": {
                "format": "png"
            }
        }

        headers = {
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()

        data = response.json()

        tmp_url =  data['data']['output']['tmp_url']
        print(f"Background Removed: {tmp_url}")

        return tmp_url

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)

def generate_background(input_image_url, prompt, input_file_name, output_directory):
    try:
        url = "https://api.claid.ai/v1-ea/scene/create"

        payload = {
            "object": {
                "image_url": input_image_url,
                "placement_type": "original"            
            },
            "scene": {
                "prompt": prompt,
                "negative_prompt": "oversaturated, ugly, 3d, render, cartoon, grain, low-res, kitsch, text, lens, camera"
            }
        }

        headers = {
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()

        data = response.json()

        for index, variant in zip(range(1, 5), data['data']['output']):
            variant_url = variant['tmp_url']

            response = requests.get(variant_url)
            response.raise_for_status()  # To ensure the request was successful

            variant_file_name = os.path.join(output_directory, f"claid-ai-{input_file_name}-variant_{index}.png")

            with open(variant_file_name, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {variant_file_name}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
   

def process_image(input_image_url, prompt, input_file_name, output_directory):
    background_removed_url = remove_background(input_image_url)
    generate_background(background_removed_url, prompt, input_file_name, output_directory)

def iterate_over(image_urls, prompts, file_names, result_directory):
    for image_url, prompt, file_name in zip(image_urls, prompts, file_names):
        process_image(image_url, prompt, file_name, result_directory)    

if __name__ == "__main__":
    # FOOD

    FOOD_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F1.jpg?alt=media&token=850ab5be-a503-40f1-a270-c7cdcc62bdeb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F2.png?alt=media&token=9c6e5512-efb8-47bc-b45d-01cb5b00b698",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F3.jpg?alt=media&token=04851dba-83bc-4d24-9549-ad029a838c33",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F4.jpeg?alt=media&token=191746c4-c528-4e2f-9e04-e1cac0b8d4b9",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F5.jpeg?alt=media&token=97421dcf-14b0-4353-913e-03428341e274",
    ]

    FOOD_PROMPTS = [
        "the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.",
        "a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background",
        "a plate of chicken wings and dipping sauces on a black scampered wooden table.",
        "the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.",
        "the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.",
    ]

    FOOD_OUTPUT_DIRECTORY = "./output-claid-ai/food/"

    if not os.path.exists(FOOD_OUTPUT_DIRECTORY):
        os.makedirs(FOOD_OUTPUT_DIRECTORY)

    iterate_over(image_urls=FOOD_IMAGES_URLS, prompts=FOOD_PROMPTS, file_names=list(map(str, range(1, len(FOOD_IMAGES_URLS) + 1))), result_directory=FOOD_OUTPUT_DIRECTORY)

    # COSMETIC

    COSMETIC_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F1.jpeg?alt=media&token=837a3a2c-4621-44bc-84d7-ca1bafd7dad7",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F2.jpeg?alt=media&token=9327b3b6-68a6-4106-88cc-978afa5c048e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F3.png?alt=media&token=6c25d2aa-4a11-4b00-bac6-b98f59289b5c",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F4.jpg?alt=media&token=be6075e1-b754-4f98-8937-cba8d234942d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F5.jpg?alt=media&token=982083a1-b8df-40f7-88cc-c9185670f162",
    ]

    COSMETIC_PROMPTS = [
        "the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.",
        "the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.",
        "the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean",
        "the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry",
    ]

    COSMETIC_OUTPUT_DIRECTORY = "./output-claid-ai/cosmetic/"

    if not os.path.exists(COSMETIC_OUTPUT_DIRECTORY):
            os.makedirs(COSMETIC_OUTPUT_DIRECTORY)

    iterate_over(image_urls=COSMETIC_IMAGE_URLS, prompts=COSMETIC_PROMPTS, file_names=list(map(str, range(1, len(COSMETIC_IMAGE_URLS) + 1))), result_directory=COSMETIC_OUTPUT_DIRECTORY)
    
    # APPAREL

    APPAREL_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F1.jpeg?alt=media&token=462bd079-f084-4a97-bdf5-51e1ea6454a3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F2.jpg?alt=media&token=7666a271-93c8-4fa5-bf46-e550f2832189",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F3.jpg?alt=media&token=3551ca21-e31a-4076-b810-1bc0aacbaceb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F4.jpg?alt=media&token=4a2d0c5d-b44a-479f-bc35-64fcc3d3d366",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F5.jpeg?alt=media&token=4624dafe-959b-4bfc-b230-7785780abcf7",
    ]

    APPAREL_PROMPTS = [
        "the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue",
        "a baseball cap on a baseball field, with a bright sun in the background",
        "a crocheted poncho on a fluffy blanket, with a soft green grass field in the background",
        "the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.",
    ]

    APPAREL_OUTPUT_DIRECTORY = "./output-claid-ai/apparel/"

    if not os.path.exists(APPAREL_OUTPUT_DIRECTORY):
        os.makedirs(APPAREL_OUTPUT_DIRECTORY)

    iterate_over(image_urls=APPAREL_IMAGE_URLS, prompts=APPAREL_PROMPTS, file_names=list(map(str, range(1, len(APPAREL_IMAGE_URLS) + 1))), result_directory=APPAREL_OUTPUT_DIRECTORY)

    # JEWELRY

    JEWELRY_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F1.jpg?alt=media&token=0afec946-38cf-4773-a96a-d0c158358557",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F2.jpg?alt=media&token=9b93ee57-9343-4611-8156-76c512149002",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F3.jpg?alt=media&token=925a455c-1b58-469d-95c7-7db4ff5ac61e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F4.jpg?alt=media&token=c694560d-951d-4fe5-8390-a4c5df846f51",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F5.jpg?alt=media&token=38205d4d-ce4f-4168-9a91-94d872aed3fe",
    ]

    JEWELRY_PROMPTS = [
        "the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "a long necklace on a black velvet cushion, with a cream stone wall in the background",
        "the image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.",
        "the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.",
    ]

    JEWELRY_OUTPUT_DIRECTORY = "./output-claid-ai/jewelry/"

    if not os.path.exists(JEWELRY_OUTPUT_DIRECTORY):
        os.makedirs(JEWELRY_OUTPUT_DIRECTORY)

    iterate_over(image_urls=JEWELRY_IMAGE_URLS, prompts=JEWELRY_PROMPTS, file_names=list(map(str, range(1, len(JEWELRY_IMAGE_URLS) + 1))), result_directory=JEWELRY_OUTPUT_DIRECTORY)

    # PEOPLE

    PEOPLE_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F1.jpg?alt=media&token=5b57a70d-e94d-4056-8e48-2b8a2c296028",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F2.jpg?alt=media&token=f0e8a0bb-9fd7-4cc3-bd90-b5655321d46d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F3.jpg?alt=media&token=37ade83a-611e-4346-b4fe-5ee484f69ea3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F4.jpg?alt=media&token=3569a732-9be2-4b2d-b685-c55a1093fca8",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F5.jpg?alt=media&token=38875d9b-8f48-4bec-a30a-ca10be2b86d5",
    ]

    PEOPLE_PROMPTS = [
        "a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background",
        "the image features a person walking on a boulder with a breathtaking mountain view in the background.",
        "the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York",
        "the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean",
    ]

    PEOPLE_OUTPUT_DIRECTORY = "./output-claid-ai/people/"

    if not os.path.exists(PEOPLE_OUTPUT_DIRECTORY):
        os.makedirs(PEOPLE_OUTPUT_DIRECTORY)

    iterate_over(image_urls=PEOPLE_IMAGE_URLS, prompts=PEOPLE_PROMPTS, file_names=list(map(str, range(1, len(PEOPLE_IMAGE_URLS) + 1))), result_directory=PEOPLE_OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Phot.ai API" %}
{% hint style="info" %}
Please note that:

* Phot.ai requires to make a first API call to start the processing, then make a second call to fetch the result. This code sets a delay of 300 seconds before fetching the result to maximize the chances of the result being ready.
* Phot.ai doesn't support [providing the seed of the random number generator](https://docs.photoroom.com/resources/pages/HApfqZOrLZgScroTLTtk#background.seed), so you will **not** get exactly the same results than the ones shown above
  {% endhint %}

```python
import os
import requests
import time
import concurrent.futures

API_KEY = "YOUR_PHOT_AI_API_KEY"

def generate_background(input_image_url, prompt):
    try:
        url = "https://prodapi.phot.ai/external/api/v2/user_activity/background-generator"

        payload = {
            "file_name": "my-image.jpg",
            "input_image_link": input_image_url,
            "prompt": prompt
        }

        headers = {
            "x-api-key": API_KEY,
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()

        data = response.json()

        return data['order_id']

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
   
def download_results(order_id, input_file_name, output_directory):
    try:
        url = f"https://prodapi.phot.ai/external/api/v1/user_activity/order-status?order_id={order_id}"

        headers = {
            "x-api-key": API_KEY,
        }

        response = requests.get(url, headers=headers)
        response.raise_for_status()

        data = response.json()

        for index, output_url in zip(range(1, 5), data['output_urls']):
            response = requests.get(output_url)
            response.raise_for_status()  # To ensure the request was successful

            variant_file_name = os.path.join(output_directory, f"phot-ai-{input_file_name}-variant_{index}.webp")

            with open(variant_file_name, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {variant_file_name}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)


def process_image(input_image_url, prompt, input_file_name, output_directory):
    order_id = generate_background(input_image_url, prompt)
    print(f"order_id: {order_id}")
    time.sleep(300) # sleep while the results are generated
    download_results(order_id, input_file_name, output_directory)

def iterate_over(image_urls, prompts, file_names, result_directory):
    with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
        for image_url, prompt, file_name in zip(image_urls, prompts, file_names):
            executor.submit(process_image, image_url, prompt, file_name, result_directory)

if __name__ == "__main__":
    # FOOD

    FOOD_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F1.jpg?alt=media&token=850ab5be-a503-40f1-a270-c7cdcc62bdeb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F2.png?alt=media&token=9c6e5512-efb8-47bc-b45d-01cb5b00b698",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F3.jpg?alt=media&token=04851dba-83bc-4d24-9549-ad029a838c33",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F4.jpeg?alt=media&token=191746c4-c528-4e2f-9e04-e1cac0b8d4b9",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F5.jpeg?alt=media&token=97421dcf-14b0-4353-913e-03428341e274",
    ]

    FOOD_PROMPTS = [
        "the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.",
        "a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background",
        "a plate of chicken wings and dipping sauces on a black scampered wooden table.",
        "the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.",
        "the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.",
    ]

    FOOD_OUTPUT_DIRECTORY = "./output-phot-ai/food/"

    if not os.path.exists(FOOD_OUTPUT_DIRECTORY):
        os.makedirs(FOOD_OUTPUT_DIRECTORY)

    iterate_over(image_urls=FOOD_IMAGES_URLS, prompts=FOOD_PROMPTS, file_names=list(map(str, range(1, len(FOOD_IMAGES_URLS) + 1))), result_directory=FOOD_OUTPUT_DIRECTORY)

    # COSMETIC

    COSMETIC_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F1.jpeg?alt=media&token=837a3a2c-4621-44bc-84d7-ca1bafd7dad7",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F2.jpeg?alt=media&token=9327b3b6-68a6-4106-88cc-978afa5c048e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F3.png?alt=media&token=6c25d2aa-4a11-4b00-bac6-b98f59289b5c",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F4.jpg?alt=media&token=be6075e1-b754-4f98-8937-cba8d234942d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F5.jpg?alt=media&token=982083a1-b8df-40f7-88cc-c9185670f162",
    ]

    COSMETIC_PROMPTS = [
        "the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.",
        "the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.",
        "the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean",
        "the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry",
    ]

    COSMETIC_OUTPUT_DIRECTORY = "./output-phot-ai/cosmetic/"

    if not os.path.exists(COSMETIC_OUTPUT_DIRECTORY):
        os.makedirs(COSMETIC_OUTPUT_DIRECTORY)

    iterate_over(image_urls=COSMETIC_IMAGE_URLS, prompts=COSMETIC_PROMPTS, file_names=list(map(str, range(1, len(COSMETIC_IMAGE_URLS) + 1))), result_directory=COSMETIC_OUTPUT_DIRECTORY)

    # APPAREL

    APPAREL_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F1.jpeg?alt=media&token=462bd079-f084-4a97-bdf5-51e1ea6454a3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F2.jpg?alt=media&token=7666a271-93c8-4fa5-bf46-e550f2832189",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F3.jpg?alt=media&token=3551ca21-e31a-4076-b810-1bc0aacbaceb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F4.jpg?alt=media&token=4a2d0c5d-b44a-479f-bc35-64fcc3d3d366",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F5.jpeg?alt=media&token=4624dafe-959b-4bfc-b230-7785780abcf7",
    ]

    APPAREL_PROMPTS = [
        "the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue",
        "a baseball cap on a baseball field, with a bright sun in the background",
        "a crocheted poncho on a fluffy blanket, with a soft green grass field in the background",
        "the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.",
    ]

    APPAREL_OUTPUT_DIRECTORY = "./output-phot-ai/apparel/"

    if not os.path.exists(APPAREL_OUTPUT_DIRECTORY):
        os.makedirs(APPAREL_OUTPUT_DIRECTORY)

    iterate_over(image_urls=APPAREL_IMAGE_URLS, prompts=APPAREL_PROMPTS, file_names=list(map(str, range(1, len(APPAREL_IMAGE_URLS) + 1))), result_directory=APPAREL_OUTPUT_DIRECTORY)

    # JEWELRY

    JEWELRY_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F1.jpg?alt=media&token=0afec946-38cf-4773-a96a-d0c158358557",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F2.jpg?alt=media&token=9b93ee57-9343-4611-8156-76c512149002",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F3.jpg?alt=media&token=925a455c-1b58-469d-95c7-7db4ff5ac61e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F4.jpg?alt=media&token=c694560d-951d-4fe5-8390-a4c5df846f51",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F5.jpg?alt=media&token=38205d4d-ce4f-4168-9a91-94d872aed3fe",
    ]

    JEWELRY_PROMPTS = [
        "the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "a long necklace on a black velvet cushion, with a cream stone wall in the background",
        "the image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.",
        "the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.",
    ]

    JEWELRY_OUTPUT_DIRECTORY = "./output-phot-ai/jewelry/"

    if not os.path.exists(JEWELRY_OUTPUT_DIRECTORY):
        os.makedirs(JEWELRY_OUTPUT_DIRECTORY)

    iterate_over(image_urls=JEWELRY_IMAGE_URLS, prompts=JEWELRY_PROMPTS, file_names=list(map(str, range(1, len(JEWELRY_IMAGE_URLS) + 1))), result_directory=JEWELRY_OUTPUT_DIRECTORY)

    # PEOPLE

    PEOPLE_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F1.jpg?alt=media&token=5b57a70d-e94d-4056-8e48-2b8a2c296028",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F2.jpg?alt=media&token=f0e8a0bb-9fd7-4cc3-bd90-b5655321d46d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F3.jpg?alt=media&token=37ade83a-611e-4346-b4fe-5ee484f69ea3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F4.jpg?alt=media&token=3569a732-9be2-4b2d-b685-c55a1093fca8",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F5.jpg?alt=media&token=38875d9b-8f48-4bec-a30a-ca10be2b86d5",
    ]

    PEOPLE_PROMPTS = [
        "a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background",
        "the image features a person walking on a boulder with a breathtaking mountain view in the background.",
        "the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York",
        "the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean",
    ]

    PEOPLE_OUTPUT_DIRECTORY = "./output-phot-ai/people/"

    if not os.path.exists(PEOPLE_OUTPUT_DIRECTORY):
        os.makedirs(PEOPLE_OUTPUT_DIRECTORY)

    iterate_over(image_urls=PEOPLE_IMAGE_URLS, prompts=PEOPLE_PROMPTS, file_names=list(map(str, range(1, len(PEOPLE_IMAGE_URLS) + 1))), result_directory=PEOPLE_OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Bria.ai" %}

```python
import os
import requests

API_KEY = "YOUR_BRIA_API_KEY"
SEED = 117879368

def process_image(input_image_url, prompt, input_file_name, output_directory):
    try:
        url = "https://engine.prod.bria-api.com/v1/background/replace"

        payload = {
            "image_url": input_image_url,
            "sync": True,
            "bg_prompt": prompt,
            "negative_prompt": "oversaturated, ugly, 3d, render, cartoon, grain, low-res, kitsch, text, lens, camera",
            "refine_prompt": True,
            "num_results": 4,
            "seed": SEED
        }

        headers = {
            "api_token": API_KEY,
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers, timeout=300)
        response.raise_for_status()

        data = response.json()

        for index, result in zip(range(1, 5), data['result']):
            response = requests.get(result[0])
            response.raise_for_status()  # To ensure the request was successful

            variant_file_name = os.path.join(output_directory, f"bria-ai-{input_file_name}-variant_{index}.png")

            with open(variant_file_name, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {variant_file_name}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)

def iterate_over(image_urls, prompts, file_names, result_directory):
    for image_url, prompt, file_name in zip(image_urls, prompts, file_names):
        process_image(image_url, prompt, file_name, result_directory)

if __name__ == "__main__":
    # FOOD

    FOOD_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F1.jpg?alt=media&token=850ab5be-a503-40f1-a270-c7cdcc62bdeb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F2.png?alt=media&token=9c6e5512-efb8-47bc-b45d-01cb5b00b698",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F3.jpg?alt=media&token=04851dba-83bc-4d24-9549-ad029a838c33",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F4.jpeg?alt=media&token=191746c4-c528-4e2f-9e04-e1cac0b8d4b9",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F5.jpeg?alt=media&token=97421dcf-14b0-4353-913e-03428341e274",
    ]

    FOOD_PROMPTS = [
        "the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.",
        "a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background",
        "a plate of chicken wings and dipping sauces on a black scampered wooden table.",
        "the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.",
        "the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.",
    ]

    FOOD_OUTPUT_DIRECTORY = "./output-bria-ai/food/"

    if not os.path.exists(FOOD_OUTPUT_DIRECTORY):
        os.makedirs(FOOD_OUTPUT_DIRECTORY)

    iterate_over(image_urls=FOOD_IMAGES_URLS, prompts=FOOD_PROMPTS, file_names=list(map(str, range(1, len(FOOD_IMAGES_URLS) + 1))), result_directory=FOOD_OUTPUT_DIRECTORY)

    # COSMETIC

    COSMETIC_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F1.jpeg?alt=media&token=837a3a2c-4621-44bc-84d7-ca1bafd7dad7",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F2.jpeg?alt=media&token=9327b3b6-68a6-4106-88cc-978afa5c048e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F3.png?alt=media&token=6c25d2aa-4a11-4b00-bac6-b98f59289b5c",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F4.jpg?alt=media&token=be6075e1-b754-4f98-8937-cba8d234942d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F5.jpg?alt=media&token=982083a1-b8df-40f7-88cc-c9185670f162",
    ]

    COSMETIC_PROMPTS = [
        "the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.",
        "the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.",
        "the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean",
        "the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry",
    ]

    COSMETIC_OUTPUT_DIRECTORY = "./output-bria-ai/cosmetic/"

    if not os.path.exists(COSMETIC_OUTPUT_DIRECTORY):
        os.makedirs(COSMETIC_OUTPUT_DIRECTORY)

    iterate_over(image_urls=COSMETIC_IMAGE_URLS, prompts=COSMETIC_PROMPTS, file_names=list(map(str, range(1, len(COSMETIC_IMAGE_URLS) + 1))), result_directory=COSMETIC_OUTPUT_DIRECTORY)

    # APPAREL

    APPAREL_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F1.jpeg?alt=media&token=462bd079-f084-4a97-bdf5-51e1ea6454a3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F2.jpg?alt=media&token=7666a271-93c8-4fa5-bf46-e550f2832189",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F3.jpg?alt=media&token=3551ca21-e31a-4076-b810-1bc0aacbaceb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F4.jpg?alt=media&token=4a2d0c5d-b44a-479f-bc35-64fcc3d3d366",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F5.jpeg?alt=media&token=4624dafe-959b-4bfc-b230-7785780abcf7",
    ]

    APPAREL_PROMPTS = [
        "the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue",
        "a baseball cap on a baseball field, with a bright sun in the background",
        "a crocheted poncho on a fluffy blanket, with a soft green grass field in the background",
        "the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.",
    ]

    APPAREL_OUTPUT_DIRECTORY = "./output-bria-ai/apparel/"

    if not os.path.exists(APPAREL_OUTPUT_DIRECTORY):
        os.makedirs(APPAREL_OUTPUT_DIRECTORY)

    iterate_over(image_urls=APPAREL_IMAGE_URLS, prompts=APPAREL_PROMPTS, file_names=list(map(str, range(1, len(APPAREL_IMAGE_URLS) + 1))), result_directory=APPAREL_OUTPUT_DIRECTORY)

    # JEWELRY

    JEWELRY_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F1.jpg?alt=media&token=0afec946-38cf-4773-a96a-d0c158358557",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F2.jpg?alt=media&token=9b93ee57-9343-4611-8156-76c512149002",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F3.jpg?alt=media&token=925a455c-1b58-469d-95c7-7db4ff5ac61e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F4.jpg?alt=media&token=c694560d-951d-4fe5-8390-a4c5df846f51",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F5.jpg?alt=media&token=38205d4d-ce4f-4168-9a91-94d872aed3fe",
    ]

    JEWELRY_PROMPTS = [
        "the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "a long necklace on a black velvet cushion, with a cream stone wall in the background",
        "the image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.",
        "the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.",
    ]

    JEWELRY_OUTPUT_DIRECTORY = "./output-bria-ai/jewelry/"

    if not os.path.exists(JEWELRY_OUTPUT_DIRECTORY):
        os.makedirs(JEWELRY_OUTPUT_DIRECTORY)

    iterate_over(image_urls=JEWELRY_IMAGE_URLS, prompts=JEWELRY_PROMPTS, file_names=list(map(str, range(1, len(JEWELRY_IMAGE_URLS) + 1))), result_directory=JEWELRY_OUTPUT_DIRECTORY)

    # PEOPLE

    PEOPLE_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F1.jpg?alt=media&token=5b57a70d-e94d-4056-8e48-2b8a2c296028",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F2.jpg?alt=media&token=f0e8a0bb-9fd7-4cc3-bd90-b5655321d46d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F3.jpg?alt=media&token=37ade83a-611e-4346-b4fe-5ee484f69ea3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F4.jpg?alt=media&token=3569a732-9be2-4b2d-b685-c55a1093fca8",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F5.jpg?alt=media&token=38875d9b-8f48-4bec-a30a-ca10be2b86d5",
    ]

    PEOPLE_PROMPTS = [
        "a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background",
        "the image features a person walking on a boulder with a breathtaking mountain view in the background.",
        "the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York",
        "the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean",
    ]

    PEOPLE_OUTPUT_DIRECTORY = "./output-bria-ai/people/"

    if not os.path.exists(PEOPLE_OUTPUT_DIRECTORY):
        os.makedirs(PEOPLE_OUTPUT_DIRECTORY)

    iterate_over(image_urls=PEOPLE_IMAGE_URLS, prompts=PEOPLE_PROMPTS, file_names=list(map(str, range(1, len(PEOPLE_IMAGE_URLS) + 1))), result_directory=PEOPLE_OUTPUT_DIRECTORY)

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.photoroom.com/resources/ai-backgrounds-competitors-benchmark-claid.ai-phot.ai-bria.ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
