Skip to Content
ElectronicsElectronics
  • Article
  • Open Access

25 October 2026

18 Pages

Enhancing Human Body Generation in Diffusion Models with Dual-Level Prior Knowledge

,
,
,
,
,
,
and
1
School of Data and Computer Science, Shandong Women’s University, Jinan 250300, China
2
School of Data Science, Fudan University, Shanghai 200433, China
3
School of Cyber Science and Technology, Shenzhen Campus of Sun Yat-sen University, Shenzhen 518107, China
4
School of Computer Science and Engineering, Tianjin University of Technology, Tianjin 300384, China

Abstract

The development of diffusion models (DMs) has greatly enhanced text-to-image generation, outperforming previous methods like generative adversarial networks (GANs) in terms of image quality and text alignment. However, accurately generating human body images remains challenging, often resulting in disproportionate figures and anatomical errors, which limits their practical applications in areas such as portrait generation. While previous methods such as HcP have shown promising results, limitations, including the retention of noisy priors, limited understanding of human representation, and restriction of generalization power, still exist due to the specific design of fully supervised learning with only pose-related information. In this study, we introduce a novel method to enhance pretrained diffusion models for realistic human body generation by incorporating dual-level human prior knowledge. Our approach involves learning shape-level details with the human-related tokens in the original prompts, and learning pose-level priors by adding a learnable pose-aware token to each text prompt. We use a two-stage training strategy to rectify the cross-attentions with a bind-then-generalize process, leveraging multiple novel objectives along with adversarial training. Paired comparisons on SD1.5 and SDXL, under identical prompts and generation seeds, show more coherent human bodies than the pretrained models and a LoRA baseline trained on the same images. Image-level metrics improve on SDXL. Those metrics measure image quality, distributional similarity, and preference. The anatomical comparison is carried by the paired images and the attention maps.

1. Introduction

Despite improvements in AI-generated content fidelity [1,2] and text alignment compared to GANs [3,4], diffusion models [5,6,7,8,9] still struggle with human body images, a common visual in real-world media. These advanced models often produce disproportionate bodies and inaccurately placed, missing, or redundant limbs and hands, limiting their application in areas like portrait generation and image stylization. Since the introduction of the latent diffusion model (LDM) [10], researchers have focused on scaling up model and training data sizes to enhance human body image quality. Stable Diffusion XL 1.0 (SDXL; Stability AI, https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0, accessed on 1 March 2025) still produces these failures, as shown in Figure 1. Published results for Stable Diffusion 3 (SD3) [11] show the same difficulty. We cite SD3 as evidence that increasing model or data size has not by itself produced a reliable human-body representation. SD3 is not a baseline in our experiments.
Figure 1. Comparison between images generated by pretrained SDXL (first row) and SDXL finetuned with our method (second row).
We recognize HcP [12] as one of the few recent works focused on improving human body generation. This work introduces an additional attention map derived from pose information to amend the original cross-attention mechanisms. Unlike other methods [13] that rely on explicit conditions such as pose or depth, HcP can be seamlessly integrated into any text-to-image diffusion model, making it highly valuable. This study highlights a significant issue: the cross-attention modules in diffusion models often struggle to capture the location and shape information of target objects related to human tokens. This challenge is illustrated in Figure 2a, where examples generated by the pretrained SDXL show that cross-attention maps for human-related tokens either marginally highlight or completely neglect human regions, resulting in noisy, large activations in the background.
Figure 2. (a) Images generated by pretrained SDXL and the cross-attention maps of human-related tokens. Those tokens are printed in red in the prompts. In the attention maps, white denotes high activation and black denotes low activation. Pretrained SDXL does not place this activation on the body. (b) The same pose can correspond to different body shapes, so pose alone does not determine the body. (c) Skeletons from a pose detector. Colored lines connect adjacent keypoints and can be assigned to the wrong person or drawn across an occluded part.
While HcP delivers impressive results and maintains a lightweight design, we still identify several issues existing in this approach:
(1)
Retention of Noisy Priors: HcP revises the cross-attention maps of pretrained diffusion models by introducing additional attention maps. This method retains all prior knowledge from the pretrained models, including noisy attention maps. The new branch can highlight the desired regions but cannot suppress other areas, resulting in continued noisy attention maps.
(2)
Limited Understanding of Human Representation: HcP primarily focuses on human poses, neglecting other essential aspects of human representation. A pose alone cannot specify a particular human body type. Factors such as body shape (e.g., thin or heavy) and occlusion by objects (as shown in Figure 2c) are also crucial for accurately depicting human figures. For instance, with the pose illustrated in Figure 2b, it remains unclear whether to generate a slender girl or a heavier one.
(3)
Restriction of Generalization Power: HcP adopts a fully supervised learning strategy, relying on pose annotations paired with each training image. However, real-world images often feature diverse human bodies in unexpected poses. Even well-trained segmenters like SAM [14] and pose detectors such as HrFormer [15] can struggle in various corner cases. As a result, while the pretrained diffusion models may perform well on the training data, their generalization ability is limited.
To address the challenges in generating realistic human bodies, we propose a novel dual-level prior injection method that enhances pretrained diffusion models by learning both shape-level and pose-level human priors. Unlike HcP, which captures only limited human priors, our approach aims for a more generalizable and comprehensive understanding through a two-stage bind-then-generalize strategy. Specifically, we first bind the human-related tokens from the original prompts, along with an additional pose token attached to the text prompt, to their corresponding semantic regions. This binding produces meaningful attention maps for these tokens. We propose a novel composite objective with three distinct terms to facilitate the learning process: The first term suppresses attention activation outside human regions in each image. Building on this, the second term encourages the diffusion UNet to ensure that human-related activation exceeds non-human-related activation, effectively highlighting human body regions. The third term fits the attention map to the mask. Together, these objectives empower the pretrained diffusion models to extract and aggregate critical information from various token types, leading to higher-quality human body generation.
After establishing a one-to-one mapping based on the training data, we guide the model to mimic the distribution of real attention maps. We utilize commonly used generative adversarial networks (GANs) by introducing shape-aware and pose-aware discriminators corresponding to the human-related and pose tokens, respectively. The diffusion UNet is trained against these discriminators in an adversarial minimax game, enabling it to generate cross-attention maps that align with real data distributions. On the paired prompts in Section 5, this second stage keeps a coherent pose and shape for ordinary actions and for less common ones, on both SD1.5 and SDXL.
To show the effectiveness of our proposed method, we conduct experiments across a range of text prompts. Under matched prompts and generation seeds, both SD1.5 and SDXL produce more coherent human bodies than the corresponding pretrained models and LoRA baselines. On SDXL, image-level metrics improve as well. In summary, the contributions of this work are as follows:
(1)
Dual-Level Prior Injection Method: We present a novel method that enhances pretrained diffusion models by learning shape-level and pose-level human priors through a two-stage bind-then-generalize strategy. Our method binds human-related tokens from text prompts and an additional pose token to their corresponding semantic regions, resulting in meaningful attention maps.
(2)
Composite Objective for Learning: We propose a composite objective with three terms: a mean penalty outside the mask, a peak-to-peak margin of 0.1 , and a pixel-level fit to the mask.
(3)
Mimicking Real Attention Map Distribution: We further introduce adversarial training to rectify the cross-attention maps, with shape-aware and pose-aware discriminators enhancing the model’s ability to mimic the real data distribution.
(4)
Improved Model Performance: On SD1.5 and SDXL, paired comparisons show more coherent bodies than the pretrained models and a matched LoRA baseline. Image-level metrics improve on SDXL. The anatomical evidence is the paired images and the attention maps.

