Codex Video Production: From AI Image Generation to HyperFrames Automatic Editing
Codex Video Production: From AI Image Generation to HyperFrames Automatic Editing
Previously, we experienced using Codex to generate images and then create videos with Remotion: Codex Remotion Video Generation
This time, we'll try a different approach:Let Codex create a 2D anime short film for us.
The protagonist is a blue-haired whale girl. She was living a carefree life in the deep sea, but one day was captured by AI to become a programmer. As soon as she learned to code, bugs started appearing...
What we need to do is have Codex automatically complete the character design, anime storyboard, image generation, animation production, and video editing, finally exporting a 20-second MP4 short film.
This time, instead of using traditional editing software or writing complex video code ourselves, we useCodex + ImageGen + HyperFramesto complete the entire production process.
I. What is HyperFrames
HyperFramesis an open-source HTML video production framework developed by the HeyGen team.
The core idea of HyperFrames is simple:Treat video as a webpage to create it.
Normally, web pages can use HTML layout, CSS styling, and JavaScript animations, while HyperFrames can render these web page scenes into a video according to a timeline.
For example, controlling a whale girl swimming in from the left side of the screen, blinking, popping up a dialogue box, or suddenly being surrounded by a pile of bugs can all be done through code.
HyperFrames supports using GSAP to create animations and also provides preview and MP4 rendering functions. Codex can automatically generate this code based on our natural language requirements.
| Tools | Work responsible for this time |
|---|---|
| Codex | Understanding the plot, planning storyboards, writing animations, and executing commands |
| ImageGen | Generate whale girl character illustrations, expressions, backgrounds, and scene images |
| HyperFrames | Arrange shots, animations, subtitles, transitions, and video rendering |
| FFmpeg | Responsible for local video encoding and other processing |
What is the difference with Remotion
Both Remotion and HyperFrames can render code-controlled scenes into videos, but their technical approaches are different.
| Comparison items | Remotion | HyperFrames |
|---|---|---|
| Main Technologies | React / JavaScript | HTML / CSS / JavaScript |
| Video Structure | React Composition | HTML Composition, Time Attributes, and Media Tracks |
| Animation methods | React animation logic | CSS, GSAP, etc. |
| AI Agent | Can be assisted by Skills | Specifically provides Skills and workflows for Agents |
| Applicable content | Code animations, product videos, charts | Dynamic cards, short videos, web animations, automated videos |
For developers familiar with HTML, CSS, and JavaScript, HyperFrames is relatively easy to understand. When creating simple short clips, you don't need to build a complete React video component first.
However, note that: HyperFrames is not a video model that directly generates continuous anime actions. It is mainly responsible for combining already generated images, subtitles, and animations according to a timeline.
To make a character blink, shake their head, or wave, this can be achieved through multiple expression assets, layered illustrations, and animations. Complex actions like running, fighting, or continuous transformations are better suited to be generated as clips by an AI video model first, and then edited by HyperFrames.
II. Practical Case Study: The Whale Girl Forced to Become a Programmer
This time, we are preparing to create a 2D comedy short film titled **"The Whale Girl's First Experience as a Programmer"**.
The plot is not complicated: A cheerful whale girl is sleeping at the bottom of the sea and is suddenly woken up by AI to write code. She originally thought she had mastered a magical skill, but unexpectedly encountered a bug on the first day.
We hope the video has a Japanese anime style, featuring character expression changes, dynamic subtitles, exaggerated transitions, and a touch of comedic pacing.
| Project | Requirements |
|---|---|
| Video theme | Whale Girl's First Experience as a Programmer |
| Video duration | 20 seconds |
| Video aspect ratio | 16:9 landscape |
| Output resolution | 1920×1080 |
| Frame rate | 30fps, total 600 frames |
| Visual style | Japanese anime style, fresh and cute, exaggerated and funny |
| Production process | AI image generation → animation arrangement → automatic editing → MP4 |
Design six anime shots
First, break the plot into six short shots, with each shot responsible for conveying one piece of content.
| Time | Shot visuals | Animation and subtitles |
|---|---|---|
| 0-3 seconds | The whale girl is sleeping at the bottom of the sea, with bubbles floating around | Slow push-in, bubbles rise, and Zzz appears |
| 3-6 seconds | A glowing computer icon suddenly appears, and the whale girl wakes up | Flash, vibration, surprised expression |
| 6-10 seconds | The whale girl sits in front of the computer and starts typing frantically | Keyboard animation, code flying out, subtitle "This isn't difficult either!" |
| 10-14 seconds | A red ERROR appears on the screen, and bugs pour in from all directions | Screen shaking, red alarm, expression collapse |
| 14 to 17 seconds | The whale girl suddenly has an idea and summons AI to fix the code | Blue energy effects, bugs are cleared one by one |
| 17 to 20 seconds | The whale girl slumps in her chair, showing a helpless expression | The camera zooms in, subtitle "Have to work tomorrow?" |
This video does not require complex continuous character actions; a complete short story can be presented by using different character illustrations, expression changes, screen shifts, and transitions.
III. Installing HyperFrames
First, open Codex, create a new project folder, for examplewhale-girl-video.

