Overview
Motion to Code is a fal model launched on October 29, 2026 that turns animation into code. Give it a description, an image, a reference video or a piece of audio, and it returns a self-contained HTML page driven by GSAP 3.12.5.
The immediate benefit is weight: a few kilobytes of code instead of megabytes of video, sharp at any resolution. The page also exposes a window.anim control surface that can seek to a time, play, pause and report duration, so the result can ship as an interactive effect rather than a media file.
Pricing runs by the second. From a prompt or an image it is 0.30 dollars per second with a five-second minimum, so a six-second loop costs 1.80 dollars. Rebuilding from your own video is 0.20 dollars per second. A GLSL variant produces looping shaders instead.
Key Features
- Code out, not video: The response is self-contained HTML with an SVG canvas and a GSAP timeline. A clock object drives a pure draw function per frame, so the result scales to any size without blur.
- Generate, then refine: The pipeline runs source, study, generate, render, refine and encode. Refinement is the slowest step; in one sample, generation took 48 seconds and refinement 88.
- Shot list in the source: The generated HTML opens with a SHOT LIST comment describing every move second by second along with its easing function. Designers can read it and engineers can edit it.
- Four input types: Prompt, video, image and audio all work, with a separate duration parameter. Video accepts mp4, mov, webm, m4v and gif; images accept jpg, png, webp, avif, heic and heif.
- Three artefacts per run: Besides code and html, the response carries a 1280 by 720, 24 fps, six-second mp4 and a contact sheet. The video covers channels that cannot render code, the sheet makes frame selection quick.
- Loops designed to close: The default is an infinite loop, and the shot list is arranged so first and last frames align, landing back at frame zero at 5.96 seconds in the sample. Adding ?external=1 plays it once.
Use Cases
- Product landing page motion, replacing megabytes of video with kilobytes of code.
- Rebuilding a client's reference video as adjustable front-end animation.
- Social loops that stay sharp at every size because the output is code.
- Title cards and type effects, with colour and pacing changed in the source.
- WebGL backgrounds and visual effects through the GLSL variant.
- Design hand-off, passing the shot list comment straight to engineering.
Pros
- Kilobyte-scale output that stays sharp at any resolution.
- Returns a window.anim interface for interactive embedding.
- Ships a second-by-second shot list inside the code.
- Accepts prompts, images, video and audio as input.
- Rebuilding from your own video is a third cheaper, 0.20 against 0.30 dollars per second.
- Delivers both an mp4 and a contact sheet for different channels.
Pricing
Billed by animation length with a five-second minimum. Generating from a prompt or image costs 0.30 dollars per second, with images animated first through MiniMax H3 Max, so a six-second loop is 1.80 dollars. Rebuilding from your own video costs 0.20 dollars per second, or 2.00 dollars for a ten-second clip. Calls go through fal's queue API, and the playground requires a sign-in.
Summary
Compiling motion into code solves a distribution problem. Landing page videos run to megabytes and must be re-exported per resolution; code is a few kilobytes and fits every size. This suits motion that already lives in a browser, and the bundled mp4 covers everything else. The five-second billing floor makes very short effects relatively expensive, so longer loops get better value.
Version History
- fal Motion to Code launched: animation as editable code (2026-10-29): fal launched Motion to Code with gsap and glsl endpoints under fal-ai/motion-to-code. Prompts, images, video or audio produce self-contained HTML with GSAP 3.12.5 animation code, including a window.anim control interface and a second-by-second shot list comment, plus a 1280 by 720, 24 fps, six-second mp4 and a contact sheet. Billing runs per second at 0.30 dollars for generation and 0.20 dollars for rebuilding from your own video, with a five-second minimum.