#
Automated Meme Generation System
Github Repo: https://github.com/0xarchit/carbon-now-sh-api
Github Repo: https://github.com/0xarchit/n8n-templates
Tip
A complete AI-powered automation system that generates programming memes and posts them to Instagram automatically using n8n workflows and a custom Carbon.now.sh API.
#
Architecture
graph LR A[AI Agent<br/>n8n] --> B[Carbon API<br/>FastAPI] B --> C[Instagram<br/>Auto-post]
#
Components
#
1. AI Agent (n8n Workflow)
- Purpose: Automated meme generation and Instagram posting
- Stack: n8n + Mistral LLM + Memory + Scheduling
- Features:
- Scheduled meme generation (customizable intervals)
- Sarcastic programming humor using Mistral AI
- Persistent memory to avoid repetition
- Automated Instagram posting via FB Graph API
- Cloudinary integration for image hosting
#
2. Carbon API (FastAPI Service)
- Purpose: Convert code snippets to beautiful images
- Stack: FastAPI + Playwright + Carbon.now.sh
- Features:\
- Pre-configured Seti theme with Hack font
- No watermarks or distractions
- Docker containerized
- CORS enabled
#
Quick Start
#
Carbon API
cd carbon-api
docker build -t carbon-api .
docker run -p 8000:8000 carbon-api
#
AI Agent Setup
- Import
ai-agent/instagram_autopost.json
into your n8n instance - Configure credentials:
- Mistral Cloud API
- Facebook Graph API (Instagram)
- Cloudinary (optional)
- Update URLs to point to your Carbon API deployment
- Set schedule trigger as needed
#
Live Demo
Carbon API: https://zeroxcarbon.onrender.com/docs
Instagram: https://www.instagram.com/echosarcasm
#
Prerequisites
- Docker or Python 3.11+
- Playwright (auto-installed)
- n8n instance (self-hosted or cloud)
- Mistral Cloud account
- Facebook Developer account (Instagram Basic Display)
- Cloudinary account (optional)
#
Configuration
#
AI Agent Workflow
- Schedule Trigger: Set your posting frequency
- Mistral LLM: Configure API credentials
- Carbon API URL: Point to your deployed Carbon service
- Instagram: Configure FB Graph API credentials
- Memory: Maintains context to avoid duplicate memes
#
Carbon API
- Theme: Seti (dark)
- Font: Hack 12px
- Output: JPG at 90% quality
- No line numbers or window controls
#
Workflow Process
graph TD A[Schedule Trigger] --> B[AI Agent] B --> C[Memory Check] C --> D[Caption Generator] D --> E[Carbon API] E --> F[Cloudinary] F --> G[Instagram Auto-post]
- Schedule Trigger → Starts the automation
- AI Agent → Generates witty programming meme
- Memory Check → Ensures uniqueness
- Caption Generator → Creates Instagram-ready text
- Carbon API → Converts code to beautiful image
- Cloudinary → Uploads image (optional)
- Instagram → Auto-posts to your account
#
Customization
- Meme Style: Edit prompts in AI Agent nodes
- Visual Theme: Modify Carbon API parameters
- Posting Schedule: Adjust Schedule Trigger intervals
- Platforms: Extend to Twitter, LinkedIn, etc.
#
License
Open source - feel free to fork and customize for your own automated meme empire!