3. Preliminary: Stable Diffusion

Diffusion models aim to capture the data distribution p θ x 0 of clean data x 0 by gradually refining a standard Gaussian distribution, with the learning process framed as denoising score matching. Stable Diffusion (SD) builds upon this framework to enable text-to-image generation based on a text prompt p. By leveraging a pre-trained VQ-VAE [24] that includes an encoder E and a decoder D , SD allows the model to concentrate more on the semantic aspects of the data, thereby enhancing efficiency. A diffusion UNet is utilized to estimate the noise, incorporating an attention mechanism. Specifically, in the l-th layer, self-attention is first employed to facilitate interactions among spatial features: z l = A t t e n t i o n ( W Q l · z l , W K l · z l , W V l · z l ) , where A t t e n t i o n denotes the attention operator, z l represents the latent embeddings of the l-th layer, and W Q , W K , W V are the projection layers for self-attention. Following this, cross-attention is applied to incorporate conditioning information such as the text prompt: z ^ l = A t t e n t i o n ( W ^ Q t l · z l , W ^ K t l · z t e x t , W ^ V t l · z t e x t ) , where z t e x t denotes the text prompt embedding, and W ^ Q , W ^ K , W ^ V are the projection layers for cross-attention. The training objective of SD is formulated as follows:
L n o i s e = E E ( x ) , ϵ ∼ N ( 0 , 1 ) , t ϵ − ϵ θ z t , t 2 2 ,
where t is uniformly sampled from { 0 , . . . , T } , and z t represents the noisy latent at the t-th timestep.

4. Methodology

4.1. Semantic Attention Binding

Previous works have shown that the cross-attention maps of a diffusion UNet between text prompts and image latent embeddings can indicate the coarse location and shape of the target objects. However, as mentioned in Section 1, the pretrained SD fails to produce meaningful cross-attention maps regarding human-related tokens, such as man, woman, etc., which can result in the problem of human body deformity. Consequently, we propose first guiding the cross-attention maps to bind with correct regions, i.e., suppressing non-human-related activation and highlighting human-related activation, as shown in Figure 3. Inspired by previous works, a composite objective is utilized.
Figure 3. Schematic of the proposed method. (Left) Supervised binding: human-related tokens are aligned with the body mask, and the pose token is aligned with the skeleton. (Right) Adversarial rectification: shape and pose discriminators match the distribution of real masks. Arrows indicate the training flow. Masks mark the supervised body region and the skeleton.
  • Attention maps. When processing each noisy latent z t of an image I , we read the cross-attention probabilities of the supervised tokens. Heads of the same layer are averaged. The maps are then grouped by the down, mid, and up blocks at resolutions of 8, 16, 32, and 64. Inside a group, the token loss averages the target tokens and sums the layers, while the pixel loss averages the layers and sums the target tokens. The pixel term is the average of a binary cross-entropy at the native resolution and the same cross-entropy after upsampling. These two losses do not apply a further spatial min–max normalization. Appendix A records the grouping. SAM [14] segments the human bodies in I and produces the shape mask M s h a p e . For a map M ^ and this mask, write Ω + = { ( i , j ) ∣ M i , j s h a p e = 1 } and Ω − = { ( i , j ) ∣ M i , j s h a p e = 0 } .
  • Suppressing loss. The first term penalizes attention that falls outside the body. It is the mean response on Ω − :
    L s s h a p e ( M ^ ) = 1 | Ω − | ∑ ( i , j ) ∈ Ω − M ^ i , j .
  • Margin loss. The second term compares the peak response inside the mask with the peak response outside it:
    f ( M ^ ) = max ( i , j ) ∈ Ω + M ^ i , j ,
    g ( M ^ ) = max ( i , j ) ∈ Ω − M ^ i , j ,
    L m a r g i n s h a p e ( M ^ ) = max ( 0 , g ( M ^ ) − f ( M ^ ) + δ ) ,
    with δ = 0.1 . The hinge is zero when the strongest human-region response exceeds the strongest non-human response by 0.1 . When it is active, gradient descent raises the inside peak and lowers the outside peak. Both reductions are maxima over their own index sets. They are not a minimum or a maximum of a map that has been multiplied by an indicator, which would insert zeros from the complementary region into the statistic. The token loss on a map is L token s h a p e = L s s h a p e + L m a r g i n s h a p e .
  • Pixel loss. The token terms control where the attention mass sits. A pixel term then fits the map to the mask with a binary cross-entropy. Masks stored in [−1, 1] are mapped by ( M + 1 ) / 2 before this loss. On each map, the pixel term averages the cross-entropy at the native resolution and the cross-entropy of the upsampled map:
    L s c a l e s h a p e ( M ^ ) = 1 2 BCE ( M ^ , M ˜ s h a p e ) + BCE ( Up ( M ^ ) , Up ( M ˜ s h a p e ) ) ,
    where M ˜ s h a p e = ( M s h a p e + 1 ) / 2 . The shape-binding objective used in the ablations is the combination of the three terms,
    L b i n d s h a p e = L s s h a p e + L m a r g i n s h a p e + L s c a l e s h a p e .
