8000 GitHub - Ercelcan/Comfyui-H3Anim: ComfyUI custom node for MiniMax H3 animation generation, transparency, and sprite-sheet export. · GitHub
[go: up one dir, main page]

Skip to content

About

ComfyUI custom node for MiniMax H3 animation generation, transparency, and sprite-sheet export.

Resources

Stars

119 stars

Watchers

1 watching

Forks

Repository files navigation

H3Anim for ComfyUI

H3Anim is a ComfyUI custom node for generating short character animations with MiniMax H3 and turning them into transparent, aligned animation frames and game-ready sprite sheets.

The node combines generation, background removal, frame selection, stabilization, preview, and export in one H3Anim One-Node Studio interface.

Showcase

The repository includes a sample output video and a sample Mina sprite sheet:

Example sprite sheet:

Mina wave sprite sheet

Features

  • Generate a clip from character reference images, or use first/last frames for image-to-video generation.
  • Choose from animation prompt presets, visual styles, backdrops, or write a custom prompt.
  • Extract transparency using an external mask, an optional background-removal model, or a color key.
  • Adjust edge softness, spill suppression, and alpha erosion/dilation.
  • Select, reorder, offset, and preview frames in the Studio.
  • Stabilize frames and pack them into a sprite sheet with atlas metadata.
  • Export individual PNG frames, a sprite sheet, atlas JSON, and a combined animation manifest.
  • Keep a recent generation history that can be reloaded in the node.

Requirements

  • A working ComfyUI installation with native MiniMax H3 support. Reference-to-video requires MiniMaxH3ReferenceToVideo; image-to-video also requires MiniMaxH3ImageToVideo.
  • Compatible MiniMax H3 model files installed in ComfyUI's model folders:
    • Diffusion model in ComfyUI/models/diffusion_models/
    • Text encoder in ComfyUI/models/text_encoders/
    • Video VAE in ComfyUI/models/vae/
  • Optional LoRA files in ComfyUI/models/loras/.
  • Optional background-removal model if you want to use model-based matting. The built-in keyer and an externally connected mask do not require one.

Install model files separately and follow the model publisher's license and usage terms. H3Anim does not bundle model weights.

Installation

Clone this repository into ComfyUI's custom_nodes directory:

cd ComfyUI/custom_nodes
git clone https://github.com/Ercelcan/Comfyui-H3Anim.git

Restart ComfyUI after installation. No separate Python package installation is required for the node itself; it uses ComfyUI's built-in nodes and installed dependencies.

How to use

  1. Start ComfyUI and add H3Anim One-Node Studio from the H3Anim category.

  2. Select the H3 model, text encoder, and video VAE in the Generate panel.

  3. Choose Reference to Video and connect up to three character reference images, or choose Image to Video and connect a first frame. A last frame is optional.

  4. Choose an animation preset, style, and backdrop, or enter a custom prompt. Set generation size, duration, steps, sampler, and seed as needed.

  5. Press Generate. The node generates and decodes the video, then prepares the frames for the studio.

  6. In Matte, use an external mask, an optional background-removal model, or a background keyer to create transparency. Refine the alpha and edge settings.

  7. In Studio, preview the raw frames, select the frames for the animation, adjust their offsets, and configure frame rate and sprite-sheet layout.

  8. In Export, choose the asset and action names and export the desired files. Exports are written under ComfyUI's output directory, by default:

    ComfyUI/output/H3Anim/<asset-name>/
    
  9. Use History to reload a recent generation for more editing or export.

Inputs and outputs

Optional node inputs:

Input Purpose
ref_image_1–ref_image_3 Character/reference images for reference-to-video generation
first_frame Starting image for image-to-video generation
last_frame Optional ending image for image-to-video generation
external_mask Mask used for transparency instead of the selected background-removal/keying method

Node outputs:

Output Contents
frames_rgba Aligned animation frames with alpha
alpha_mask Alpha masks for the aligned frames
sprite_sheet Packed sprite sheet
loop_video Preview video composed from the selected frames
atlas_json Atlas metadata as a JSON string
raw_frames Decoded generation frames before matting and studio edits

Export files

By default, the export panel writes a sprite sheet, atlas JSON, and updates a combined <asset>_animations.json manifest. The manifest follows the format shown in Animationstest/mina_animations.json. You can also export individual aligned frame PNGs, and create a mirrored copy of an animation.

The exported atlas includes frame rectangles and layout metadata such as cell dimensions, frame count, and FPS. The combined manifest indexes each action's sheet and atlas files.

Sample assets

Animationstest/ contains the Mina test animation set, including sprite sheets, per-animation atlas JSON files, a combined animation manifest, and test.mp4. These assets demonstrate the expected export format; they are not required to run the node.

Troubleshooting

  • Models do not appear in the selectors: Check that the model files are in the correct ComfyUI model folders, then restart ComfyUI.
  • A MiniMax H3 node is missing: Update ComfyUI to a build that includes the required native MiniMax H3 nodes.
  • No transparency or poor edges: Try a different key color/background setting, connect an external mask, or select an installed background-removal model.
  • Generation is too slow or runs out of memory: Reduce output dimensions or duration, or adjust the generation settings for your hardware.

License

Apache-2.0 license

About

ComfyUI custom node for MiniMax H3 animation generation, transparency, and sprite-sheet export.

Resources

Stars

119 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0