cheerio loads the HTML file and extracts content by CSS selectors.
handles title, subtitle, prose sections (h2/h3/p/ul), FAQs, references, and metadata.
input
blogs/*.html (file path)
output
BlogContent JSON
{ title, subtitle, sections[], faqs[], references[] }
deps
cheerio (local only, no API)
claude API generates a 4-6 slide carousel plan. each slide gets a purpose (hook/key-point/stat/faq/cta),
headline (max 8 words), body text (max 25 words), and a visual concept description.
input
BlogContent JSON + slideCount + style guide
output
SlidePlan JSON
{ carousel_title, slides[{ headline, body, visual_concept }] }
API
Claude Sonnet 4.5
~2K output tokens
claude API converts each slide's visual concept into a detailed, replicate-ready image prompt.
prompts describe scenes only (no text baked in). text overlay data preserved separately for compositing.
input
SlidePlan JSON + style guide
output
ImagePrompt[]
{ prompt, negative_prompt, text_overlay }
API
Claude Sonnet 4.5
~3K output tokens
replicate API generates one image per slide. supports ideogram v3 (better photorealism)
or flux 1.1 pro. images downloaded as PNGs to output directory. failures are logged and skipped.
input
ImagePrompt[] + output dir + model choice
output
slide-1.png ... slide-N.png
metadata.json (full pipeline data)
API
Replicate
Ideogram v3 or Flux 1.1 Pro
cost
~$0.08-0.12 per image
~$0.40-0.60 per carousel
usage
node scripts/social/pipeline.mjs --blog blogs/traveling-with-peptides.html
node scripts/social/pipeline.mjs --blog blogs/traveling-with-peptides.html --skip-images
node scripts/social/pipeline.mjs --blog blogs/traveling-with-peptides.html --model flux