In the training run, the noise objective and these attention terms are weighted as 0
L = L n o i s e + 0.005 L token + 0.2 L pixel ,
where L n o i s e is the mean-squared noise loss in Equation (1), L token collects the suppressing and margin terms, and L pixel is the cross-entropy above. SNR weighting is disabled, and the noise offset is 0. With this objective, the cross-attention modules learn which information is carried by the human-related tokens and place it on the body. TokenCompose [25] also proposes regularizing the cross-attention maps of a diffusion UNet with extra objectives. However, since TokenCompose focuses on improving the textual fidelity of diffusion models, it is sufficient for the cross-attentions to provide rough locations for each semantic token. Compared with that, rectifying human body deformity requires more refined attention control, otherwise the unrelated information could easily lead to mistakenly drawn human bodies. Therefore, we propose a composite objective with multiple sub-goals, which can provide stronger supervision as we will show in the experiments.
  • Pose tokens. The proposed L b i n d s h a p e can guide the diffusion UNet to attend to the human-related tokens in text prompts on human-related regions in the images. However, it is hard to correctly portray a human body solely based on the shape information. For example, when a man crosses his arms, M s h a p e can only show that the arms are not stretched, but cannot tell what exact pose the man is holding. As a result, it is also important to embed to pose-related information into the diffusion UNet. In spite of its importance, simply copying L b i n d s h a p e to also train the human-related tokens with pose information means these tokens have to learn two different levels of knowledge, which would be much harder.
To this end, we propose a simple yet effective alternative method. Specifically, a learnable pose token <sds>, which is aimed at representing pose-related information, is attached to each text prompt. To supervise the pose token with prior knowledge regarding poses, for each image I , we leverage MMPose [26] to detect the keypoints { p i } i = 1 N p , where N p denotes the maximum number of keypoints. Then, { p i } is processed into a skeleton mask M p o s e , in which lines are drawn between adjacent keypoints following human structure (e.g., neck and shoulders, elbows and wrists). After setting up <sds> and M pose , we can build the training scheme following the same approach as guiding human-related tokens. Concretely, for each training iteration, we collect the cross-attention maps M ^ pose regarding <sds>, and calculate the following objectives:
L b i n d pose = L s pose + L m a r g i n p o s e + L s c a l e pose ,
in which each item follows Equation (7), with the skeleton mask in place of the body mask. The margin on the skeleton likewise uses δ = 0.1 and compares the peak on the skeleton with the peak off the skeleton. SAM masks and MMPose skeletons are structural priors. Figure 2c shows typical failures, including a hand assigned to the wrong person and a skeleton drawn through an occluded part. A local mask error changes the outside mean, the two peaks, and the pixel target on the pixels it covers. It is not treated as a label of the whole image.
LoRA parameters [27] are attached to the pretrained UNet and optimized together with the pose-token embedding. The rank is 16, and the scaling coefficient is 16. The adapted projections are the query, key, value, and output projections of the attention layers in the down, mid, and up blocks. The text encoder is frozen. Once the pose token is enabled, the body term and the pose term inside each attention group are averaged, and the group losses are then added in Equation (8).

4.2. Adversarial Attention Rectification

