Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Vertex edit_image failing with "Responsible AI practices" error message

I'm trying to use Vertex AI in python to edit a base image to place it on some AI-generated backgrounds. The purpose of this is to generate some training images in order to identify the base image when it's seen in images.

I'm doing something analogous to this:

generation_model = ImageGenerationModel.from_pretrained("imagegeneration@006")
response = generation_model.edit_image(prompt=prompt, base_image=base_image,
guidance_scale=guidance_scale,
number_of_images=number_of_images,
edit_mode='product-image')

The error I'm getting is this:

InvalidArgument: 400 Image editing failed with the following error: Imagen could not generate images
because the input image violates Google's Responsible AI practices. If you think this was an error,
send feedback. Support codes: 43188360, 72817394, 49114662, 63429089

The image being processed is the one featured on this page: https://scryfall.com/card/fdn/555/joraga-invocation

I'm assuming this is due to a drawing of elf skin triggering some kind of prurience detector, but this strongly seems like a false positive if that's the case.

1 1 437
1 REPLY 1

Hi @AlanKrueger,

Welcome to Google Cloud Community!

The error message you're getting ("Imagen could not generate images because the input image violates Google's Responsible AI practices") suggests that the image you're trying to use might contain something that goes against Google's AI Principles, such as sensitive content. Based on the description of the image and the results from browsing the webpage, it appears to be a fantasy illustration of a partially nude female elf bowing in a forest. It's possible that the nudity is triggering the "prurience detector" in Google's AI.

To identify if the issue stems from the base image content, you can try using a different image altogether. There are many other Magic: The Gathering cards that you could use that don't contain nudity.

If the issue persists, please contact Google Cloud support for further assistance.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.