Open the Codex desktop version, go to the Plugins page, search for HyperFrames, select HyperFrames by HeyGen, and click Install.

Return to the project and call HyperFrames in the conversation to create a video.
Alternatively, you can directly enter in the conversation:
Original prompt (Chinese, left untranslated)
安装 HyperFrames 插件
HyperFrames local CLI requires Node.js version 22 or higher, and FFmpeg is also required for video encoding.
Other installation methods
HyperFrames officially provides Skills for programming Agents such as Codex, Claude Code, and Cursor, which can help Agents understand project structure, animation specifications, and rendering workflows.
You can also install them by running the following command in the terminal:
npx skills add heygen-com/hyperframes
Select the required core Skills in the interactive interface.
You can also use the HyperFrames CLI to install or update core skills:
Update HyperFrames core Skills:
npx hyperframes skills update
Official documentation:HyperFrames Quickstart
Check local running environment
If you are not familiar with Node.js and FFmpeg, you do not need to troubleshoot it yourself; you can let Codex check.
Example: Check HyperFrames environment
Please check if your current computer meets the requirements for HyperFrames to run.
Check the following:
Whether Node.js is version 22 or higher.
Whether npm is available.
Whether FFmpeg is installed.
Whether HyperFrames Skills can be used.
If dependencies are missing, please help install them.
After completion, initialize a HyperFrames project,
with the project name whale-girl-video.
Do not delete or overwrite existing files.
If you choose manual initialization, you can also run:
npx hyperframes init whale-girl-video
cd whale-girl-video
HyperFrames will create a video project, including HTML Composition, configuration files, and asset directories.
Four, Step One: Let Codex design the whale girl character
The easiest problem encountered when making anime videos is inconsistent characters.
The first picture is a blue-haired girl, the second picture has short hair, and the third picture has no tail at all. When the videos are cut together, it feels like three different actors were temporarily used.
So, we first generate a character concept image and then use it as the visual reference for all scenes.
1. Generate the whale girl's character concept image
Open the Codex environment that supports image generation and use$imagegenskills to create the character.
Example: Generate the whale girl's character concept image
Please use $imagegen to design an original anime character.
Character Name: Whale Girl
Character setting:
Adult anime girl
Long hair, deep sea blue gradually transitioning to bright cyan
Clear blue eyes
Small whale fin decorations on both sides of the head
A cute blue whale tail behind her
Wearing a blue and white sailor-style outfit
Lively, cute, and slightly dorky personality
Expressive, suitable for comedic anime shorts
Drawing style:
High-quality Japanese anime illustration
Clean and delicate lines
Soft cel shading
Primarily blue, cyan, and white
Natural character proportions
Full character shot
Image requirements:
1:1 square
Light gray pure background
Fully display the character and whale tail
No text, logos, or watermarks
First generate a standard character portrait,
Save it as assets/characters/whale-master.png.
Do not generate other images until I confirm.

