How to process images from Google Drive using Make.com
Make.com is a popular no-code tool that allows you to easily design and run powerful workflows.
In this tutorial, you'll learn how to use Make.com to create a workflow that:
Watches a Google Drive folder to detect new images
Sends the new images to the Image Editing API
Saves the result of the API call to another Google Drive folder
Step 1: Watching a Google Drive folder
In Make.com, first create a new scenario:
Then, create a new Google Drive module, with the action Watch Files in a Folder:
Then, configure the module to select the Google Drive folder that you want to watch:
Here, I'm watching a folder called Images to process that's stored at the root of my Google Drive.
Step 2: Downloading files from Google Drive
The next step will be to download the image file from Google Drive, so that Make.com can send it to the Image Editing API.
To do that, connect to the first module another Google Drive module called Download a File:
Then, configure this new module to download a file using the File ID fetched by the previous module.
Step 3: Calling the Image Editing API
Now that we have downloaded the input image file, we're ready to call the Image Editing API.
To implement the API call, we're going to add another module called HTTP with the action Make a request:
Next, we need to configure this module.
First, we set the URL of the endpoint we're calling:
Then, we set the Method of the request to POST:
Next, we add a header that sets the API key:
If you don't have an API key, here are the steps to create yours.
Then, we set the Body type to Multipart/form-data:
Next, we add a first Field to the request, to upload the file that was downloaded by the previous module:
And finally, we add additional fields for the edits that we want to apply to the image.
Here I'm setting an outputSize
of 1000x1000
and a padding
of 10%
:
Step 4: Uploading the result to Google Drive
Now that we've implemented the API call, we're down to the last step: uploading the result to a Google Drive folder.
First, we add an Image module with the action Convert a format:
We'll configure this module so that it uses the data returned by the API call to create an image file, with the same name than that of the original image:
Then, we can add a final Google Drive module with the action Upload a File:
And finally, we configure this module to upload the result of the previous one to the desired Google Drive folder:
Step 5: Running the workflow
Now that everything has been configured, running the workflow will be pretty easy.
You can use the controls at the bottom left of the screen to either:
Run the workflow one time
Schedule it so that it's run every N minutes
The best practice we recommend is to first use Run once to test the worflow with a small number of images, and then enable the Scheduling to watch the Google Drive folder and process new images automatically.
Conclusion
In this tutorial, we saw how to use Make.com to easily integrate Google Drive with the Photoroom API.
We took the example of watching a Google Drive folder and automatically processing images through the Image Editing API, but it's of course possible to modify the workflow to:
replace Google Drive with another storing service
call another Photoroom API, like the Remove Background API
add additional steps to run some logic specific to your use case
Last updated