Paper commentary
MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model
- Problem Per-frame diffusion animators flicker, and CLIP-based reference encoding keeps too little detail to preserve identity and background.
- Method Adds temporal attention to a diffusion UNet, a trainable appearance encoder whose features join the self-attention, a DensePose-driven pose ControlNet, and overlap-averaged segment fusion at inference.
- Results On TikTok, reached FVD 179.07 against 292.80 for DisCo and FID-VID 21.75 against 59.90, while single-frame FID stays slightly worse than DisCo (32.09 against 30.75).

Figure 1 . Given a sequence of motion signals, MagicAnimate pro- duces temporally consistent animation for reference identity im- ages, whereas state-of-the-art methods fail to generalize or pre- serve the reference appearance, as highlighted in red boxes. The motion sequence is overlaid at the corner. ∗Note that MRAA di- rectly uses video frames as the driving signal. The complete video results can be found on our Project Page.
Original paper · CC BY 4.0 · Zhongcong Xu, Jianfeng Zhang, Jun Hao Liew, Hanshu Yan, Jia-Wei Liu, Chenxu Zhang, Jiashi Feng, Mike Zheng Shou · MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model · Original paper figure · Extracted the figure area from page 1 of the original PDF.Flicker and weak reference detail in earlier animators
Human image animation takes a reference photo of a person and a motion sequence, and produces a video of that person moving as the sequence dictates. Earlier work falls into GAN-based and diffusion-based families, and the two fail in different ways. GAN-based methods warp the reference toward the target pose and let a GAN fill in the parts that become hidden, which gives limited motion transfer and weak generalization when the identity changes.
Diffusion-based methods generate a long video one frame at a time and stack the frames, so nothing ties one frame to the next and the output flickers. These methods also encode the reference with CLIP, whose semantic-level features are too sparse to hold clothing and background detail.
How the pieces fit together
The framework adds temporal attention, an appearance encoder, an image-video joint training strategy and a video fusion step to one diffusion-based animator. The appearance encoder and the pose control act at each denoising step, while temporal attention links frames inside the video UNet.
Temporal attention inside the video UNet
The framework starts from a pretrained image diffusion model and inflates its 2D UNet into a 3D temporal UNet by inserting temporal attention layers. The latent for K frames is reshaped so that the frame axis is folded into the batch axis, so the spatial layers process each frame on its own. Inside the temporal modules the features are reshaped so that the K frames form a sequence at each spatial position, and attention runs along that sequence.
Each frame has to know its place in the clip, so sinusoidal positional encoding is added before attention. The attention is the standard scaled dot-product form, with queries, keys and values all projected from the latent \(z_t\): \[\text{Attention}(Q,K,V)=\text{Softmax}\left(\frac{QK^{T}}{\sqrt{d}}\right)V\] where \(Q=W^{Q}z_t\), \(K=W^{K}z_t\) and \(V=W^{V}z_t\).
Each frame's output is a weighted mix of the features of the other frames in its segment, and the attention window cannot reach frames outside that segment.
Appearance encoder and hybrid attention
The appearance encoder is a second, trainable copy of the base UNet, written \(F_a(\cdot;\theta_a)\), and it processes the reference image at every denoising step \(t\). Its output \(y_a\) is a set of normalized attention hidden states taken from the middle and upsampling blocks. This differs from ControlNet, which adds residuals; here the reference states are concatenated with the UNet's own self-attention keys and values.
The resulting hybrid self-attention is \[\text{Attention}(Q,K',V')=\text{Softmax}\left(\frac{QK'^{T}}{\sqrt{d}}\right)V'\] with \(Q=W^{Q}z_t\), \(K'=W^{K}[z_t,y_a]\) and \(V'=W^{V}[z_t,y_a]\), where \([\cdot]\) denotes concatenation. Queries still come only from the current latent, so the pose and position of the person stay under the control of the denoising trajectory, while the keys and values can also draw on reference features.
The authors argue that this lets the model copy identity, clothes, accessories and background from the reference while keeping the layout of the target pose. They also argue that a stable appearance condition supports temporal consistency, because the same identity and background are kept through the whole video.
DensePose conditioning and the denoising step
For motion, the authors choose DensePose over OpenPose keypoints, since they argue sparse keypoints are not robust to motions such as rotation. A pose ControlNet \(F_p(\cdot,\theta_p)\) turns each frame's DensePose \(p_i\) into condition residuals \(y_{p,i}=F_p(z_t\mid p_i,t,\theta_p)\), which are added to the residuals of the middle and upsampling blocks.
The per-frame motion features are concatenated into \(y^{1:K}_p\) for the segment. The noise estimate for a segment is \[\epsilon^{1:K}_\theta(z^{1:K}_t,t,I_{ref},p^{1:K})=F_T(z^{1:K}_t\mid t,y_a,y^{1:K}_p)\], which combines the temporal UNet with the appearance and motion conditions. The parameter set \(\theta\) collects all trainable parameters, namely \(\theta_T\), \(\theta_a\) and \(\theta_p\).
Two-stage training with joint image and video sampling
Training has two stages, and the first leaves the temporal attention layers out while the appearance encoder and pose ControlNet are trained together. The first-stage objective is a noise-prediction loss on single target images: \[\mathcal{L}_1=\mathbb{E}_{z_0,t,I_{ref},p_i,\epsilon\sim\mathcal{N}(0,1)}\left\|\epsilon-\epsilon_\theta\right\|_2^2\], with \(F_p\) and \(F_a\) as the learnable modules.
The second stage optimizes only the temporal attention layers of \(F_T\), against the segment loss \[\mathcal{L}_2=\mathbb{E}_{z^{1:K}_0,t,I_{ref},p^{1:K},\epsilon^{1:K}\sim\mathcal{N}(0,1)}\left\|\epsilon^{1:K}-\epsilon^{1:K}_\theta\right\|_2^2\]. Adding the temporal layers improves temporal modelling but lowers per-frame quality, which is why image data is mixed in during this stage.
Human video datasets are smaller and less varied in identity, background and pose than image datasets, which limits how well the reference condition can be learned. In the first stage each sample is a single human image with probability \(\tau_0\) drawn from a large image dataset; its pose is estimated from the reference itself, so the objective becomes reconstruction.
In the second stage a threshold \(\tau_1\) selects image data when \(r\le\tau_1\) and video data otherwise, and \(\tau_2\) adds a third branch in equation (7).
Segment-wise inference and video fusion
Memory limits mean long videos are generated segment by segment, which keeps consistency within each clip but can leave small seams between clips. At inference the long motion sequence is cut into overlapping windows of K frames with overlap stride \(s\), where \(s<K\). The number of windows is \(n=\lceil (N-K)/(K-s)\rceil\), and a final short window is padded with the first few frames to reach K frames.
All windows start from the same initial noise, which the authors found empirically improves video quality. At each denoising timestep every window gives its own noise prediction, and predictions for frames shared by overlapping windows are averaged. After the final timestep this produces one denoised video \(I^{1:N}\).
Datasets and metrics
Two benchmarks are used: TikTok, with 350 dancing videos, and TED-talks, with 1,203 video clips taken from TED-talk videos on YouTube. For TikTok the test set is the one DisCo uses, and for TED-talks the official train/test split is kept. TikTok single-frame quality is measured with L1, SSIM, LPIPS, PSNR and FID, and video fidelity with FID-FVD and FVD.
TED-talks follows MRAA with L1, AKD, MKR and AED, plus FID, FID-VID and FVD, because the keypoint measures do not capture perceptual quality. Baselines are MRAA and TPS, GAN-based methods that warp with optical flow and inpaint with a GAN, plus DisCo and IPA+CtrlN, with IPA+CtrlN-V as its temporal-attention variant.
TikTok comparison results
On TikTok, MagicAnimate reached an FVD of 179.07 and an FID-VID of 21.75, against 292.80 and 59.90 for DisCo, where lower values are better. Relative to DisCo, the authors report improvements of 38.8% for FVD and 63.7% for FID-VID. The abstract summarizes the video-fidelity gain as more than 38% over the strongest baseline.
Among the DensePose-driven rows, with the starred ground-truth rows excluded, MagicAnimate has the lowest L1 at 3.13E-04, the highest PSNR at 29.16, the highest SSIM at 0.714 and the lowest LPIPS at 0.239. Against DisCo, that is 6.9% higher SSIM and 18.2% lower LPIPS.
FID is not the best on TikTok, where DisCo reached 30.75 against 32.09 for MagicAnimate. The starred rows, which drive with ground-truth frames, score higher on PSNR, with MRAA* at 29.39 and TPS* at 29.18, and they are included only as references.
TED-talks video metrics and keypoint accuracy
On TED-talks MagicAnimate reached an FVD of 131.51, against 182.78 for MRAA, the second-best method by FVD, which is a 28.1% improvement. Its FID-VID of 19.00 is only marginally below DisCo's 19.02. Single-frame FID is 22.78 against 27.51 for DisCo, a 17.2% improvement. Among the rows without starred references, MagicAnimate also has the lowest AKD at 2.65, MKR at 0.013 and AED at 0.204, against 2.96, 0.019 and 0.253 for DisCo.
Full-frame L1 is higher, at 2.92E-04 against 1.61E-04 for MRAA. The authors attribute this to the DensePose control signals lacking background information, so the dynamic background in the TED-talks clips is not learned consistently. On foreground-only L1 the gap is small, at 1.11E-04 against 1.07E-04 for MRAA. The starred MRAA* and TPS* rows, which use ground-truth frames, still have lower FID and FVD than MagicAnimate, for example MRAA* with FID 21.13 and FVD 78.29.
Qualitative comparisons and cross-identity animation
On TikTok, MRAA and TPS struggle when the target pose differs strongly from the reference. IPA+CtrlN and DisCo look good frame by frame, but the authors observe clothing colour changes and inconsistent backgrounds in occluded regions, which they link to generating each frame independently. IPA+CtrlN-V keeps content more consistent, but its single frames are weaker, which the authors attribute to weak reference conditioning.
MagicAnimate shows high-fidelity detail for the background, clothes, face and hands in the same frames.
On the gesture-driven TED-talks clips, MRAA and TPS look plausible but their motion is inaccurate, while the appearance-conditioned methods follow the pose more precisely. Among these methods MagicAnimate keeps the identity and background best, which the authors credit to its appearance encoder.
In cross-identity tests, two TikTok motion sequences drive reference images from other videos; MRAA fails on large pose differences and DisCo leaves artifacts in the background and clothing, while MagicAnimate follows the target motion.
Ablations of each component
All ablations run on TikTok, which has large pose variation, many identities and varied backgrounds. Removing the temporal attention layers raises L1 from 3.13 to 3.98, FVD from 179.07 to 247.30 and FID-VID from 21.75 to 42.21. PSNR, SSIM and LPIPS also get worse without them, at 28.90, 0.652 and 0.263 against 29.16, 0.714 and 0.239. FID is the exception, being lower without temporal attention, at 27.54 against 32.09.
Qualitatively, the model without explicit temporal modelling fails to keep temporal coherence for people and backgrounds.
Replacing the appearance encoder with CLIP gives an L1 of 8.00 and an FVD of 724.96, and replacing it with IP-Adapter gives 7.89 and 590.99, against 3.13 and 179.07 for the full model.
The two columns of Table 2c mark joint training in the appearance-encoding stage and in the temporal-modelling stage. With both enabled the model has the lowest L1 at 3.13, FID at 32.09 and FID-VID at 21.75; with both disabled, L1 is 3.20 and FID 37.15. Both partially and fully disabled rows have lower FVD than the full model, at 156.32 and 158.16 against 179.07.
Without averaging the overlapping predictions, L1 is 3.21 against 3.13, FID 32.99 against 32.08 and FID-FVD 22.50 against 21.75. The full model's FID appears as 32.09 in Table 2c and as 32.08 in the fusion and noise tables. Using a different initial noise for each segment lowers L1 to 3.03 but raises FID to 32.74 and FID-FVD to 22.50, against 32.08 and 21.75 with shared noise.
Shared noise is the choice the tables support on FID and FID-FVD, but not on L1.
Unseen domains, text-to-image inputs and multiple people
The model is trained only on realistic human data, yet it is shown animating oil paintings and movie frames into running and yoga motions, with a stable background and temporally consistent fill of occluded regions. Reference images can also come from DALL·E3, and prompts such as a woman doing yoga in the universe are animated with the same model.
Multi-person animation is shown with two dancing people driven by one motion sequence. These cases are shown as example outputs, and no metric is reported for them.
Limitations
Because the model works on K-frame windows, temporal attention cannot model consistency across windows, and minor discontinuities can remain at segment boundaries.
On TED-talks the full-frame L1 is higher than MRAA's, which the authors tie to missing background in the DensePose signal. On TikTok the single-frame FID is worse than DisCo's.
The text gives no values for the thresholds \(\tau_0\), \(\tau_1\) and \(\tau_2\) used in image-video joint training; they are described as set empirically. The ablations cover only TikTok, and each table row carries a single value per metric.
Paper info
- Authors
- Zhongcong Xu, Jianfeng Zhang, Jun Hao Liew, Hanshu Yan, Jia-Wei Liu, Chenxu Zhang, Jiashi Feng, Mike Zheng Shou
- Venue
- arXiv · Preprint
- First published
- 2023-11-27
- Added
- 2026-11-5
- Updated
- 2023-11-27
- Version
- v1
- arXiv
- 2311.16498
- Category
- cs.CV · cs.GR
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
This paper studies the human image animation task, which aims to generate a video of a certain reference identity following a particular motion sequence. Existing animation works typically employ the frame-warping technique to animate the reference image towards the target motion. Despite achieving reasonable results, these approaches face challenges in maintaining temporal consistency throughout the animation due to the lack of temporal modeling and poor preservation of reference identity. In this work, we introduce MagicAnimate, a diffusion-based framework that aims at enhancing temporal consistency, preserving reference image faithfully, and improving animation fidelity. To achieve this, we first develop a video diffusion model to encode temporal information. Second, to maintain the appearance coherence across frames, we introduce a novel appearance encoder to retain the intricate details of the reference image. Leveraging these two innovations, we further employ a simple video fusion technique to encourage smooth transitions for long video animation. Empirical results demonstrate the superiority of our method over baseline approaches on two benchmarks. Notably, our approach outperforms the strongest baseline by over 38% in terms of video fidelity on the challenging TikTok dancing dataset. Code and model will be made available.
Quote from the paper
Zhongcong Xu, Jianfeng Zhang, Jun Hao Liew, Hanshu Yan, Jia-Wei Liu, Chenxu Zhang, Jiashi Feng, Mike Zheng Shou (2023). MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model. arXiv:2311.16498v1. https://arxiv.org/abs/2311.16498v1
BibTeX
@misc{xu2023magicanimate,
title = {{MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model}},
author = {Zhongcong Xu and Jianfeng Zhang and Jun Hao Liew and Hanshu Yan and Jia-Wei Liu and Chenxu Zhang and Jiashi Feng and Mike Zheng Shou},
year = {2023},
eprint = {2311.16498},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2311.16498v1}
}