Hi everyone. I would like your help with setting up automation. What I want to do is, I have a Google sheet, with a list of prompts, and some images stored in my Google Drive. I want to send each of these images to Gemini, with all the prompts in Google Sheets. For instance, if I have 2 prompts and 3 images, that means 2 prompts will be sent for each image.
I have been at this, for the past few days, and would love your help and tips with this. Thanks
If its as straight forward as you said you might just need to fetch all images from drive. Then use Split node and send them all (one by one) to gemini with all the prompts. If the prompts are always the same you can store them in a Set Node so they are accessible and you dont need to fetch them each time.
Hard to say more without knowing more about the structure of your data.
Can you share some more info about how are the images connected to the prompts?
Assuming your prompts are in Sheet1 of the spreadsheet and your image URL’s are in Sheet2:
you can get all records from both and use the merge node with Combine By: All possible combinations set
Then loop through the result and pass this to the AI:
Here is a workflow example.
Please note that i just took the urls. If gemini requires the binary data you will have to add a logic to download and map the binary file with a google drive download a file nodebefore the merge.
You’ll also have to adjust the field names to match your spreadsheet columns.
Thanks for your help, I was able to get it to work with this. The issue I am now facing is that it is generating 6 results, instead of just the result for the images. currently, I have just 3 images in my google drive, and 2 prompts
Thanks for your input. Yes, I have tried this, but the thing is I have 2 prompts in my google sheet, and 3 images in my google drive, what i want is all the prompts should be sent for each image, and it should only return 3 responses, but right now, It seems that it is sending each prompt one by one, and giving me 6 responses, instead of sending the 2 prompts for each image at once, and return 3 response
Simplest is to add a Code node and ask ChatGPT (or whichever you prefer) to generate a code that will take previous node input and return a JSON array with all prompts