Hello all! I’ve built an app in Google AI Studio and am having trouble with image retrieval. I’ve tried uploading the files to Google AI Studio directly (both through the prompt and file explorer), and they show up and display when I click on them in File Explorer, but no matter how I reference them in the code, I cannot get them to display (shows as a broken image link). I’ve tried loading them to my Google Drive, sharing the file, and using the shared link but also with no luck.
I’d appreciate any advice on how/where to store image files and how to appropriately code the link for display retrieval.
Bonus points to anyone who can help me figure out how to have Google AI Studio programmatically store an image it generated for later retrieval.
To reference an image reliably in Google AI Studio, you will need a direct public URL. You can use Google Cloud Storage (GCS) to upload your images to a bucket and configure the file permissions to be publicly readable. You can then use the public URL format from the service (e.g., https://storage.googleapis.com/<YOUR-BUCKET>/image.png) in your app’s code.
Hey,@Sonali_Kumari1. Thank you for the suggestion. I’ve created a GCS and bucket, uploaded the pictures, and made them public. Google AI Studio still just shows a broken link though. When I copy the URL from the broken link placeholder, the URL opens just fine as an image, so I’m not sure what I’m doing wrong.
Hey,@digs777. Thanks for the reply! I’ve set up a multiple-choice assessment that determines a personality type based on the responses selected. The report page then displays the personality type, a description, and an image based on the personality type. The image, however, will not seem to display no matter how I try to reference the link or where I store the images.
It’s working now. I stored the files in a public GCS bucket but needed to adjust the code in my project a bit to display an image from an external source appropriately, since I’d started with the images locally.