metadata
license: mit
library_name: diffusers
pipeline_tag: image-to-image
tags:
- image-generation
- person-image-generation
- virtual-try-on
- pose-transfer
- diffusion-model
Leffa: Learning Flow Fields in Attention for Controllable Person Image Generation
This model, presented in Learning Flow Fields in Attention for Controllable Person Image Generation, is a diffusion-based model for controllable person image generation. It allows for precise manipulation of both appearance (virtual try-on) and pose (pose transfer) while minimizing distortion of fine-grained details.
๐ Paper - ๐ค Code - ๐ฅ Demo - ๐ค Model
How to use
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
pipe = StableDiffusionPipeline.from_pretrained("franciszzj/Leffa", torch_dtype=torch.float16)
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")
# Example usage for virtual try-on (replace with your image paths)
image = Image.open("person_image.png")
prompt = "a person wearing a red dress"
image = pipe(prompt=prompt, image=image).images[0]
image.save("output.png")
Further Details
(The rest of the original README content can be retained here, potentially reorganized for better clarity and flow. Sections that are currently placeholders should be filled with details from the paper or other relevant sources.)