In-context Region-based Drag: Drag Any Region to Any Shape
Abstract
Diffusion models have shown promise in drag-style editing.Previous works mainly focus on point-based drag, which is inherentlyambiguous. This paper focuses on region-based drag and introduces anovel In-Context Region-based Drag (ICRDrag) method. Under the in-context learning framework, ICRDrag consumes a source image, a sourceregion mask, and a target region mask, producing the target draggedimage. Built upon the basic in-context learning model, we introduce twonovel attention regularization: 1) image-mask attention consistency toensure that a target region attends to similar source regions for image andmask modalities; 2) source-target attention correspondence to ensure themutual correspondence between source and target regions. To facilitateregion-based drag, we also construct Paired Region Dataset (PRD), alarge-scale dataset with paired masks and images. Extensive experimentsshow that ICRDrag significantly outperforms existing methods in bothquantitative metrics and user studies, achieving superior editing accuracyand visual fidelity. The dataset, code, and model are available at https://github.com/bcmi/ICRDrag-Region-Drag-Editing.