While the above training strategy can guide the model to correctly bind human-related tokens with their semantic regions in the training set, this property can hardly be generalized to unseen cases, since the shape and pose of humans can severely vary among different images according to their ages, genders, events, and even the background scenarios. This makes the distribution of shape and pose data a sparse one, leading to great difficulty for the model to transfer the learned knowledge to a wide range of real cases. To solve this problem, we further propose leveraging adversarial training, which directly learns the data distribution via the supervision of a learnable discriminator rather than reciting the one-to-one mapping.
Specifically, we set up two discriminators, D s h a p e and D p o s e , for shape and pose data, respectively, corresponding to the human-related tokens and extra pose tokens. During each training iteration, we first get the intermediate cross-attention map sets M ^ s h a p e , M ^ p o s e , together with their ground truth annotations M s h a p e , M p o s e , using the same method as in Section 4.1. The discriminators treat these masks as samples of the real attention distribution, so the second stage matches that distribution rather than copying each training mask. The reported models optimize the Wasserstein objective [28]. The discriminators are updated by minimizing
L D s h a p e = 1 | M ^ s h a p e | ∑ M ^ ∈ M ^ s h a p e D s h a p e ( M ^ ) − D s h a p e ( M s h a p e ) ,
L D p o s e = 1 | M ^ p o s e | ∑ M ^ ∈ M ^ p o s e D p o s e ( M ^ ) − D p o s e ( M p o s e ) .
A gradient penalty with coefficient α = 10 is implemented in this branch. This coefficient is independent of the LoRA scaling coefficient. The reported configuration leaves the penalty inactive. The fake map given to a discriminator is resized to 512 × 512 and min–max normalized. Accordingly, the diffusion UNet is optimized as follows:
L U = L n o i s e + L G s h a p e + L G p o s e ,
L G s h a p e = − 1 | M ^ s h a p e | ∑ M ^ ∈ M ^ s h a p e D s h a p e ( M ^ ) ,
L G p o s e = − 1 | M ^ p o s e | ∑ M ^ ∈ M ^ p o s e D p o s e ( M ^ ) .
Through the adversarial minimax game, the diffusion UNet can gradually learn how to adapt the LoRA weights so that the cross-attention maps can be rectified to ideal shapes and poses. Compared with previous works [22] that also adopt adversarial supervision for diffusion models, the most noticeable difference is that our method does not rely on the noisy prediction z ^ 0 achieved from z ^ t , which results in two merits. First, the VAE decoder is not required for calculating discriminator prediction, thus being more efficient. Second, the input of discriminators are binary masks, which are much easier than RGB images, thus making them better functioning for producing guidance supervision for the diffusion UNet.

5. Experiments

5.1. Implementation Details

  • Dataset. The training set contains 176,092 images, assembled from Cosmic/CosmicMan, an Asian portrait collection, in-house images, and images gathered by image search. BLIP-2 [29] captions the retained images. One search batch keeps an image when its aesthetic score is above 5, its watermark score is below 3, and its similarity score is above 0.62. That batch contributes 29k images from Cosmic and 28k images from the existing collection. Face parsing then removes incomplete faces and half faces, discarding about 3k images. The retained search results are essentially real single-person portraits. A manual pass removes explicit content, watermarks, truncated bodies, blur, spliced images, and other low-quality frames, and a second pass removes small watermarks and white borders. These images are used to learn the shape and pose priors. Inference does not reload them. For the quantitative comparison, we follow HcP [12] and use the validation captions of HumanArt [30]. The qualitative study adds 50 prompts on which pretrained Stable Diffusion tends to deform the body. Training and sampling hyperparameters are given in Appendix A.

5.2. Quantitative Results

We first present quantitative evaluations in this part. FID [31] and KID [32] compare global image features. CLIP-Score measures prompt–image agreement. HPS-v2 [33] and PickScore [34] predict a general preference. None of these scores counts a missing limb, an extra limb, an abnormal joint, or a broken body proportion, so Table 1 is read as an image-level comparison. The table holds the SDXL backbone, the training images, and the sampler fixed. The LoRA row is trained on the same 176,092 images with the noise objective only. Our model is ahead of both the pretrained model and this LoRA baseline on every column. The LoRA baseline itself improves FID and CLIP-Score, leaves HPS unchanged, and is behind the pretrained model on KID and PickScore. The anatomical comparison is the paired generation protocol in the next subsection. Conditional methods such as ControlNet and HyperHuman take a spatial map at inference and answer a different problem. A public implementation of HcP that can be trained under this matched protocol is not available, so Section 2.1 compares it at the level of the training signal.
Table 1. Quantitative result with SDXL as the backbone. Downward arrows indicate that a smaller score is better, and upward arrows indicate that a larger score is better. The best score in each column is shown in bold.

5.3. Qualitative Results

We present several uncurated results for SDXL in Figure 4. For each prompt, three generation seeds are used, and the pretrained model, the LoRA baseline, and our model share the seed, the prompt, and the sampler. A difference inside one panel is therefore a difference of method under the same initial noise. The same protocol is used for SD1.5 in Figure 5. We read the panels with four visible failure modes. A missing limb is a body part required by the person and the action that is absent. An extra limb is a repeated arm, leg, hand, or head. An abnormal joint bends where there is no joint or in a direction the joint does not allow. A proportion error is a torso, limb, or head whose size disagrees with the rest of the body. Interestingly, we find that while the prompts are generally short and easy for a human to understand, they are especially hard for the pretrained SDXL to generate corresponding images. For example, when generating common actions such as sitting or jumping, which could be abundant in the pretraining dataset, the pretrained SDXL still cannot produce satisfactory results, leaving many artifacts such as unorganized body, redundant arms and hands, and improperly shaped limbs. When it comes to rare actions (e.g., doing yoga, dancing ballet) or rare combinations of actions and objects (e.g., holding a rifle), the deformity becomes more severe. As our baseline method, we find that finetuning SDXL on our dataset directly with LoRA does learn some information from the data, given that the finetuned model can generate much detailed background in many images. Unfortunately, this straightforward method has no positive effect and even makes it worse in many cases with regard to human body generation. For example, when generating according to the prompt ’a woman doing a yoga pose on a yoga mat’, the LoRA-finetuned SDXL can hardly generate a complete human body. This indicates that even if models with sufficient capacity (e.g., SDXL) can be finetuned with specific training data (e.g., high-quality human images), the problem of human body deformity can still not be solved. Compared with these methods, our method can guide the model to learn appropriate human body priors from the training data, resulting in much better human bodies. Meanwhile, our method does not require additional design for the network structure and input conditions, thus combining the best of both worlds.
Figure 4. Qualitative comparison with SDXL as backbone. Each comparison is controlled with the same random seed.
Figure 5. Qualitative comparison with SD1.5 as backbone. Each comparison is controlled with the same random seed.
To further show the generalization ability of our method, we apply it to pretrained SD1.5, whose results are presented in Figure 5. The results are consistent with those of SDXL. In general, since SD1.5 itself is worse than SDXL, the image quality among three methods lags behind images generated by SDXL in terms of the details. Nonetheless, our proposed method can still help the model fix the problem of human body deformity, leading to more reasonable human bodies under different kinds of prompts. These SD1.5 samples use the same prompts and the same shared seeds, so the scheme is assessed on a smaller backbone as well as on SDXL. The prompts mix ordinary actions, such as sitting and jumping, with less common actions, such as yoga and ballet, and with a less common pairing of an action and an object, holding a rifle. Further SDXL panels under the same protocol appear in the Appendix A. The captions used for Table 1 are the HumanArt validation captions, which are separate from the training images. Inference does not reload the training collection.

