GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - greson719/Leffa_model

BranchesTags
Open more actions menu

Latest commit

 

History

78 Commits
78 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
3rdparty
3rdparty
 
 
leffa
leffa
 
 
leffa_utils
leffa_utils
 
 
preprocess
preprocess
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SCHP
SCHP
 
 
app.py
app.py
 
 
densepose
densepose
 
 
detectron2
detectron2
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

Leffa: Learning Flow Fields in Attention for Controllable Person Image Generation

📚 Paper - 🤖 Code - 🔥 Demo - 🤗 Model

Star ⭐ us if you like it!

News

  • 09/Jan/2025. Inference defaults to float16, generating an image in 6 seconds (on A100).
  • 02/Jan/2025. Update the mask generator to improve results. Add ref unet acceleration, boosting prediction speed by 30%. Include more controls in Advanced Options to enhance user experience. Enable intermediate result output for easier development. Enjoy using it!
  • 18/Dec/2024. Thanks to @StartHua for integrating Leffa into ComfyUI! Here is the repo!
  • 16/Dec/2024. The virtual try-on model trained on DressCode is released.
  • 12/Dec/2024. The HuggingFace demo and models (virtual try-on model trained on VITON-HD and pose transfer model trained on DeepFashion) are released.
  • 11/Dec/2024. The arXiv version of the paper is released.

Leffa is a unified framework for controllable person image generation that enables precise manipulation of both appearance (i.e., virtual try-on) and pose (i.e., pose transfer).

Abstract

Controllable person image generation aims to generate a person image conditioned on reference images, allowing precise control over the person’s appearance or pose. However, prior methods often distort fine-grained textural details from the reference image, despite achieving high overall image quality. We attribute these distortions to inadequate attention to corresponding regions in the reference image. To address this, we thereby propose learning flow fields in attention (Leffa), which explicitly guides the target query to attend to the correct reference key in the attention layer during training. Specifically, it is realized via a regularization loss on top of the attention map within a diffusion-based baseline. Our extensive experiments show that Leffa achieves state-of-the-art performance in controlling appearance (virtual try-on) and pose (pose transfer), significantly reducing fine-grained detail distortion while maintaining high image quality. Additionally, we show that our loss is model-agnostic and can be used to improve the performance of other diffusion models.

Method

An overview of our Leffa training pipeline for controllable person image generation. The left is our diffusion-based baseline; the right is our Leffa loss. Note that Isrc and Itgt are the same image during training.

Visualization

Qualitative visual results comparison with other methods. The input person image for the pose transfer is generated using our method in the virtual try-on. The visualization results demonstrate that our method not only generates high-quality images but also greatly reduces the distortion of fine-grained details.

Installation

Create a conda environment and install requirements:

conda create -n leffa python==3.10
conda activate leffa
cd Leffa
pip install -r requirements.txt

Gradio App

Run locally:

python app.py

Evaluation

We use this code for metric evaluation.

Star History

Star History Chart

Acknowledgement

Our code is based on Diffusers and Transformers. We use SCHP and DensePose to generate masks and densepose in our Demo. We also referred to the code of IDM-VTON and CatVTON.

Citation

If you find our work helpful or inspiring, please feel free to cite it.

@article{zhou2024learning,
  title={Learning Flow Fields in Attention for Controllable Person Image Generation}, 
  author={Zhou, Zijian and Liu, Shikun and Han, Xiao and Liu, Haozhe and Ng, Kam Woh and Xie, Tian and Cong, Yuren and Li, Hang and Xu, Mengmeng and Pérez-Rúa, Juan-Manuel and Patel, Aditya and Xiang, Tao and Shi, Miaojing and He, Sen},
  journal={arXiv preprint arXiv:2412.08486},
  year={2024},
}

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.