Leffa: Controllable Person Image Generation with Flow Fields in Attention
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
Leffa is a unified framework for controllable person image generation, enabling precise manipulation of appearance through virtual try-on and pose via pose transfer. This project addresses the common issue of fine-grained textural detail distortion by learning flow fields in attention, guiding target queries to correct reference keys. It achieves state-of-the-art performance, maintaining high image quality while significantly reducing detail distortion.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
Leffa (Learning Flow Fields in Attention) is a cutting-edge, unified framework designed for controllable person image generation. Accepted to CVPR 2025, Leffa enables precise manipulation of both appearance, through virtual try-on, and pose, via pose transfer. Traditional methods often struggle with distorting fine-grained textural details from reference images, despite achieving high overall image quality. Leffa tackles this by explicitly guiding the target query to attend to the correct reference key within the attention layer during training, using a regularization loss on top of the attention map. This innovative approach significantly reduces fine-grained detail distortion while maintaining exceptional image quality.
Installation
To get started with Leffa, follow these steps to set up your environment:
conda create -n leffa python==3.10
conda activate leffa
cd Leffa
pip install -r requirements.txt
Examples
Leffa offers robust capabilities for both virtual try-on and pose transfer. The project includes a Gradio application for easy local execution and demonstration. You can also explore the official HuggingFace demo for interactive use. The visualization below showcases Leffa's ability to generate high-quality images with greatly reduced distortion of fine-grained details compared to other methods.
To run the Gradio app locally:
python app.py
Why Use Leffa?
Leffa stands out as a powerful tool for person image generation due to several key advantages:
- State-of-the-Art Performance: Achieves superior results in both virtual try-on and pose transfer tasks.
- Reduced Detail Distortion: Its unique "flow fields in attention" mechanism effectively preserves fine-grained textural details from reference images.
- Unified Framework: Provides a single, cohesive solution for two major controllable person image generation tasks.
- Model-Agnostic Loss: The proposed regularization loss can be applied to improve other diffusion models, showcasing its versatility.
- Active Development: Regularly updated with performance improvements and new features, as seen in the project's news section.
Links
- GitHub Repository: Leffa
- Paper: Learning Flow Fields in Attention for Controllable Person Image Generation
- HuggingFace Demo: Leffa Demo
- HuggingFace Models: Leffa Models
Related repositories
Similar repositories that may be relevant next.

Agent Sandbox: Secure Local Development for AI Coding Agents
August 17, 2026
Agent Sandbox provides a robust and secure local development environment specifically designed for collaborating with AI coding agents. It ensures minimal filesystem access, configurable network egress policies, and secure secret injection, protecting your local machine from potentially risky agent operations. This project supports various AI agents and integrates seamlessly with both CLI and popular IDE devcontainer setups.

AMD Skills: Empowering AI Agents with AMD's Optimized Software Stack
August 16, 2026
AMD Skills is the official catalog of AI agent skills from AMD, designed to empower AI agents with optimized software for AMD hardware. This repository provides knowledge, scripts, and conventions for working with AMD's stack, enabling seamless integration with major coding agents like Cursor, Claude Code, OpenAI Codex, and Gemini CLI.

agent-tackle-box: A Terminal Debugger for LangGraph & LangChain Agents
August 15, 2026
agent-tackle-box is a comprehensive toolkit for developing AI agents, featuring the powerful `agent-debugger`. This terminal debugger provides deep insights into LangGraph and LangChain agents. It allows developers to inspect state, monitor tool calls, and step through Python code, all within a unified Textual UI.

ADR: Uber's Enterprise Security System for AI Agents
August 14, 2026
ADR (Agentic AI Detection and Response) is an enterprise security system developed by Uber to secure AI agents. It offers critical capabilities like observability, security benchmarking, and threat detection, ensuring the safe operation of both employee and customer-facing AI applications. This open-source project is deployed in production at Uber and was accepted to MLSys 2026.
Source repository
Open the original repository on GitHub.
9 counted GitHub visits