Learn how to build a powerful automated workflow that connects Slack to Replicate's AI image generation models using Zapier. This comprehensive guide shows you how to create a system that generates AI images with a simple Slack message, automatically saves them to Google Drive, and returns the results - all without writing complex code.
The Basic Setup
You'll need:
Slack (obviously)
Zapier (the glue that holds it all together and zaps it into automated life)
Replicate (the gateway to the AI models that make the images)
Google Drive (keeps everything safe and sound)
Zapier Templates
See below for lots more detail on each step of each Zap!
Zap 1: zapier.com/shared/5592c9c0…
Zap 2: zapier.com/shared/11691b5c…
What is Replicate.com?
Think of Replicate as a massive toolbox of AI models that someone else maintains for you. Instead of setting up powerful computers and wrestling with complex AI software yourself, you just connect to their API, and away you go.
Here's what makes it brilliant:
Pay per use (only fork out when you actually generate something)
Loads of different AI models ready to go
Dead simple to use - just make an API call and the job's done
They handle all the faffy bits like servers and GPU power
For this guide, I'm using their Flux 1.1 Pro Ultra model, but you could swap that for any other image generation model they've got. It is handy if you want to test different models without getting your hands too dirty with the technical bits.
The Two-Part Magic Trick 🪄
Part 1: Getting Your Image Request Going
1. Set up Slack to catch your message when you type something like “Generate: A hamster wearing a hard hat”.
2. Optional but fun: I've got ChatGPT giving each request a snarky French critique.
3. Clean up the message using Python (get rid of any weird bits that Replicate doesn't like).
4. Fire it off to Replicate (that's the AI doing the actual work).
Part 2: Saving Your Creation
1. “Catch” the finished image.
2. Download it properly.
3. Stick it in Google Drive (so it doesn't disappear into thin air).
4. Pop it back in Slack with a proper link.
The Nitty Gritty Bits
All the technical code and configurations you need are below - these work for the Flux AI Image Generator Model: black-forest-labs / flux-1.1-pro-ultra
Zap 1: Sending the Prompt to Replicate
Step 1. Trigger: Slack Message. Event: “New Message Posted to Channel.” This triggers the process whenever you send a specific Slack message in a channel (e.g. a prompt like “Generate: A hamster in an astronaut helmet”).
Step 2. Optional: Critique the Prompt with ChatGPT. Use ChatGPT to provide a faux French critique of the prompt for fun. You can skip this step if unnecessary.
My prompt was:
“The user has asked for the image below to be generated via a Slack message, can you use your best snobby French impression and respond in a faux-French accent (not actual French) and lambast them for using AI as it'll be the death of art and critique their prompt? Finally, tell them reluctantly that you will create their image. Short and funny length appropriate for Slack. #their prompt “{the Slack message}””
Step 3. Python Script: Clean the Prompt. Add a Python code step to clean the prompt and remove unwanted characters.
input_data = {"message": input["slack_message"]}
cleaned_message = input_data["message"].replace("\n", " ").strip()
return {"cleaned_text": cleaned_message}Step 4. Webhook: Send the Prompt to Replicate. Method: POST. URL: the Replicate endpoint for the Flux 1.1 Pro Ultra model. Headers: `Authorization: Token <your_replicate_api_key>` and `Content-Type: application/json`. Body:
{
"input": {
"prompt": "{{cleaned_text}}",
"aspect_ratio": "3:2",
"output_format": "png",
"safety_tolerance": 2
},
"webhook": "<Zap 2 webhook URL>",
"webhook_events_filter": ["completed"]
}Step 5. Slack: Send Confirmation. Send a message back to Slack confirming the prompt has been sent and is being processed.
Zap 2: Saving the Image and Sending it Back
Step 1. Trigger: Webhook Catch. This webhook catches the output URL from Replicate once the image generation is completed. The URL given to you here is what you place into the {Zap 2 webhook URL} variable in the JSON above 👆
Step 2. Download Image. Use a Webhook GET request to retrieve the raw image data from the {output_url} in Step 1.
Step 3. Upload Image to Google Drive. Event: Google Drive “Upload File”. File: use the output from Step 2. Filename: use a dynamic filename like generated-image.png. Folder: specify where the images should be saved.
Step 4. Slack: Send Image and Google Drive Link. Use the “Send Channel Message” event to send a permanent Google Drive link to the saved image, plus the image itself using the URL from Replicate.
Why It's Brilliant
Type in Slack, get an image back - job done. Everything's saved properly in Google Drive, no more faffing about with manual downloads, and it works like a charm every time.
Extra Tips
Want different sized images, or a different aspect ratio? All of those variables are configurable in the Body element of Zap 1's API POST to Replicate (Step 4).
Something gone wrong? No worries - paste the error into ChatGPT and it will help resolve it.
What Next?
Get it set up and give it a whirl. Even if you're not a tech wizard (I'm certainly not), this is actually pretty straightforward to get going. And once it's running, it's really handy for knocking up quick visuals and significantly cheaper than paying for Midjourney and the rest.




About the author
Ben Milsom
Ben Milsom is the founder of Steady Bow Marketing, helping service businesses turn Google searches into ringing phones through no-nonsense websites and Google Ads. He's the author of the best-selling book Talk More, Type Less and has spent 8+ years getting real results for trades and service suppliers.

