Reference
Generating expressions
Expression images ship on transparent PNGs (we green-screen the
generation and key it out) so they blend into any host surface. They
drive the face is the product value proposition — a static
chatbot icon defeats the point of ASMI.
One route,
src/app/api/asmi/generate-expression/route.ts, handles three
modes:
- Base mode — text → first frame of an expression.
- Animation frame mode — take a reference frame + an
animationHint("eyes quarter-closed", "head tilted 5° left") → produce a second frame with that change applied, everything else pixel-perfect identical. - Blend (mid-frame) mode — given two frames (base + peak), generate the exact visual midpoint for a smooth interpolation.
Model: gemini-2.5-flash-image (nano-banana). Rate-limited to 10
generations per minute per user. Billing pipeline is tagged
generate_expression / generate_expression_frame.