5.4. Ablation Study

To further verify the effectiveness of our proposed method, we conduct extensive ablation studies using SDXL as the backbone. Since the above adopted quantitative metrics cannot intuitively reflect the quality of generated human bodies, we only provide the qualitative results, with parts of them shown in the main paper. For more a comprehensive comparison, please refer to the Appendix B. Each variant below keeps the SDXL backbone and the prompt fixed and changes one ingredient: the binding terms, the assignment of shape and pose, or the adversarial stage. The generated body and the attention map record that change.
  • How can L b i n d help the model? We first test the efficacy of each item in L b i n d , as illustrated in Equation (7); the generated images together with the averaged cross-attention maps regarding human-related tokens are shown in Figure 6. Similarly to the results in Section 1, we can see that the pretrained SDXL cannot concentrate on the generated human body regarding the human-related tokens. In some cases (e.g., the second and fourth from the left), the model even highlights the background than the human bodies. Consequently, it cannot gather correct information, thus leading to deformed human bodies. Directly finetuning SDXL with LoRA also does not work, resulting in almost the same attention maps as the pretrained model. This indicates that the noise prediction loss L n o i s e cannot solely guide the cross-attention modules to function correctly; hence, leveraging the additional objectives is necessary. As for the three items proposed by us, the suppressing loss reduces background mass and leaves residual activation outside the body. Adding the margin loss, which enforces a gap of 0.1 between the inside peak and the outside peak, makes the body the main support of the map, at a smaller scale. Adding the pixel loss raises the response on the body toward the mask. The full binding objective is the variant in which the map both covers the body and responds strongly there. These conclusions are read from the images and the attention maps under a fixed backbone and prompt.
Figure 6. Ablation comparison among model variants using different objectives.
  • Effectiveness of the pose token. In Figure 7, we present three model variants regarding the learning strategy for human body priors: (1) OnlyShape: we only learn shape-related information with original human-related tokens in the prompts; (2) OnlyPose: similar to OnlyShape, with shape-related information replaced with pose-related information; and (3) Ours: our proposed strategy, as in Section 4.1, i.e., using an extra pose token to learn pose information. To make the results simple for understanding, we average attention activation among all human-related tokens and the pose token. Basically, solely learning shape-level information can help the model better concentrate on the human bodies. However, since pose information is not injected, the model cannot avoid the problem of abnormal poses, i.e., missing or additional limbs. On the other hand, it is also difficult for human-related tokens to learn pose information, considering the results that the attention maps can only concentrate on specific regions such as faces. Compared with these two variants, our proposed strategy can help the model leverage attention maps that truly highlight the reasonable human body regions, thus generating human body images with higher quality.
Figure 7. Ablation of how shape and pose are assigned. Columns compare OnlyShape, OnlyPose, and our dual-level tokens. Each column shows the generated image and the averaged cross-attention map.
  • Effectiveness of adversarial training. In Figure 8, we compare three model variants including pretrained SDXL; SDXL finetuned with only the semantic attention binding stage, as proposed in Section 4.1; and the model finetuned with both semantic attention binding and adversarial attention rectification. We find that the first stage can help the model generate better human bodies in some cases. For example, in the first column, while the pretrained SDXL generates an additional head, the one-stage model can revise this mistake. However, the human bodies generated by this one-stage model are often stilted, while also being prone to deformity, which shows its limited generalization ability due to fully supervised learning. In comparison, the model trained with both stages, as shown in the last row, can be generalized to different prompts, resulting in more appropriate human poses and shapes. This comparison keeps the backbone and the prompts fixed and changes only the presence of the adversarial stage. The prompts are those described above, covering ordinary actions and less common ones. Stage 1 removes errors such as the extra head and still leaves stiff bodies. The two-stage model is the variant in which the pose and the shape stay coherent. Occlusion enters the study as a failure of the automatic targets, illustrated in Figure 2c. The second stage treats the collection of masks as the real distribution, so the UNet is guided by that population of body configurations.
Figure 8. Ablation of adversarial training. From top to bottom: pretrained SDXL, binding only, and binding followed by adversarial rectification.

6. Discussion

