Abstract: We present ESP, a novel method for context-aware full-body generation, that enables photo-realistic synthesis and inpainting of people wearing clothing that is semantically appropriate for the scene depicted in an input photograph. ESP is conditioned on a 2D pose and contextual cues that are extracted from the photograph of the scene and integrated into the generation process, where the clothing is modeled explicitly with human parsing masks (HPM). Generated HPMs are used as tight guiding masks for inpainting, such that no changes are made to the original background. Our models are trained on a dataset containing a set of in-the-wild photographs of people covering a wide range of different environments. The method is analyzed quantitatively and qualitatively, and we show that ESP outperforms the state-of-the-art on the task of contextual full-body generation.
Introduction
While modern generative AI can produce remarkably realistic human imagery, most existing models suffer from a pervasive "studio bias." Models like StyleGAN-Human are typically trained on curated fashion datasets with neutral backgrounds, often resulting in generated subjects that appear out of place when inserted into complex, real-world environments. Conversely, while text-to-image models like Stable Diffusion can generate context-appropriate attire, they require intensive manual prompt engineering to achieve specific results.
ESP (Environment-Specific People) addresses these challenges by introducing a generative pipeline that automatically inpaints realistic humans into photographs with clothing that matches the scene's context—such as placing a skier in a mountain range or a footballer on a pitch—without requiring manual text prompts. By bridging the gap between visual environmental cues and semantic clothing choices, ESP achieves state-of-the-art results in automated, context-aware human synthesis.
Methodology
The ESP architecture utilizes a three-stage pipeline that replaces text prompts with visual "contextual-style vectors" to drive the generation process.
- Context Embedding: A Variational Autoencoder (VAE) encodes the background of an input image into a compact latent vector. This vector captures the essential "vibe" of the scene, including lighting, color palettes, and environment type.
- Context-Aware HPM Generation: A StyleGAN-II generator is conditioned on both a 2D pose skeleton and the context vector. Instead of a final image, it produces a Human Parsing Map (HPM)—a semantic map labeling body parts and clothing items (e.g., "hat," "torso," "legs"). This allows the model to "decide" on appropriate gear, such as a helmet for a cyclist, based on the background.
- Inpainting and Super-Resolution: The generated HPM serves as a tight semantic guide for a pre-trained Stable Diffusion model equipped with ControlNet. This ensures the final textures and fabrics match the planned clothing while preserving the original background entirely.
Datasets and Training
The models were trained on a refined version of the Annotated Human Parsing (AHP) dataset. While the original AHP contains approximately 56,000 images from sources like COCO and Objects365, the authors filtered this to a high-quality subset of ~23,000 "in-the-wild" images. This refinement process involved removing samples with low resolution, mismatched masks, or disconnected body parts to ensure the model learned clean, accurate relationships between specific environments and appropriate outfits.
Results and Discussion
ESP was evaluated against several state-of-the-art baselines, including StyleGAN-Human and vanilla ControlNet/Stable Diffusion.
Quantitative Performance: ESP significantly outperformed competitors in Fréchet Inception Distance (FID) and Kernel Inception Distance (KID). Notably, ESP achieved an FID of 19.8, a substantial improvement over the baseline's 86.7 at equivalent control strengths.
Qualitative Analysis: In user studies, ESP was preferred 62% of the time over other state-of-the-art methods. The results demonstrate superior "color harmonization," where generated subjects appear naturally integrated into the specific lighting and atmosphere of the input scene. A key insight of the work is the use of the HPM as a semantic bridge, which decouples the high-level decision of what to wear from the low-level rendering of how the fabric appears.
Conclusion
ESP demonstrates that environmental pixels contain sufficient information to drive automated clothing synthesis, reducing reliance on natural language prompts. While the model currently faces constraints with highly complex or occluded poses and inherits certain dataset biases, it represents a significant step forward in realistic, context-aware human generation. Future work will focus on diversifying training data and improving the underlying resolution capabilities of the diffusion stage.
Summary updated