Use case: I have product pictures (png) in google drive. I set a nod to convert these into base64 before passing them to an AI model to change the background (eg I have picture of sofa and I want to add it to a living room)
Pb: I tried to call with HTTP node the brand new Gemini API, I am based in the US (no geo restrictution) but can’t make it work (end point: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp-image-generation:generateContent?key=APIKEY).
I keep on getting this message: "“models/gemini-2.0-flash-exp-image-generation is not found for API version v1beta, or is not supported for generateContent” while Google API doc says this model exists: Gemini models | Gemini API | Google AI for Developers
I tried Open AI but only manage to make image from scratch, not leveraging my product picture
I am surely missing something but can’t find how to make it work via API calls (on both Open AI UI and Gemini UI I managed to get what I want but not via n8n)
Thanks a lot for any pointer, I spent 3 days on this and exhausted all I could think of
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
So I tried several JSON script (including some generated by Gemini) but no luck at calling this API and generating an image. My set up> Google Drive, download a file then a convert to base64 node, then a HTTP node. The first 2 nodes work, the HTTP one doesn’t. If the endpoint works, it seems my JSON doesn’t. Is there any resource of a JSON call for this API I can refer to? I checked the template but this model isn’t there yet
Are you hard set on using Gemini? Ive done something similar for a side project where I replaced the background of a car using Stability AI. My process was:
Take input image and strip background (Maybe your products already have no background)
Use the structure API to generate a new image using the same structure of the car with a different background
Use n8n Edit Image node to stick the Masked car onto the new image generated.
Nice car!! Thanks a million for the examples, will test this out now. I wanted to use Gemini as I had some API credit but will switch allegiances if I can’t make it work
I will go the Stability AI or even Chatgpt road. I tried the exact worlfow with Gemini (copy pasted it) and still got the same error message so not sure what is wrong with my Gemini API account. Anyway thanks a mill for the solutions.
Sometimes it’s worth using the right tool for the job. There are off course many options out there. I have yet to properly play with the new GPT image gen.