Nodes/ComfyUI-MagicDance/Magic Dance Decoder
ComfyUI Node

Magic Dance Decoder

Latent frames back into pixels

By bombax-xiaoice·Created 2 years ago·Updated 2 years ago· 2
Magic Dance Decoder
  • pipe
  • latents
  • images

MagicDanceDecoder is the payoff node. The sampler hands you a latent batch of all your animated frames, and this node turns that batch back into actual images - which is when the MagicDance workflow finally looks like a video instead of a tensor. It's the encoder's mirror image and the least interesting node in the pack, but you can't skip it: no decoder, no pixels, no mp4.

The pack is a port of MagicPose (the USC + ByteDance pose-animation model), built on an SD 1.5 pipeline. The decoder is the same VAE-decoding step you already know from ordinary SD - it just does it frame by frame, preserving your batch order so frame 0 comes out first and the last pose's frame comes out last.

How it works

Under the hood it walks the latent batch one sample at a time (that's the latents["samples"].shape[0] loop), moves each frame to the VAE device and dtype, runs decode_first_stage, clamps the result to 0..1, and concatenates everything back into a single IMAGE tensor in the original order. It also updates a progress bar per frame - and, if you've enabled a preview method in ComfyUI Manager, it shows you each frame as it lands. That preview is worth turning on: generation is slow, and watching frames appear beats staring at a percentage.

Inputs and output

  • pipe - the same MAGICDANCEPIPE from LoadMagicDanceModel you used for the sampler.
  • latents - the latent batch from MagicDanceSampler. It expects the batch first dimension; one latent per pose.

The output is images, an IMAGE batch in the same order as your poses.

Where it fits

In the example workflow that ships with the pack, the decoder feeds VHS_VideoCombine (from ComfyUI-VideoHelperSuite, which you'll need for the example JSON) to write an actual video file - or a plain preview/save node if you just want PNG frames. Frames come out batched, so everything that expects a normal image batch works here.

Installing and gotchas

Install via ComfyUI Manager (search "ComfyUI-MagicDance") or:

cd ComfyUI/custom_nodes
git clone https://github.com/bombax-xiaoice/ComfyUI-MagicDance
pip install -r ComfyUI-MagicDance/requirements.txt

Then restart. Same shared pack traps apply: the folder has to stay named ComfyUI-MagicDance (imports depend on it), the ~2.3GB checkpoint downloads on your first loader run, and the requirements list is the original research repo's flattened conda deps - if a package refuses to build, you can usually skip it. Because it uses the SD 1.5 VAE, the decoded frames match whatever resolution the reference image was - if you asked the sampler for something odd, the frames here will be that size. And if the video looks like a slideshow, that's not the decoder: it faithfully decodes what the sampler gave it. Fewer steps or shorter pose sequences are the levers.

CategoryMagicDance

Inputs (2)

NameTypeDefaultDescription
pipeMAGICDANCEPIPE
latentsLATENT

Outputs (1)

NameTypeDescription
imagesIMAGE