Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Google Gemini Image Generation API - 404 NOT_FOUND Error

RLL
Bronze 1
Bronze 1

I'm following this tutorial to generate images using Google's Gemini API. However, when I try to run the code, I get the following error:

 

 

ClientError: 404 NOT_FOUND. {'error': {'code': 404, 'message': 'Publisher Model `projects/project_id/locations/us-central1/publishers/google/models/gemini-2.0-flash-exp-image-generation` not found.', 'status': 'NOT_FOUND'}}

 

 

The only difference from the tutorial is that I'm instantiating the client like this:

 

 

client = genai.Client(vertexai=True, project=PROJECT_ID, location=LOCATION)

 

 

Has anyone encountered this issue before? Is this model currently available, or do I need to enable something specific in my Google Cloud project?

Any help would be greatly appreciated! Thanks in advance.

0 0 65