Skip to content

Change the World: Cutting-Edge, GenAI-Powered Background Replacement

The latest GenAI-powered feature from Cloudinary is here: the Generative Background Replace transformation. Seamlessly replacing or adding backgrounds in images is now faster, far less expensive, and an amazingly scalable way to enhance and customize visuals at scale. It’s perfect for an application that includes enhancing product listings and online store visuals for e-commerce, website content, and social media.

Cloudinary’s GenAI-based advanced editing capabilities are making manual, time-consuming editing work a thing of the past.

Advanced generative AI models power the Generative Background Replace feature. Core capabilities include: 

  • Auto background detection and removal. Detect background elements about the core subject and remove the unnecessary pixels.
  • Auto background generation. Auto-generate a background based on LLM interpretation of the foreground elements without prompting.
  • Guiding via prompts. User-provided prompts auto-generate a background based on your hints and on the imagery in the foreground.
  • Seeding and variations. Generate background variations or return to previously generated variations using a seed parameter.
  • Flexibility and scale. This transformation works with all Cloudinary transformations. An explanation, with examples, of all Cloudinary transformations is available here

Cloudinary’s Background Replace feature is intelligent enough to recognize the foreground subjects and build a new background around them. The powerful LLM and Diffusion models running behind the scenes make this possible.

In this short video made from actual examples, you’ll see how the model detects the watch and builds the surrounding background, even including reflections, when appropriate.

  • Integrate a subject into any background that suits your needs without the manual effort or expensive reshoots.
  • Test multiple versions of Background Replace using the seed parameter; creating variations at scale – a massive time saver when you need to get creative approval quickly.
  • Background Replace virtually “scouts” locations as part of a pre-production workflow.

Example: A fashion retailer can use Generative Background Replace to create different seasonal backgrounds for product photos. A winter collection can be showcased with snowy, festive backgrounds, while the same products can be re-photographed with a summer theme without additional cost of a separate photo shoot. Quick adaptation to marketing campaigns and promotions throughout the year is another bonus.

  • Switch out the backgrounds in existing images to breathe new life into old assets for new campaigns or audiences.
  • Change the tone of existing assets by creating new backgrounds that match the foreground subject or product.

Example: A travel agency with a library of destination photos can update its promotional materials by changing the backgrounds to reflect different times of the year or specific themes. Meaning a beach scene can be transformed into a sunset image or a lively beach party background, making the images fresh and relevant for various marketing campaigns.

Replace your image’s background with an AI-generated one. If no prompt is specified, the background is based on the image’s contents. Otherwise, it’s generated based on the specified natural language prompt. It also works with images with transparent backgrounds. 

In this example, you’ll see what happens when you transform the image with and without a prompt.

2 women 2 women floral background

Original

https://res.cloudinary.com/demo/image/upload/pm/group-2.jpgCode language: JavaScript (javascript)

Transformed

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace/pm/group-2.jpgCode language: JavaScript (javascript)
headset headset green background

Original

https://res.cloudinary.com/demo/image/upload/pm/object-4.jpgCode language: JavaScript (javascript)

Transformed

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace/pm/object-4.jpgCode language: JavaScript (javascript)

Let’s look at the same image, but this time with a custom prompt. Let’s try “fashion show.”

2 women 2 women fashion runway background

Original

https://res.cloudinary.com/demo/image/upload/pm/group-2.jpgCode language: JavaScript (javascript)

Transformed

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace:prompt_fasion%20show/pm/group-2.jpgCode language: JavaScript (javascript)
headset headset granite background

Original

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace:prompt_fasion%20show/pm/group-2.jpgCode language: JavaScript (javascript)

Transformed

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace:prompt_granite/pm/object-4.jpgCode language: JavaScript (javascript)

As noted above, for images without transparency, the effect first determines the foreground elements and leaves those areas intact while replacing the background.

Transparent backgrounds aren’t a problem, as the feature will contextualize the generated background based on the subject provided. Let’s take a look:

furniture blank background furniture against wall

Original

https://res.cloudinary.com/demo/image/upload/pm/furniture-4.jpgCode language: JavaScript (javascript)

Transformed

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace/pm/furniture-4.jpgCode language: JavaScript (javascript)

You can also regenerate a background using different seeds if you’re not satisfied with the result. You can also use seeds to return a previously generated result if any other preceding transformation parameters are the same. See the following examples using the same prompts and original image but with different seed parameter values:

luxury car by ocean luxury car by mountain

Original

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace/docs/luxury_car.pngCode language: JavaScript (javascript)

Transformed

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace:seed_1/docs/luxury_car.pngCode language: JavaScript (javascript)
luxury car by ocean luxury car by park

Original

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace/docs/luxury_car.pngCode language: JavaScript (javascript)

Transformed

https://res.cloudinary.com/demo/image/upload/e_gen_background_replace:seed_2/docs/luxury_car.pngCode language: JavaScript (javascript)

Cloudinary’s Generative Background Replace is available for you try on our AI Playground.

For more detailed information on usage, please see the documentation.

Cloudinary’s Generative Background Replace revolutionizes background editing and customization. Leveraging the power of generative AI technology, users can replace and enhance backgrounds, making their visuals more engaging and professional. Whether for e-commerce, marketing, or creative projects, this feature enables high-quality, scalable image transformations that save time and resources and breathe new life into old images.

Interested in the feature? Create an account for free and test it out.

Using generative AI means that results may be less than 100% accurate. There’s a unique transformation count for the Generative Background Replace effect. If you get blurred results when using this feature, the built-in NSFW (not safe for work) check has likely detected something inappropriate. You can contact Support to disable this check if it’s too sensitive. The Generative Background Replace effect is unsupported for animated images, fetched images, or incoming transformations. Initial transformation requests may result in a 423 error response while processing the transformation. You can prepare derived versions in advance using an eager transformation.
Back to top

Featured Post