The adaptation is complementary to scaling. Figure 2 shows that pretrained SDXL can place human-token attention on the background, and Figure 6 shows that a LoRA update with only the noise loss leaves maps of the same kind. The same binding and adversarial objectives improve both SD1.5 and SDXL. On SDXL, the gain is also visible in Table 1. On SD1.5, it is visible in the paired samples of Figure 5. The training cost is the two-stage schedule in Appendix A. At inference, the added computation is the UNet LoRA. The user does not supply a structural condition.
The seeds in Figure 4 and Figure 5 are shared generation seeds. Together with the matched training images, the shared sampler, and the repeated prompts on two backbones, they are the protocol used to read the comparison. Initialization, batch order, and the adversarial updates remain part of a fine-tuning run. The same dependence on initialization, data partitioning, and training configuration has been reported for automated fault detection of air-handling units, in a different application domain [35,36]. A multi-run mean would summarize that training variation. The present evidence is the controlled comparison above.
SAM and MMPose supply the masks used by both stages. Their characteristic errors are illustrated in Figure 2c. The outside mean, the peak-to-peak margin, and the pixel term all respond to the mask on the pixels it marks. The adversarial stage then uses the collection of masks as the real distribution, which is how the method reduces dependence on any single noisy target.
Table 1 measures the proposed objectives on a fixed text-to-image backbone. The LoRA baseline is trained on the same 176,092 images with the noise objective and without the binding losses or the adversarial stage. ControlNet and HyperHuman receive a spatial condition at sampling time and are discussed in Section 2.1 as conditional generators. HcP is discussed in the same section through its training signal: a pose branch added on top of the original attention, pose supervision, and fully supervised pairs. Our method suppresses background attention, binds shape and pose, and then matches the distribution of attention maps. The ablations supply the corresponding contrasts. The suppressing and margin terms move human-token mass onto the body. Shape-only supervision covers the silhouette and still shows missing or extra limbs. Pose supervision on the original human tokens concentrates on local regions such as the face. The separate pose token is the variant whose averaged map follows a coherent body. Figure 8 compares the binding stage with both stages on the same prompts, including sitting, jumping, yoga, ballet, and holding a rifle. Stage 1 can remove an extra head and still produces stiff bodies. The two-stage model keeps a coherent pose and shape on those prompts, and the same shared-seed protocol is repeated on SD1.5. The HumanArt validation captions used in the table are separate from the training images.
The support reported here for the adversarial stage is this paired comparison, together with the selected images and attention maps. A dedicated evaluation would extend the same question to three further settings: actions and articulations held out from the poses seen in training; cases in which the body is heavily occluded by an object or by another person; and configurations that vary body shape, age, viewpoint, and the number of people. Those settings measure the generalization claim more directly than the panels above, and they are the direction in which this study extends. The qualitative ablations are the evidence reported here for the contribution of each component. A quantitative comparison of the same variants on the reported metrics is left to follow-up work.

7. Conclusions

To address anatomical errors in text-to-image diffusion models arising from inadequate human shape and pose representations, we presented a dual-level prior injection method for improving human body generation. Our method associates shape priors with human-related tokens and pose priors with a learnable pose token through a two-stage bind-then-generalize strategy. Semantic attention binding suppresses background responses and aligns token attention with the corresponding human regions, while adversarial attention rectification learns shape and pose distributions beyond individual supervision targets. Paired qualitative comparisons on SD1.5 and SDXL show more coherent human bodies than the pretrained models and LoRA baselines trained on the same images. On SDXL, our method improves all five reported image-level metrics, reducing FID from 41.87 to 38.11 relative to the pretrained model. Qualitative ablations further support the contributions of the binding objectives, the separate pose token, and adversarial rectification.

Author Contributions

