跳到正文
Dang_nh | AI Agent Ops· 来源· @hikariraina · X·· 9 小时前精选AI 评分82
推荐理由

提供从单图到8方向动画的完整工作流,利用单次视频生成保持角色一致性并解决背景伪影。

正文 · 原文

How I turn one AI image into a fully animated 8-direction game sprite in about 2 minutes

I'm building sprite animations for a 2D isometric strategy game prototype. Every unit needs idle, run and attack animations in 8 directions, and all of them have to look like the same character. This is the pipeline that finally worked.

1. One image, all 8 directions
I ask Codex's image generator for a single 4×2 turnaround sheet: the same chibi character 8 times, one facing per cell, on flat magenta. If you generate each direction separately, you get 8 slightly different people. One sheet keeps the helmet, beard and shield identical. I also spell out which hand holds what; otherwise the spear switches hands when he faces left. I check it by eye and regenerate if anything is off.

2. Cut out 8 first frames
A small script finds the 8 figures, scales them all by the same factor, and puts their feet on the same baseline.
3. One video for all 8 directions
This is the main trick. Instead of 8 (or 16) separate image-to-video runs, I paste the 8 frames back into a 1280×512 grid and run MiniMax H3 image-to-video once. The prompt describes each cell by row and column, then gives a timeline: idle from 0 to 0.3 s, a 4-step run until 2.0 s, stop, a spear thrust from 2.45 to 3.45 s, then back to idle. The last frame is forced to match the first, so the clip loops. Because all 8 characters come from one generation, they move in sync and stay on-model. The clip is 107 frames, made with an 8-step turbo LoRA.

4. Fix what the model breaks
H3 likes to repaint the background mid-clip: magenta turns grey, green, even red. So for every frame and every cell, I sample the colour along the cell border. A pixel counts as background only if it is close to that colour and connected to the border. Armour of a similar colour inside the silhouette survives. Then I give the outline a soft 1 px alpha edge and put the figure back on clean magenta.
5. Slice out the motions

Run: find a stable stride cycle in the middle of the run section and take 8 evenly spaced frames.
Attack: the model often skips the stop, so I don't trust the timestamps. Instead I find the frame where the character plus the weapon trail is widest, go back 0.3 s for the wind-up, and end when the guard pose returns.

Every motion is aligned to frame 0, so all directions share the same scale and foot position.
6. Pack
The output is an 8-direction atlas, a 3-direction atlas in the format the engine uses, and an HTML preview page.

Hardware
Colab L4: about 285 s per grid video and about 0.3 compute units per character.
Local RTX PRO 6000 (Blackwell), moved to today: 60 s per video. The whole pipeline, including the ComfyUI cold start, takes 123 s, with VRAM peaking around 27 GB.
The same seed gives nearly identical motion on both machines.

Lessons
Consistency comes from generating together: one sheet, one video.

Don't trust timestamps. Detect motion from the pixels.
Automatic scoring couldn't catch direction drift, so the final pick is still made by eye.
Diagonal and back-facing runs sometimes rotate the body. Next step: ControlNet guided by skeleton renders from Blender.
All characters are original designs. The video model is MiniMax H3; check its licence before using it, because it has regional restrictions.

来源:Dang_nh | AI Agent Ops · x.com