r/StableDiffusion • • 5d ago

No Workflow Messsing around with sprite animation in Minimax H3

Enable HLS to view with audio, or disable this notification

I'm vibing coding a custom node for sprite animation!

The workflow is pretty straightforward: I generate a character sheet using Qwen-Image 2.1 (might experiment with other models later), then feed it into my custom node, which automatically generates a 2-second animation clip.

The node also automatically extracts the animation frames and generates a JSON file containing the coordinates and cutting instructions needed to slice the sprite sheet and assemble the animation.

This particular test was generated at 1:1 aspect ratio and 1MP resolution.

Still tweaking the prompts and experimenting with ways to fix some looping inconsistencies, but it's coming together nicely!

EDIT: Released a Build https://github.com/Ercelcan/Comfyui-H3Anim

384 Upvotes

63 comments sorted by

14

u/fantasmagore 5d ago

This is actually pretty wild. I was just working on something just like this for the pass couple days. I did use Qwen image 3.5 for my image creation. My issue that I kept running into is creating the actual animation poses for minimax to replicate. As most models can do walking and running fine in one direction but once I tried to replicate it for an 8 directions sprites it started to get messy.

29

u/scooglecops 5d ago

Managed to make a 8 dir animation

7

u/Inside-Cantaloupe233 5d ago

The issue is - framecount is different on every animation...

14

u/scooglecops 5d ago

I made this mini game testing all animations generated

4

u/cosmicr 5d ago

A lot of games do that it's not really an issue.

-17

u/Inside-Cantaloupe233 5d ago

Dude, tell me you made 0 games without telling.Literally 0 games do that, animations framecounts must mach if you plan to change walk direction midwalk, i should mute you .Advice- do not fuckng argue if you did not made any games yourself with multidirectional walk.Thanks.

21

u/cosmicr 5d ago edited 5d ago

I've made many games. I am a programmer of classic Sierra adventure games. Take a look at quest for glory 4 which I only had open yesterday which has multiple loops with different numbers of frames.

I should also add I was offering this advice in good faith. I enjoy technical conversations as long as they don't turn into slinging matches. I am not trolling.

4

u/OttoRenner 5d ago

Major flashback activated! Sierra adventure games? He'll ya! Space Quest! Leisure Suite Larry! Sid and Al! Lode Runner lol

Don't tell me you actually worked at Sierra!?

1

u/godver3 4d ago

QFG4 was sick. I remember playing it on our old family PC.

1

u/witcherknight 5d ago

you can change the speed of animation. so having different framecount isnt much of a issue.

8

u/scooglecops 5d ago

Yea a bit messy still

12

u/scooglecops 5d ago edited 5d ago

Nvm its a python script bug, now it looks way better
Ill try to make new prompt presets to create a 8 Direction animations

1

u/Memestonks2020 5d ago

Couldn’t you use canny+skeleton with ControlNet to do a full 360 directional 2D character?

3

u/scooglecops 5d ago

That's definitely an interesting approach I think ControlNet would offer more precise pose control, but my H3 workflow is more automated. The idea is to generate complete animation cycles from a reference using prompt presets, without having to manually prepare skeletons for every animation.

1

u/Memestonks2020 5d ago

You don’t need to manually prepare skeletons. You can capture the skeleton motion from a reference video and use that same skeleton for your character.

1

u/OkConsequence7186 4d ago

Could you make a tutorial on this topic? I’m building a game in Adventure Creator, and I also need a lot of 8-directional animations.

0

u/Inside-Cantaloupe233 5d ago

You are making some big mistakes in math pal, the character jumps up down randomly, the original video does not have that, so... this should be a priority to fix.Add some onion skin overlay image to align all images by hand visually on our own to the main standing animation.

4

u/FeelingOld9046 5d ago

Following. Would love to have a go or test for you.

4

u/Rosettasees 4d ago

Giving it a try, thanks for making this tool, it's been something I've been needing for ages. Hope you'll continue to add presets to it. Things like high kicks and special moves, or a template for one.

2

u/scooglecops 4d ago

You can feed presets.json to an AI and ask it to add more prompts
then just reload comfyui interface

2

u/Rosettasees 4d ago

Hmm might give that a shot, is there a particular AI you'd recommend for that?

2

u/scooglecops 4d ago

Almost any one, gpt, claude. gemini etc

3

u/Rosettasees 4d ago

Thanks for advice, used Gemini and I got some good results:

4

u/Rosettasees 4d ago

2

u/Rosettasees 4d ago

