Can ai (ChatGPT) view local computer images files and rename the images?

Hello - I’m considering getting a paid plan, but before I do, I’m wondering if this scenario is even possible.

I have generated many AI images, and the image names are long strings of letters and number. I’ve saved these files to my local computer file.

What I would like to do is have AI somehow rename the images to match the design. I don’t know if this is possible at all. Or, would it be possible if I moved the image files into Google Docs?
As I’m new, I’m not sure where to begin.

Thank you

Hello! Welcome to the Make community!

It will be possible only if the files are in Google Drive (or any other Saas-Based drive). You could upload the files in a folder (no need to put them in a google doc), and then build a Make scenario to download the files, ask AI to read content and describe it, and from there, generate an image name, then rename the images.

Benjamin

2 Likes

Hello again, I built an example


I have 3 images (png and jpeg)


I will store result here

This is my scenario:

  • I check files in my directory
  • if it’s an image (png or jpeg), I download it
  • I ask OpenAI Vision to analyse image and give 2 words based on the content
  • I detect the Mime type of the file to generate the relevant extension
  • I copy the file to the new folder with the name from OpenAI Vision


This is my prompt

When I run it


Vision gave me description I will use for file names


Here is the result

Let me know if you want more details

Benjamin

2 Likes

Thank you! I will try some to see how I do and get back to you … this could be a life saver!

2 Likes

Do you happen to know the specific APIs I would need for this process (I’m having to set up the Google OAuth Consent).
Thank you!

What do you mean?

You could use exactly the same modules as I did in my example. I used Google Drive since you mentioned Google, but you can use any other SaaS drive like Box, Onedrive, Dropbox, Egnyte, etc. It’s really up to you.

Or maybe I misunderstood your question? Whatever the api you use, you need to let Make access to them on your behalf. Google uses Oauth2; the client application is already provided by Make, so you should not need to add your own clientId and secret.

Let me know if it didn’t answer your question.

Benjamin

1 Like

I received this note right away, so am setting up the OAuth now:

Sure, you need to let Make access your Google account to be able to download files and copy them.

If you click on Signin with Google, you will have a pop you from Google where you will grant Make access to your Drive

1 Like

I got the authorization done, and am now going through the Google modules (as I mentioned, I am very green at all of this). I’m not sure how to set up the #2 module - would you possibly be able to send me a screen shot of that one? I’m trying to figure out how to get Google to realize that they are .png or .jpg files (that’s all there is in there, but it sound like I need to be specific here?), so that I can move to the next module. Thanks!

@TeriLee12,

It’s a little bit complex to show you all the steps I went through since it’s very specific to my configuration. And i’m not sure OpenAI Vision can handle jpg files, this has to be tested.

I can send you screenshots of all my steps tomorrow first time, but I’m not sure it will be helpful for you.

The best would be that you go to the Make Academy and that you follow the basics and foundation trainings there, because there are concepts that are required to know if you want to be at ease with Make.

Tomorrow, let me send you the steps I went through, hoping it will be helpful.

Benjamin

1 Like

It is only png files … I don’t know if that helps. Funny enough, I went through about 60% of the ‘Academy’ … but probably need to do it again. :slight_smile:

1 Like

That’s good it’s only png, it will simplify things :wink:

Tomorrow, let me show you all the details.

In the meantime, do you have a paid OpenAI account? And an API Key?

Benjamin

1 Like

Yes to both. Thanks!

Hello!

here is a detailed description of my scenario, hoping it will help you.
But first, I noticed that finally it works with both JPEG and PNG files, and since I had both, I kept the “MIME” step; it will be optional for you if all your images are PNG.


Classic “Watch” module where I pick new files in a folder. it limits to 20 but you can put higher. If you have more than 20 files, running the scenario multiple times will pick all file 20 by 20.
And, when all is done, it will only pick new files you add in the folder

Note: With Make, since you get multiple files (bundles), the next steps will be executed for each file, one by one.


My filter check the “mime” field of the file and lets the scenario continue only if it’s jpeg or png. Any other file type will not be processed


I used OpenAI Vision, to detect content and generated a name with 2 words separated by underscore.


This part is optional for you. In my case I can have jpeg or png, so I use MIME Type to generate the relevant file extension according to the type

Benjamin

2 Likes

Thank you so much for this. Turns out I have .jpg files (don’t know why, but didn’t realize the image generator I used was spitting out .jpg files).

Also, even though all of the files are .jpg files (image with input files shown) , I still need the filter because if I don’t have it, I receive a run-time error suggesting that the file was a word file. So, I’ve added the filter back in … but then the bundle doesn’t filter through.

When I run it, it does appear to bundle properly with 4 files into the bundle in the first module (image #2), and it indicates the scenario was completed, but the log (image 3) shows that it stopped at the 2nd module.

I also looked at the Module Inspector for the 2nd Google Drive module – don’t know if it looks correct.

I know this is an easy scenario, so I can’t figure out why it isn’t working… I’ve followed all of your steps to a T.

Oh, and I also purchased the Pro-plan… I’m thinking that will give me all of the options :slight_smile:


1 Like

Hello!

It’s really weird that the filter doesn’t let the files go through the next step?!?!
Can you double-check that you didn’t accidentally put a space after image/jpeg and image/png?
In case you copied/pasted it, I would recommend you type them.

What you can also do, is, in the filter results, hover your mousse on the "7.mimetype’ to see what was the data

Like this:
2024-06-21_18-38-06 (1)

1 Like

So, no spaces (I typed them in) On the 7.Mime Type it is showing image/jpeg, although all of the images (and I set it up as) image/jpg. That sounds like it is the culprit. is there a way to fix that?

So effectively, the Mime type is jpeg, but the images are jpg

Hello,

I don’t understand, how does it appear in the Mime-type field of Google/Dowload a file?

1 Like

This is what is scrolls down as for all options