Check if the generated character meets the requirements, especially in areas prone to change such as hair color, clothing, whale fins, and tail.

2. Generate expression and action materials
After the character is determined, generate different expressions and poses.
For example, expressions such as happy, shocked, smug, collapsed, and helpless are enough to support most of the plot of this short film.
Example: Generate whale girl expression materials
Please use $imagegen to generate a set of animated character materials for the confirmed whale girl.
Generate a set of animated character materials.
Starting from assets/characters/whale-master.png
As the sole character visual reference.
Generate the following six character images:
whale-sleep.png
Eyes closed, sleeping peacefully.
whale-shocked.png
Suddenly waking up, eyes wide open, shocked expression.
whale-coding.png
Happily sitting in front of the computer typing on the keyboard.
whale-panic.png
Seeing the program error, face full of despair, shedding comic tears.
whale-magic.png
Raising a finger, summoning glowing blue magic.
whale-tired.png
Slumped in the chair, eyes vacant, expression helpless.
All materials must:
Maintain the same character appearance
Maintain consistency in hairstyle, hair color, and clothing
Retain the whale fin and tail
Use a unified Japanese anime style
Fully display necessary body parts
Do not generate text or watermarks
Prioritize outputting a transparent background PNG.
If a transparent background is unavailable,
Please state the situation and use image processing to remove the background.
Save to the assets/characters directory.
Provide a character preview image after generation.
Here, Codex can also separate the character's head, body, hair, and tail into different layers to facilitate simple animations like head shaking, tail wagging, and blinking later.
It should be noted that a single illustration cannot automatically become a complete skeletal animation. Whether natural local movement is possible depends on the material layering and animation design quality.

V. Step Two: Generating Anime Scenes and Backgrounds
After the character materials are ready, create the anime background.
This time, three main scenes are needed: a quiet underwater scene, a programmer's desk, and an exaggerated computer world full of bugs.
It is best not to add text to the background images in advance; all subsequent subtitles, program errors, and prompt boxes should be handled by HyperFrames for easier adjustment.
Example: Batch generation of anime backgrounds
Please use $imagegen to generate the background materials for this anime video.
Unified style:
High-quality Japanese anime style,
Fresh and bright, soft lighting and shadows,
Primarily blue and cyan,
With small accents of warm orange.
Generate the following backgrounds:
ocean-bedroom.png
A fantasy-style underwater bedroom,
with a shell bed, soft blue seawater,
floating bubbles, and sunlight filtering through the sea surface.
The scene is clean, leaving space for character activity.
coding-room.png
A cozy anime-style programmer's studio,
with a computer monitor and mechanical keyboard on the desk,
The ocean can be seen outside the window.
The colors are mainly blue and warm orange.
error-world.png
Exaggerated anime computer space,
red warning lights, floating error symbols,
glitch effects and chaotic code elements.
The background is dramatic but not overly cluttered.
magic-world.png
A fantasy space filled with blue particles, halos, and data streams.
A lens suitable for whale girls summoning AI magic.
Unified requirements:
16:9
Compatible with 1920×1080 video
Unified scene style
No characters
No text, logos, or watermarks
Reserve space for the main subject and subtitles
Save to the assets/backgrounds directory.
After generation is complete, it is recommended to have Codex organize a material preview page to display all images and check for style shifts.

