๐Ÿ“ฑ Social Automation Intermediate โฑ 20 min ๐Ÿ–ฅ๏ธ Local hardware

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_name field 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:

  1. HTTP POST to Blotato's upload endpoint
  2. Set header: blotato-api-key: YOUR_KEY
  3. Toggle Use Binary Data and point it at your downloaded image
  4. 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), and mediaUrls (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

  1. Log into Blotato โ†’ click the Settings icon
  2. Connect each social account (Login with Twitter, Login with Instagram, etc.)
  3. After connecting, each account shows a Copy Account ID button โ€” copy and save each one
  4. Paste the correct ID into each platform's HTTP request body as "accountId"

Getting Your Blotato API Key

  1. Log into Blotato โ†’ Settings โ†’ API
  2. Copy your API key
  3. In n8n, store it in a Set node as blotato_api_key and 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.

๐Ÿ’ก Tip to Try

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.

๐Ÿ’ฌ Q&A

No comments yet. Be the first to ask a question.
โ† Previous
First lesson in this category
● Automate Social Media Posts with n8n + ComfyUI + Blotato โ€” 100% Free PHP 8.x UTF-8