A single-file Streamlit app that turns today's top AI news into a published avatar video — fully automated, zero paid middleware.
Pipeline: Tavily news search → GPT-4o-mini script → HeyGen avatar video → Make.com social posting
- Fetches the day's top AI news via Tavily
- Generates a 30-second script, social caption, and post title via GPT-4o-mini
- Submits the script to HeyGen to render an avatar video
- Polls HeyGen until the video is ready
- Posts the video to YouTube (and optionally Instagram/TikTok) via a Make.com webhook
Everything runs from one Streamlit page. Click Run Pipeline and the app handles the rest.
| Service | Purpose | Free tier |
|---|---|---|
| Tavily | News search API | Yes |
| OpenAI | Script generation (GPT-4o-mini) | Pay-as-you-go |
| HeyGen | Avatar video generation | Limited free credits |
| Make.com | Social posting webhook | 1,000 ops/month free |
git clone https://github.com/luquiluke/HeyGen-AI-Clone-Template
cd HeyGen-AI-Clone-Template
python -m venv venv
source venv/Scripts/activate # Windows/bash
# or: venv\Scripts\activate # Windows/PowerShell
pip install -r requirements.txtcp .env.example .envOpen .env and fill in your credentials:
# Required
TAVILY_API_KEY=your_key
OPENAI_API_KEY=your_key
HEYGEN_API_KEY=your_key
HEYGEN_AVATAR_ID=your_avatar_id
HEYGEN_VOICE_ID=your_voice_id # for Text engine
# or
HEYGEN_ELEVENLABS_VOICE_ID=your_id # for ElevenLabs engine
# Optional — override defaults
HEYGEN_VOICE_ENGINE=text # text | elevenlabs
HEYGEN_AVATAR_STYLE=Normal # Normal | Circle | Closeup
HEYGEN_VOICE_SPEED=1.0 # 0.5 – 1.5
HEYGEN_VOICE_PITCH=0 # -50 to 50
HEYGEN_ASPECT_RATIO= # leave blank for 9:16 portrait
HEYGEN_POLL_INTERVAL=30 # seconds between status checks
HEYGEN_MAX_POLLS=20 # give up after N polls
# Social posting (optional)
MAKE_WEBHOOK_URL=your_webhook_urlEvery sidebar control reads from .env as its default — you can also change values directly in the sidebar at runtime.
streamlit run app.pyOpen http://localhost:8501.
All HeyGen parameters are configurable without touching code:
| Control | Description |
|---|---|
| Avatar ID | HeyGen avatar to use |
| Avatar Style | Normal / Circle / Closeup presentation |
| Voice Engine | Text (HeyGen native) or ElevenLabs |
| Voice ID | UUID for the selected engine |
| Voice Speed | 0.5× to 1.5× |
| Voice Pitch | -50 to +50 semitones |
| Video Dimensions | 9:16 Portrait, 16:9 Landscape, 1:1 Square |
| Poll Interval | Seconds between HeyGen status checks |
| Max Polls | Timeout threshold |
Enable "Post to socials via Make.com" and paste your Make.com webhook URL. Check the platforms you want to post to (YouTube, Instagram, TikTok). The app sends one webhook call with the video URL, title, and caption — Make.com handles the actual posting asynchronously.
See MAKE_SETUP.md for step-by-step Make.com scenario setup.
The app sends this payload to your webhook:
{
"video_url": "https://...",
"title": "AI News: ...",
"caption": "That new model is a game-changer! #AINews",
"platforms": ["youtube", "instagram", "tiktok"]
}Your Make.com scenario should have:
- Custom Webhook trigger
- Router with one branch per platform (filter on
platformsarray) - YouTube: HTTP Get a file → YouTube Upload a Video
- Instagram: Instagram for Business → Create a Reel Post
- TikTok: HTTP module → TikTok Content Posting API
Note: TikTok posts are
SELF_ONLY(private) until your developer app passes TikTok's audit process.
app.py # Single-file Streamlit pipeline (~500 lines)
requirements.txt # Python dependencies
.env.example # Environment variable reference
.env # Your credentials (gitignored)
- Python 3.10+
- Streamlit — UI and pipeline orchestration
- OpenAI SDK — GPT-4o-mini script generation
- Requests — HeyGen and Make.com API calls
- python-dotenv —
.envloading
MIT