Conceptualization, Q.M., C.X., Z.L., and W.R.; methodology, Q.M., C.X., Z.L., and W.R.; software, Q.M., Z.L., X.W., and Q.Y.; validation, Q.M., C.X., Z.L., X.W., Q.Y., and Z.Y.; formal analysis, Q.M., Z.L., X.W., and W.R.; investigation, Q.M., Z.L., X.W., Q.Y., and Z.Y.; resources, C.X., Q.Y., Y.Y., Z.Y., and W.R.; data curation, Q.M., Z.L., X.W., Q.Y., and Z.Y.; writing—original draft preparation, Q.M. and Z.L.; writing—review and editing, Q.M., C.X., Z.L., X.W., Y.Y., Z.Y., and W.R.; visualization, Q.M., Z.L., X.W., and Q.Y.; supervision, C.X., Y.Y., and W.R.; project administration, C.X., Y.Y., Z.Y., and W.R.; funding acquisition, C.X., Y.Y., and W.R. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China (No. 62666069), Natural Science Foundation of Shandong Province (No. ZR2023MF037), and Scientific Research Project Funded by the University (2020RCYJ19).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The 176,092 training images are constructed as described in Section 5 from Cosmic/CosmicMan, Asian portrait data, in-house images, and image-search results. They are not the LAION-Aesthetic release. HumanArt supplies the validation captions used in the quantitative protocol. The source code will be released upon publication. Pretrained weights were taken from public repositories: Stable Diffusion v1.5 (https://huggingface.co/runwayml/stable-diffusion-v1-5, accessed on 1 March 2025), Stable Diffusion XL 1.0 (https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0, accessed on 1 March 2025), and CLIP (https://github.com/openai/CLIP, accessed on 1 March 2025). SAM (https://github.com/facebookresearch/segment-anything, accessed on 1 March 2025) and MMPose (https://github.com/open-mmlab/mmpose, accessed on 1 March 2025) were used only to construct the training masks.

Acknowledgments

During the preparation of this manuscript, the authors used ChatGPT (OpenAI, https://chatgpt.com, accessed on 1 September 2026) for language editing and grammatical refinement. The authors have reviewed and edited the output and take full responsibility for the content of this publication.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Training Details

Experiments use pretrained SD1.5 and SDXL. LoRA of rank 16 and scaling coefficient 16 is attached to the query, key, value, and output projections of the UNet attention layers in the down, mid, and up blocks. The text encoder is frozen, and the additional key projection used by SDXL for pooled text is not adapted. The pose-token embedding is trained with the LoRA weights. We use AdamW with learning rate 5 × 10 − 6 for 10,000 iterations in each stage, on 16 V100 GPUs with batch size 4 on each GPU. This schedule takes about two days. SNR weighting is off, and the noise offset is 0. The objective is Equation (8), with token weight 0.005 , pixel weight 0.2 , and margin δ = 0.1 . Stage 2 is initialized from the Stage-1 model.
Cross-attention probabilities are read from the UNet. Heads of a layer are averaged, and maps are grouped by block and by resolutions 8, 16, 32, and 64. The token loss averages target tokens and sums layers inside a group. The pixel loss averages layers inside a group, sums target tokens, and averages the binary cross-entropy at the native resolution with the cross-entropy after upsampling. The mask target of the pixel loss is mapped by ( M + 1 ) / 2 . Body and pose terms inside a group are averaged before the groups are added. Figure averages are for display only.
The discriminator is an 11-layer convolutional network with patch-level outputs. Dropout and random flipping of real and fake labels keep it from dominating the UNet. Its fake input is resized to 512 × 512 and min–max normalized. A gradient penalty with coefficient 10 is implemented and is left inactive in the reported runs. Sampling uses the Euler discrete scheduler for 20 steps, classifier-free guidance scale 7.5 , FP16, and resolution 1024 × 1024 , with the negative prompt “low quality, worst quality, deformed.” The pretrained model, the LoRA baseline, and our model share this sampler. SAM, MMPose, and the discriminators are used only while learning the priors.

Appendix B. More Qualitative Results

Additional qualitative comparisons are shown in Figure A1 and Figure A2.
Figure A1. Additional SDXL comparisons, set 1. In each group, pretrained SDXL, naive LoRA, and our method are shown from top to bottom.
Figure A2. Additional SDXL comparisons, set 2. In each group, pretrained SDXL, naive LoRA, and our method are shown from top to bottom.

References

  1. Leszczuk, M.; Zhang, Y.; Farias, M.C.; Chandler, D.M.; Kalola, R. AI-Driven Image Generation: Algorithms, Architectures, Quality Assessment, and Applications—A Structured Narrative Review. Electronics 2026, 15, 2891. [Google Scholar] [CrossRef] [Scilit]
  2. Zhu, J.; Yang, H.; Li, M.; Yang, Z.; Guo, Y. HiPA-Gen: Hierarchical Interaction Perception and Alignment for High-Fidelity Pose-Guided Human Generation. Electronics 2026, 15, 3851. [Google Scholar] [CrossRef] [Scilit]
  3. Alhejaili, A.; Binsawad, M. Explainable Spatio-Temporal Attention Framework for GAN-Based Deepfake Detection. Electronics 2026, 15, 4343. [Google Scholar] [CrossRef] [Scilit]
  4. D’Ercole, A.; Me, G. A novel approach to company bankruptcy prediction using convolutional neural networks and generative adversarial networks. Mach. Learn. Knowl. Extr. 2025, 7, 63. [Google Scholar] [CrossRef] [Scilit]
  5. Al-kharsan, H.A.; Rajkó, R. Diffusion-Based Feature Denoising and Using NNMF for Robust Brain Tumor Classification. Mach. Learn. Knowl. Extr. 2026, 8, 105. [Google Scholar] [CrossRef] [Scilit]
  6. Huang, S.; Tian, L.; Zhang, Y. Residual Conditional Diffusion with Transformer Refinement for Unsupervised Infrared–Visible Image Fusion. Electronics 2026, 15, 3449. [Google Scholar] [CrossRef] [Scilit]
  7. Le Roux, R.; Khaksar, S.; Sepehri, M.; Murray, I. HEADHUNTER: Training-Free Annotated Dataset Synthesis via Self-Guided Diffusion Transformer Attention Head Selection. Mach. Learn. Knowl. Extr. 2026, 8, 230. [Google Scholar] [CrossRef] [Scilit]
  8. Ren, M.; Leong, W.Y. Interaction-Specific Diffusion Scheduling Guided by Temporal Priors for Sequential Recommendation. Electronics 2026, 15, 4389. [Google Scholar] [CrossRef] [Scilit]
  9. Wang, C.; Shi, Z.; Chen, L. Stage-Aware Robust Multimodal Prior Guidance for Diffusion-Based Image Super-Resolution. Electronics 2026, 15, 3059. [Google Scholar] [CrossRef] [Scilit]
  10. Rombach, R.; Blattmann, A.; Lorenz, D.; Esser, P.; Ommer, B. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 19–24 June 2022; pp. 10684–10695. [Google Scholar]
  11. Esser, P.; Kulal, S.; Blattmann, A.; Entezari, R.; Müller, J.; Saini, H.; Levi, Y.; Lorenz, D.; Sauer, A.; Boesel, F.; et al. Scaling rectified flow transformers for high-resolution image synthesis. In Proceedings of the Forty-First International Conference on Machine Learning, Vienna, Austria, 21–27 July 2024. [Google Scholar]
  12. Wang, J.; Sun, Z.; Tan, Z.; Chen, X.; Chen, W.; Li, H.; Zhang, C.; Song, Y. Towards Effective Usage of Human-Centric Priors in Diffusion Models for Text-based Human Image Generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 17–21 June 2024; pp. 8446–8455. [Google Scholar]
  13. Liu, X.; Ren, J.; Siarohin, A.; Skorokhodov, I.; Li, Y.; Lin, D.; Liu, X.; Liu, Z.; Tulyakov, S. Hyperhuman: Hyper-realistic human generation with latent structural diffusion. In Proceedings of the International Conference on Learning Representations, Vienna, Austria, 7–11 May 2024; Volume 2024, pp. 7184–7217. [Google Scholar]
  14. Kirillov, A.; Mintun, E.; Ravi, N.; Mao, H.; Rolland, C.; Gustafson, L.; Xiao, T.; Whitehead, S.; Berg, A.C.; Lo, W.Y.; et al. Segment anything. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Paris, France, 2–6 October 2023; pp. 4015–4026. [Google Scholar]
  15. Yuan, Y.; Fu, R.; Huang, L.; Lin, W.; Zhang, C.; Chen, X.; Wang, J. Hrformer: High-resolution vision transformer for dense predict. In Proceedings of the Advances in Neural Information Processing Systems 34 (NeurIPS 2021), Online, 6–14 December 2021; pp. 7281–7293. [Google Scholar]
  16. Zhang, L.; Rao, A.; Agrawala, M. Adding conditional control to text-to-image diffusion models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Paris, France, 2–6 October 2023; pp. 3836–3847. [Google Scholar]
  17. Huang, Z.; Fan, H.; Wang, L.; Sheng, L. From Parts to Whole: A Unified Reference Framework for Controllable Human Image Generation. arXiv 2024, arXiv:2404.15267. [Google Scholar]
  18. Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative adversarial networks. Commun. ACM 2020, 63, 139–144. [Google Scholar] [CrossRef] [Scilit]
  19. Xiao, Z.; Kreis, K.; Vahdat, A. Tackling the Generative Learning Trilemma with Denoising Diffusion GANs. In Proceedings of the International Conference on Learning Representations, Online, 25–29 April 2022. [Google Scholar]
  20. Xu, Y.; Zhao, Y.; Xiao, Z.; Hou, T. Ufogen: You forward once large scale text-to-image generation via diffusion gans. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 17–21 June 2024; pp. 8196–8206. [Google Scholar]
  21. Sauer, A.; Lorenz, D.; Blattmann, A.; Rombach, R. Adversarial diffusion distillation. In Proceedings of the European Conference on Computer Vision; Springer: Cham, Switzerland, 2024; pp. 87–103. [Google Scholar]
  22. Li, Y.; Keuper, M.; Zhang, D.; Khoreva, A. Adversarial supervision makes layout-to-image diffusion models thrive. In Proceedings of the Twelfth International Conference on Learning Representations, Vienna, Austria, 7–11 May 2024. [Google Scholar]
  23. Yang, L.; Qian, H.; Zhang, Z.; Liu, J.; Cui, B. Structure-Guided Adversarial Training of Diffusion Models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 17–21 June 2024; pp. 7256–7266. [Google Scholar]
  24. Van Den Oord, A.; Vinyals, O. Neural discrete representation learning. In Proceedings of the Advances in Neural Information Processing Systems 30 (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017; Volume 30. [Google Scholar]
  25. Wang, Z.; Sha, Z.; Ding, Z.; Wang, Y.; Tu, Z. TokenCompose: Text-to-Image Diffusion with Token-level Supervision. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 17–21 June 2024; pp. 8553–8564. [Google Scholar]
  26. Contributors, M. OpenMMLab Pose Estimation Toolbox and Benchmark. Available online: https://github.com/open-mmlab/mmpose (accessed on 1 March 2025).
  27. Hu, E.J.; Shen, Y.; Wallis, P.; Allen-Zhu, Z.; Li, Y.; Wang, S.; Wang, L.; Chen, W. LoRA: Low-Rank Adaptation of Large Language Models. In Proceedings of the International Conference on Learning Representations, Online, 25–29 April 2022. [Google Scholar]
  28. Gulrajani, I.; Ahmed, F.; Arjovsky, M.; Dumoulin, V.; Courville, A.C. Improved training of wasserstein gans. In Proceedings of the Advances in Neural Information Processing Systems 30 (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017; Volume 30. [Google Scholar]
  29. Li, J.; Li, D.; Savarese, S.; Hoi, S. Blip-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. In Proceedings of the International Conference on Machine Learning (PMLR), Honolulu, HI, USA, 23–29 July 2023; pp. 19730–19742. [Google Scholar]
  30. Ju, X.; Zeng, A.; Wang, J.; Xu, Q.; Zhang, L. Human-art: A versatile human-centric dataset bridging natural and artificial scenes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 18–22 June 2023; pp. 618–629. [Google Scholar]
  31. Heusel, M.; Ramsauer, H.; Unterthiner, T.; Nessler, B.; Hochreiter, S. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Proceedings of the Advances in Neural Information Processing Systems 30 (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017; Volume 30. [Google Scholar]
  32. Bińkowski, M.; Sutherland, D.J.; Arbel, M.; Gretton, A. Demystifying MMD GANs. In Proceedings of the International Conference on Learning Representations, Vancouver, BC, Canada, 30 April–3 May 2018. [Google Scholar]
  33. Wu, X.; Hao, Y.; Sun, K.; Chen, Y.; Zhu, F.; Zhao, R.; Li, H. Human preference score v2: A solid benchmark for evaluating human preferences of text-to-image synthesis. arXiv 2023, arXiv:2306.09341. [Google Scholar]
  34. Kirstain, Y.; Polyak, A.; Singer, U.; Matiana, S.; Penna, J.; Levy, O. Pick-a-pic: An open dataset of user preferences for text-to-image generation. In Proceedings of the Advances in Neural Information Processing Systems 36 (NeurIPS 2023), New Orleans, LA, USA, 10–16 December 2023; Volume 36, pp. 36652–36663. [Google Scholar]
  35. Wang, S. Automated fault detection and diagnosis of ahus via tabular-based methods using operational data from a large office building. J. Comput. Civ. Eng. 2026, 40, 04026018. [Google Scholar] [CrossRef] [Scilit]
  36. Wang, S. Fault-class coverage–aligned combined training for AFDD of AHUs across multiple buildings. Sci. Rep. 2025, 15, 41192. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.