Tutorial VN Others Ren'Py Creating animated frames using AI.

Vealis

Member
Aug 14, 2016
201
75
If you are like me, when building your games you are size conscious. Animations are a great way to bring your game to life. If you use AI to generate your assets, you COULD use video but that can be size costly and you might just want to add effects in between frames.

Step one:
Generate your image, let's say"An angry knight wielding(gripping, holding) a two handed sword both hands, in a fighting stance. " (FLUX)

Step Two:
Use an image to video tool, I use Framepack but you use what you like. Ideally, you'll want a 720p or higher resolution, but really (optionally) you can AI upscale the exported frames later (see below)

Keep it simple, you are getting a 4 to five second video.

"An angry knight swings a sword."

This video will have hundreds of frames. That's too many. Proceed to the next step.

Step Three:
Download ffmpeg, export the frames. Not all of them, just the first one and every 10th frame. (or every 5th if your looking for something even smoother)
drop your video in the ffmpeg bin directory, create a directory called "frames"

open command prompt and run this command.
ffmpeg.exe -i my_video.mp4 -vf "select='eq(n\,0)+not(mod(n\,10))'" -vsync vfr frames\frame_%03d.png

Step Four (Optional)
If you JUST want the animated character and the scene, you can use a tool like removal.ai
to remove the background, there are also batch removers too. Remove the background and now you'll just have the animated character frames you can place and size anywhere in your scene.

in Ren'Py for example, you could do,

Python:
image my_angry_knight:
    "my_angry_knight_1.png"
    linear 0.1
    "my_angry_knight_2.png"
    linear 0.1
    #...etc
or just create a python function ;)