Portrait motion

One finished sprite in. Eyes and mouth a game can drive separately out.

portrait-motion · Page · Contract

The face is found and cropped, a reviewer decides which eyes and mouth can safely change, and an image model draws every new state in one sheet. Each drawing is aligned to the original, every combination is reviewed, and the accepted patches go back on the sprite at full size.

Steps

StepNode types
Check the inputs
The spec is read and the portrait held to it before anything is paid for: a face crop needs a square canvas; a portrait animated whole must be opaque and exactly the canvas.
Check the inputs portrait_motion/check
Find the face
A vision model returns only a box around the face; it never judges whether the face can move. The workspace is cut from the full sprite with padding on every side and resized once to the spec's canvas.
Locate the face portrait_motion/face/locate
Check the box portrait_motion/face/located
Crop the face portrait_motion/face/crop
Decide and draw
A reviewer decides which eyes and mouth can safely change. The image model then draws every new state in one sheet, each cell an edit of the same portrait, so they share one hand.
Decide what can move portrait_motion/draw/admission
Check the decision portrait_motion/draw/admitted
Lay out the sheet portrait_motion/draw/guide
Write the questions portrait_motion/draw/briefs
Draw the new states portrait_motion/draw/atlas
Fit
Each new drawing is aligned to the original, and one that moved or changed scale is refused. A vision model outlines the eyes and mouth that may change.
Line them up portrait_motion/fit/registration
Outline eyes and mouth portrait_motion/fit/geometry
Check the outlines portrait_motion/fit/geometry_ok
Compose and review
Every eyes-and-mouth combination is built from those outlines, then judged by a reviewer that did not draw them.
Build every combination portrait_motion/compose/composition
Review the result portrait_motion/compose/quality
Check the review portrait_motion/compose/quality_ok
Deliver
Only accepted features are kept, and the result says which, or where the run refused and why. With a face crop, the patches go back on the original sprite at full size, and every pixel outside them is checked unchanged.
Record the result portrait_motion/deliver/result
Keep what passed portrait_motion/deliver/keep
Put it back at full size portrait_motion/deliver/render

Outputs

outputs/animation.webpThe timeline at the sprite's full size, transparency kept
outputs/states/Every eyes-and-mouth combination, as full-size PNGs
outputs/patches/Each eye and the mouth in every state, as patches placed at one offset
outputs/manifest.jsonWhere the patches go, which feature each belongs to, and a sample timeline
outputs/result.jsonWhich features were accepted, or where the run refused and why

Try it

An original geometric character, as a full sprite and as an opaque portrait, with the inputs that use them, written by uv run python src/fx_games/workflows/portrait_motion/inputs/make_inputs.py out/portrait-motion-input. The run is paid: it needs OpenRouter and OpenAI keys, and --live

uv run python -m grida.fx plan portrait-motion --inputs out/portrait-motion-input/face.yaml

uv run python -m grida.fx run portrait-motion --inputs out/portrait-motion-input/face.yaml --live --max-usd 5

uv run python -m grida.fx inspect portrait-motion

Examples

Yuzu faceyuzu-facemade with an earlier version