VI. Step 3: Automatically create anime videos using HyperFrames
Now that we have the whale girl character, expression materials, and anime backgrounds, we can start the actual video production.
HyperFrames uses HTML to define video content, controls shots using time attributes, and utilizes tools like GSAP to achieve animation.
We do not need to write this code ourselves; we only need to hand over the confirmed storyboards to Codex.
Example: Creating a whale girl anime short film
Now use HyperFrames to create animated shorts.
Please read the whale girl character assets,
background assets, and the confirmed storyboard in the project.
Please use HyperFrames Skills for production.
Video name:
"The Whale Girl's First Experience as a Programmer"
Video parameters:
1920×1080
16:9
30fps
20 seconds
600 frames
Six shots:
Shot one: 0-3 seconds
The whale girl is sleeping at the bottom of the sea.
Bubbles slowly rise in the background,
The character lightly floats up and down,
The screen shows Zzz.
Shot two: 3 to 6 seconds
A glowing computer icon suddenly appears.
The whale girl opens her eyes wide,
The screen rapidly zooms and vibrates slightly.
Shot three: 6 to 10 seconds
Switch to the programmer's studio.
The whale girl happily types on the keyboard.
Animated subtitles appear:
"This isn't difficult either!"
Shot four: 10-14 seconds
The computer shows an ERROR.
A red alarm and Bug icon pop up.
The whale girl shows a look of collapse,
The screen has a slight shaking effect.
Shot five: 14-17 seconds
The whale girl summons blue AI magic.
Blue particles and halos spread,
The bug icon gradually disappears.
Shot six: 17-20 seconds
The whale girl sits tiredly in front of the computer.
The shot slowly zooms in.
End credits appear:
"Do you have to work tomorrow?"
Technical requirements:
Use HyperFrames HTML Composition.
Use GSAP to create time-positioned animations.
Set up time and video tracks according to official specifications.
Prioritize using already generated local assets.
Apply animations such as translation, scaling, and slight rotation to characters.
Switch character states using different expression assets when necessary.
Subtitles are rendered using HTML elements to ensure text accuracy.
Transitions should match the rhythm of anime comedy shorts.
Avoid screen flickering, character deformation, or blank frames.
Please complete the engineering and preview first,
and do not render the final video immediately.
Let me know how to view the preview after completion.

