HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

KV-Edit: Training-Free Image Editing for Precise Background Preservation

Tianrui Zhu Shiyi Zhang Jiawei Shao Yansong Tang

KV-Edit: Training-Free Image Editing for Precise Background Preservation

Abstract

Background consistency remains a significant challenge in image editingtasks. Despite extensive developments, existing works still face a trade-offbetween maintaining similarity to the original image and generating contentthat aligns with the target. Here, we propose KV-Edit, a training-free approachthat uses KV cache in DiTs to maintain background consistency, where backgroundtokens are preserved rather than regenerated, eliminating the need for complexmechanisms or expensive training, ultimately generating new content thatseamlessly integrates with the background within user-provided regions. Wefurther explore the memory consumption of the KV cache during editing andoptimize the space complexity to O(1) using an inversion-free method. Ourapproach is compatible with any DiT-based generative model without additionaltraining. Experiments demonstrate that KV-Edit significantly outperformsexisting approaches in terms of both background and image quality, evensurpassing training-based methods. Project webpage is available athttps://xilluill.github.io/projectpages/KV-Edit

Code Repositories

Xilluill/KV-Edit
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
text-based-image-editing-on-pie-benchKV-Edit
Background LPIPS: 9.92
Background PSNR: 35.87
CLIPSIM: 25.63
Structure Distance: 1.98

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
KV-Edit: Training-Free Image Editing for Precise Background Preservation | Papers | HyperAI