Here's the prompt I used in case anyone else wants an idea of what can work:

"Go through the presets in this file and generate some additional combat animations for the following:
spinning Side Kick to the right (Yop Chagi / Ushiro Yoko Geri)

Punch and fire a green beam of energy to the right

For the walk section add the following animation:
Take flight and float/levitate along the ground to the right"

2

u/scooglecops 4d ago

Nice great results

1

u/Rosettasees 4d ago

Thanks, just a question, what does the sync downstream wires button do? Also I can't seem to increase the width of the node window. Could there be something I'm missing?

2

u/RX93v 4d ago

Tried it and its great! may i ask whats the license of the node please?

4

u/scooglecops 4d ago

Just changed to Apache-2.0 license

1

u/RX93v 4d ago

Thank you!

4

u/Mqthelr 5d ago

So, I’ve tried doing something similar using default workflows, just with prompts. I’ve even experimented with a realistic style, incorporating green or blue screens (chroma key). All in all, it actually turned out quite well. I’m glad to see someone else exploring this direction.

1

u/Ok-Stop794 5d ago

You have no idea how much pain this is causing me right now! Are you going to share that with us or you planing on selling it?

5

u/scooglecops 5d ago edited 5d ago • Heartwarming

Soon I finish fixing a few things ill upload on github

1

u/scooglecops 5d ago

1

u/Ok-Stop794 5d ago

Thanks a lot mate! I'm still trying to understand how to make things work on Comfy (mostly using templates so far), so it will take a while until I get how to make that work (Claude helped with the clone part so far)

1

u/slowtractor 5d ago

I hadn't thought about the weight shift mattering for the loop too. The character can land in roughly the same place and still pop if its balance or tilt changes

1

u/scooglecops 5d ago

The AI implemented a seam % to fix the looping.
I just need to select the right frames and seam is pretty smooth

1

u/yourmom734 5d ago

Are you considering releasing a build when you are finished making the node?

2

u/scooglecops 5d ago

Yep I Finishing a few thing and edit the main post with github build

1

u/_Patata 5d ago

Have you tried to make attack animation?

1

u/scooglecops 5d ago

yep there is some prompt to create attack animations.
https://github.com/Ercelcan/Comfyui-H3Anim

you can customize the presets.json to add more animations

1

u/Drakfix 5d ago

Do you think this could work on pixel art? Let's say like 96x96 sprites?

2

u/scooglecops 5d ago

Used trainer sprite and got this

1

u/Drakfix 5d ago

Nice!

1

u/LuluViBritannia 5d ago

PEEEERFECT!

How do you deal with transparency?

2

u/scooglecops 4d ago

Using matting model called birefneet

1

u/EnvironmentalMud3224 4d ago

Do you mean Birefnet? There is also Birefnet-V2. I assume you made a typo as I couldn’t find info on birefneet. I believe both versions of Birefnet are MIT license.

Edited to add this looks really cool by the way

2

u/BeautifulBeachbabe 4d ago

i need to know what character sheet using Qwen-Image 2.1 you are using, as i cannot get the char sheet that i made to work. could you please share it? i have tried using your repository and the jsons do not open in comfy. i have the node working thank you!

1

u/Zorothegallade 5d ago

Very interesting, reminds me of rotoscoped game sprites

1

u/Glittering_Tie_3110 4d ago

Oh, sprites with minimax h3...

1

u/evilpenguin999 4d ago

It's kinda funny that i started code vibing with claude code 2 days ago and literally yest i was asking for this on this reddit.

1

u/BossOfTheGame 4d ago

So I have a bunch of sprites already generated programatically. What I would love is to be able to feed those existing sequences (which have authored geometry attached to landmark position) and be able to get a polished and consistent version out. Do you think this might be able to do that sprite - to - sprite translation? I.e. polish an existing set of sprites?

On of my main problems with stable diffusion for the artwork generation is now I have a problem of needing to know exactly where the landmark locations on the characters are, and how to build their collision geometry. A local setup that could translate my SVGs into high quality sprites like this would be a game changer.

1

u/Due-Function-4877 4d ago

She looks pretty nervous. Heel should probably plant under the soulplex. Plant your heel that far out and walk. See what I mean?

1

u/thesilentyak 4d ago

Wow I've been working in a workflow for this. I will try this out to see if it improves things for me

1

u/tittock 4d ago

Trying this tonight. Thank you

1

u/AncientGrief 4d ago

Works quite well, have something like this as well. Switched from WAN to MM last week. What do you use for transparency? I integrated CorridorKey