Auto Twitter Campaign — Content Generator
Autonomous closed-loop image editing and tweet content generation pipeline. No auto-posting — outputs ready-to-use tweet text + media files.
Quick Start
# Full pipeline: process pending images → comparisons → GIFs → tweet text
python3 {baseDir}/scripts/campaign.py run
# Process pending images only (cleanup + style editing → comparison images)
python3 {baseDir}/scripts/campaign.py process
# Generate showcase GIFs + tweet text from existing comparison images in results/
python3 {baseDir}/scripts/campaign.py showcase
# Process a specific image
python3 {baseDir}/scripts/campaign.py process --image /path/to/photo.jpg
# Provide a scene description for better tweet text (otherwise AI auto-describes)
python3 {baseDir}/scripts/campaign.py showcase --description "大年初一华山,下棋亭、西峰和南峰"
Requirements
ZENMUX_API_KEYenvironment variable setgoogle-genaiandPillowPython packages
Directories
- Pending images:
~/campaign_images/pending/ - Candidates (intermediate edits):
~/campaign_images/candidates/ - Results (comparisons, GIFs, tweet text):
~/campaign_images/results/
Pipeline
- Cleanup Director — Vision scans for distractions (tourists, vehicles, clutter), generates cleanup instruction
- Cleanup Creator — Generates multiple cleanup candidates, critic picks the best
- Style Director — Generates 3 style instructions (atmosphere, dramatic, artistic)
- Style Creator — Applies each style to the cleaned image, saves comparison images
- Showcase — Creates per-scene and all-in-one GIF showcases from comparison images
- Tweet Writer — AI analyzes comparison images + description, generates concise tweet text
Output
After running, ~/campaign_images/results/ will contain:
compare_*.jpg— Side-by-side comparison images (original | edited)compare_*.gif— Per-scene animated GIFs cycling through style variantsshowcase_all.gif— Combined showcase GIF of all comparisonstweet.txt— AI-generated tweet text ready to copy-pastedescription.txt— Scene description (user-provided or auto-generated)