Open HyperFrames preview
We can preview directly on the right side of Codex, or run the following command to preview in the project directory:
npx hyperframes preview
The command will start the local preview service and open HyperFrames Studio in the browser.
We can check the visuals, subtitles, and animation timing of each shot, or directly request modifications from Codex.
For example, if you feel the shot where the whale girl is surrounded by bugs is not funny enough, you can request:
Example: Add a funny animation
The fourth shot is not funny enough.
Please add the following effects:
ERROR suddenly zooms in and pops up.
The whale girl's expression instantly changes from smug to shocked.
Red bug icons fly into the screen from all directions.
The screen shakes slightly twice.
A comic-style exclamation mark appears above the whale girl's head.
The overall style should maintain a Japanese anime aesthetic.
Do not affect other shots.
Please provide a preview after completion.
This is the advantage of HyperFrames. You can adjust the shot effects by modifying the relevant HTML, CSS, and animation timeline, without needing to regenerate all the images.
VII. Step Four: Add subtitles, sound effects, and transitions
The visuals alone are not enough; anime shorts also need a sense of rhythm.
For example, a "ding" notification sound when the whale girl is woken up, an exaggerated alarm sound when an error appears, and finally a contrast created by a suddenly stopping piece of music.
These types of effects can be arranged by Codex and orchestrated using HyperFrames' media tracks.
How to design the subtitles
This time, we don't need too many subtitles; the focus is to make the punchlines clearer.
| Timing | Subtitles | Presentation method |
|---|---|---|
| 0-3 seconds | Zzz... | Slowly floating |
| 3-6 seconds | Time to work! | Suddenly pops up |
| 6-10 seconds | This isn't difficult either! | Elastic scaling |
| 10-14 seconds | ERROR! | Red alert flashing |
| 14-17 seconds | AI, save me! | Blue glowing text |
| 17-20 seconds | Do you have to work tomorrow? | Slowly appear, freeze at the end |
All subtitles are made in HTML, not directly placed in the generated image, which makes it easier to modify the text, color, and animation.
Add sound effects
Example: Add anime sound effects
Please design sound effects for the current HyperFrames anime video.
Requirements:
Use gentle ambient sounds when sleeping underwater.
Add a short prompt sound when the whale girl wakes up.
Add a slight keyboard sound effect to the typing scene.
Add a funny alarm sound when ERROR appears.
Add a blue magic sound effect when AI fixes bugs.
Use a sudden quiet contrast effect at the end.
Please prioritize using existing sound effects in the project.
If there are no sound effect materials,
you can use commercially available materials with clear licenses.
Or use program-generated simple sound effects.
Do not call paid music interfaces arbitrarily.
Ensure the sound effects are time-aligned with the video frames.
Avoid excessive volume, clipping, or distortion.
Output a new preview after completion.
If character voice acting is required, you can also use the TTS service to generate voice separately, and then let HyperFrames synthesize it according to the timeline. This example uses subtitles and sound effects first and does not require character voice acting.
VIII. Step Five: Render and Export MP4
After confirming the preview, you can officially export the video as an MP4 file.
Execute in the project directory:
Render HyperFrames video
npx hyperframes render
--output
out
/
whale-girl-v01.mp4
Before executing, ensureoutThe directory already exists, allowing Codex to create it automatically.
You can also let Codex complete the entire export process:
Example: Exporting the final cut
The preview has been confirmed, please use HyperFrames
to render the final video.
Rendering requirements:
1920×1080
30fps
20 seconds
MP4
H.264 encoding
Output directory: out
Output file: whale-girl-v01.mp4
Please check before exporting:
Whether all six shots are present.
Whether the anime character remains consistent.
Are the subtitles accurate?
Are the animation and sound effects synchronized?
Are there any black screens or blank frames?
Is the final video 600 frames?
Check if the file can be played after rendering is complete.
Also generate a video cover,
and save it as out/whale-girl-cover.png.
If any issues are found, please fix them before exporting.
Do not overwrite existing versions.
After exporting, you can watch it with a local player or upload it to a website as a video demonstration on a webpage.
It should be noted that local rendering in HyperFrames does not incur per-second AI video generation fees, but the preceding AI image generation may consume model quotas. Additional fees may also be incurred if cloud rendering, paid TTS, or music generation services are used.
IX. Complete Example: Creating an Anime Video of a Whale Girl with a Prompt
The previous operations are broken down into several stages: character design, background generation, animation production, and export.
If HyperFrames Skills are already installed, you can directly assign the entire task to Codex to have it complete the steps.
Example: Complete Prompt for Whale Girl Anime Video
You are now my 2D animation director,
Character Designer and HyperFrames Video Engineer.
I want to create an original anime comedy short film:
"The Programmer's First Experience with the Whale Girl"
Please use Codex, ImageGen, and HyperFrames
to complete the work from character design and material generation to video export.
I. Story Background
A blue-haired whale girl living in the deep sea,
who originally slept happily every day.
One day, AI suddenly woke her up,
telling her to become a programmer.
At first, she thought writing code was simple,
but when she encountered a screen full of bugs, she crashed.
Finally, she summoned AI to clear the bugs,
only to find she had to continue working the next day.
Overall style:
Cute, lively, and funny,
Possesses the expressive power of Japanese anime.
II. Protagonist Design
Original adult whale girl:
Blue long hair, fading to cyan at the tips
Blue eyes
Small whale fins
Cute blue whale tail
Blue and white sailor outfit
Expressive, slightly dorky
All visuals must maintain character appearance consistency.
III. Video Specifications
Duration: 20 seconds
Aspect Ratio: 16:9
Resolution: 1920×1080
Frame Rate: 30fps
Total Frames: 600
Format: MP4
IV. Production Process
Stage One: Storyboard Planning
First design six shots:
Sleeping underwater
Woken up by AI
Happily typing on the keyboard
Encountering a bug and crashing
Summon AI Repair
Reluctantly continue working
List for each shot:
Time
Background
Character action
Expression
Subtitle
Animation
Sound effects
Wait for my confirmation.
Phase two: Character and background generation
Use $imagegen:
Generate standard character portraits.
Wait for my confirmation on the character's appearance.
Generate different expressions and poses.
Generate anime backgrounds.
Save materials according to unified specifications.
Character images should prioritize transparent background PNG.
Separate backgrounds and subtitles.
Phase Three: HyperFrames Production
Use official HyperFrames Skills.
Create video projects based on confirmed storyboards.
Use HTML, CSS, JavaScript
Create videos with GSAP.
Complete the following:
Shot composition
Character movement
Camera zoom
Expression switching
Dynamic subtitles
Animation transitions
Audio Timeline
Follow HyperFrames Composition,
Clip, and GSAP animation specifications.
Animations must be positioned according to the specified time,
to avoid discrepancies between preview and rendering results.
Phase Four: Preview Optimization
Start the HyperFrames preview first.
Do not export the final video directly.
Adjust based on my feedback:
Camera rhythm
Subtitle position
Character actions
Animation effects
Sound effects
Prioritize local modifications; do not randomly regenerate materials.
Phase five: Final export
Export after confirmation:
out/whale-girl-v01.mp4
Generate simultaneously:
out/whale-girl-cover.png
Please check the video duration, resolution,
subtitles, shots, and character consistency.
V. Working Rules
Do not modify the confirmed character design arbitrarily.
Do not use unverified paid APIs.
Do not overwrite old materials and videos.
Maintain character consistency when generating images.
Save all project files to the current project.
Clearly state any unusable tools.
Show the results after each stage is completed.
I am responsible for confirmation, and you execute the technical steps.
First, check the environment now.
Then provide the complete storyboard plan.
X. How to check the final effect
Although AI-generated images and video code writing are convenient, it does not mean that the ideal effect can be achieved on the first try.
Especially for anime characters, issues such as changes in character appearance, unnatural hand movements, and subtitle obstruction are more likely to occur.
| Check the project | Pass the standard |
|---|---|
| Character consistency | Hair color, clothing, whale tail, and facial features remain consistent |
| Complete plot | The six shots connect reasonably, and the story is understandable |
| Accurate subtitles | No typos, and the time and location are correct |
| Smooth animation | Natural character movement, and transitions are not abrupt |
| Sound effects | Sound effects are aligned with key actions, and there is no clipping |
| Output format | 1920×1080, 30fps, 20 second MP4 |
If you are not satisfied with a certain shot, you can ask Codex to only modify that part.
Example: Second round of anime optimization
Please optimize the current whale girl video.
The following issues exist:
The collapse expression in the fourth shot is not exaggerated enough.
The ERROR subtitle appears too early.
The blue glow effect of the AI magic is not obvious.
The ending hold time is a bit short.
Please only adjust the corresponding shot.
Keep the character settings and other confirmed content unchanged.
Provide a new preview after modification.
Do not overwrite the previous finished work.
Eleven, Hands-on Practice
Practice 1: Create a whale girl emoji
Have Codex generate a set of square anime emoticons based on the confirmed character, including six expressions: happy, shocked, speechless, collapsed, sleeping, and smug.
Require a unified character appearance, preferably with a transparent background, and export the final file as PNG.
Exercise Two: Create a 10-second animated emoticon video
Create a 10-second animated short film featuring the whale girl's six expressions, with each expression accompanied by different elastic, scaling, and shaking effects.
Export the 1080x1080 square MP4 file using HyperFrames.
Exercise Three: Create a vertical anime short film
Convert "Whale Girl's First Experience as a Programmer" to a 9:16 vertical version, with an output resolution of 1080x1920.
Require readjusting the character positions, subtitle layout, and shot composition; direct stretching of the original landscape footage is not allowed.
Exercise Four: Creating a Loop Animation
Select the shot of the whale girl sleeping underwater and create a loop animation for the rising bubbles, floating character, and swaying hair.
The beginning and end frames must transition naturally, making it suitable for use as a dynamic background on a webpage.