Skip to content
Open-source tool

Lede

Most publisher AI imagery fails because the brief fails — a headline goes to a model with no editorial direction and the model returns the safest cliché it knows. Lede reads the article body, synthesizes a real art-director's brief (scene, mood, lighting, composition, anti-cliché list), then bakes that brief across three frontier cloud models in parallel. The IP is not the models. The IP is the editorial brief layer between the article and the image API.

Next.js 16Claude Sonnet 4.6Recraft v3GPT-5.4 Image 2Gemini 3 Promflux (Apple Silicon)
01 — The bakeoff

Same brief, four executions, picked side-by-side

Every showcase article on the live demo runs the same flow: extract the body, synthesize one brief, send it in parallel to Recraft v3, OpenAI gpt-5.4-image-2, and Google Gemini 3 Pro Image. The published article's actual lead image sits next to all three so the editor can see what would have gone above the fold from the same source material. Below is one of the showcase bakes — a piece about cookie-cutter casino affiliates pretending to be transparent reviewers.

Original hero · Recraft v3 · GPT-5.4 Image 2 · Gemini 3 Pro Image · brief synthesized via Claude Sonnet 4.6 on OpenRouter

02 — The brief layer is the product

What separates a real brief from a prompt

The synthesizer doesn't pass the headline through. It produces a structured editorial brief: concept core (the argumentative mechanism the image needs to express, e.g. "the gap between the bonus headline and the conditions buried under it"), non-negotiables (2-3 article-specific anchors that must appear in any rendering), text-dependency classification, scene, mood, lighting, composition, palette, and a per-model negative list tuned to known failure modes. A Zod schema enforces the shape; an injection-resistant wrapper protects against article bodies that try to override the instructions. The same brief can be cleanly re-targeted for the local mflux pair (Flux Krea, FLUX.2 Klein) without text-in-image — the editorial mechanism survives the tier change.

Zod-validated brief schema · prompt-injection wrap on user content · cloud + local brief variants · per-model negative addendums · cost cap enforced server-side

Stack & approach

Next.js 16 on the App Router with Turbopack, deployed on Vercel Pro with maxDuration 300 for the slow cloud bakes. Brief synthesis via Anthropic Claude Sonnet 4.6 through OpenRouter; images via Recraft API, OpenRouter image models, and mflux for the optional local Apple-Silicon pair. NDJSON streaming for the live bakeoff UX, Upstash Redis for rate limiting with an in-process dev fallback.

Security hardening earned its place: an SSRF guard with DNS-pinning (via an undici dispatcher) defeats rebinding TOCTOU on the article fetcher, edge-runtime basic-auth gates a private-demo mode, and a per-bake cost cap aborts runs above an environment-set ceiling. The full repo was put through a four-model adversarial review (DeepSeek V4-Pro + Gemini 3.1 Pro panel) and every confirmed finding above LOW was acted on before public release.

Built April – May 2026. MIT-licensed. Live at lede-xi.vercel.app, source at github.com/Bambushu/lede.