Automate Social Media Posts with n8n + ComfyUI + Blotato โ 100% Free
A completely free social media automation pipeline: n8n orchestrates ComfyUI image gen and Blotato handles publishing.
Lesson Notes
What You'll Build
A zero-cost automated social media pipeline: n8n orchestrates ComfyUI to generate three distinct AI images using different models (QN Image, Flux 1D, and Highdream), then Blotato distributes them across your social accounts โ all triggered from a single workflow run.
What You Need
- n8n running in Docker
- ComfyUI running locally with at least one model downloaded
- Blotato account (free 7-day trial; paid plan required for API access)
- Social media accounts connected in Blotato (Instagram, Twitter/X, LinkedIn, etc.)
Total infrastructure cost once set up: $0 per post. ComfyUI generates images locally, n8n runs locally, and you only pay for Blotato's subscription (not per post).
Why Three Different Models?
Each ComfyUI model has a different aesthetic. Using three models gives you visual variety across platforms without writing three different prompts โ the same prompt through different models produces noticeably different results. QN Image tends toward photorealistic, Flux 1D toward artistic, and Highdream toward cinematic compositions.
Workflow Step by Step
1. Trigger
Use a Schedule Trigger for daily automated posting, or a Manual Trigger while you're building and testing.
2. Generate Images with ComfyUI (ร3)
For each model, create an HTTP Request node:
- Method: POST
- URL:
http://host.docker.internal:8188/prompt - Body: Your ComfyUI API-export JSON, wrapped in
{"prompt": {...}} - Change the
ckpt_namefield in the JSON to select each different model checkpoint - Replace the seed with
{{Math.ceil(Math.random() * 1000000000000)}}
After each POST, add a Wait node (~60โ120 seconds) then a GET request to http://host.docker.internal:8188/history/[promptId] to retrieve the finished image filename. Download it with another HTTP GET to http://host.docker.internal:8188/view?filename=[name].
3. Upload Media to Blotato
Blotato needs media uploaded to its library before you can post. For each image:
- HTTP POST to Blotato's upload endpoint
- Set header:
blotato-api-key: YOUR_KEY - Toggle Use Binary Data and point it at your downloaded image
- The response returns a media URL you'll use in the post step
4. Post to Each Platform
Create one HTTP POST node per platform you want to publish to. Each one:
- Method: POST to Blotato's create-post endpoint
- Header:
blotato-api-key - Body: JSON with
accountId(from Blotato settings),text(your caption), andmediaUrls(the URL from step 3)
You don't have to post to every platform. Disable the platforms you don't use by hovering over the node and clicking the power icon to deactivate it.
5. Getting Blotato Account IDs
- Log into Blotato โ click the Settings icon
- Connect each social account (Login with Twitter, Login with Instagram, etc.)
- After connecting, each account shows a Copy Account ID button โ copy and save each one
- Paste the correct ID into each platform's HTTP request body as
"accountId"
Getting Your Blotato API Key
- Log into Blotato โ Settings โ API
- Copy your API key
- In n8n, store it in a Set node as
blotato_api_keyand reference it via expression in all your HTTP request nodes โ change it in one place and it updates everywhere
What Makes This "100% Free"
The image generation cost is zero because ComfyUI runs on your local GPU. The n8n automation is zero because it runs on your local machine in Docker. You only pay Blotato's flat monthly subscription โ not per post, not per image. At scale (daily posts, multiple platforms), this is significantly cheaper than API-per-post services.
In Blotato, after connecting each social account, click "Copy Account ID" and paste it immediately into a notes file. You'll need a different account ID for every platform in your n8n HTTP request nodes โ having them all in one place saves a lot of back-and-forth.
Tools mentioned in this lesson: