Source-linked AI summary

LightningDrag: Lightning Fast and Accurate Drag-based Image Editing Emerging from Videos

Yujun Shi, Jun Hao Liew, Hanshu Yan, Vincent Y. F. Tan, Jiashi Feng

arXiv:2405.13722v2cs.CV

TL;DR

Drag-based image editing is hindered by slow inference and low success rates. LightningDrag reframes editing as conditional generation and trains on large-scale paired video frames, achieving high-quality editing in about 1 second with improved accuracy and consistency. Its main scope boundary is inherited from Stable Diffusion V1.5, which can produce inadequate detail in small complex regions.

  • Problem

    Existing drag-based editing methods often require more than 1 minute per edit and struggle to move semantic content accurately while preserving source-image appearance and identity.

    Source: §1 · p. 2
  • Method

    LightningDrag conditions generation on the source image and drag instruction while learning supervision from large-scale paired video frames.

    Source: §1 · p. 2
  • Results

    LightningDrag achieves high-quality drag-based editing in about 1 second and outperforms prior methods in speed, accuracy, consistency, and qualitative preservation of source appearance.

    Source: §5.2 · p. 7, §6 · p. 8, §5.3 · p. 8
  • Takeaways & Limitations

    Video motion provides rich supervision for fast and accurate drag-based editing, including generalization to local deformations absent from training videos.

    Source: §1 · p. 2, §6 · p. 8

    Because LightningDrag is built on Stable Diffusion V1.5, it can produce inadequate detail in small regions such as complex hands and faces.

    Source: §6 · p. 8

Abstract

from arXiv · show

Accuracy and speed are critical in image editing tasks. Pan et al. introduced a drag-based image editing framework that achieves pixel-level control using Generative Adversarial Networks (GANs). A flurry of subsequent studies enhanced this framework's generality by leveraging large-scale diffusion models. However, these methods often suffer from inordinately long processing times (exceeding 1 minute per edit) and low success rates. Addressing these issues head on, we present LightningDrag, a rapid approach enabling high quality drag-based image editing in ~1 second. Unlike most previous methods, we redefine drag-based editing as a conditional generation task, eliminating the need for time-consuming latent optimization or gradient-based guidance during inference. In addition, the design of our pipeline allows us to train our model on large-scale paired video frames, which contain rich motion information such as object translations, changing poses and orientations, zooming in and out, etc. By learning from videos, our approach can significantly outperform previous methods in terms of accuracy and consistency. Despite being trained solely on videos, our model generalizes well to perform local shape deformations not presented in the training data (e.g., lengthening of hair, twisting rainbows, etc.). Extensive qualitative and quantitative evaluations on benchmark datasets corroborate the superiority of our approach. The code and model will be released at https://github.com/magic-research/LightningDrag.

1. Introduction

LightningDrag addresses the inefficiency and low success rates of drag-based editing by reframing it as conditional generation and learning from paired video frames. It delivers high-quality edits in less than 1 second while improving accuracy, consistency, and generalization.

1. Introduction

  • Conditional generation uses the source image and drag instruction as conditions, eliminating latent optimization and repeated gradient computation during inference.Reference-only processing supports identity preservation, while point embeddings inject handle and target information into self-attention.Source: §1 · p. 2
  • Paired video frames provide motion cues for object translation, pose and orientation changes, zooming, and deformation while avoiding appearance changes.The collected supervision pairs are derived from video motion that captures how objects change.Source: §1 · p. 2, Figure 2 · p. 3
  • Video-trained LightningDrag generalizes to out-of-domain local deformations such as lengthening hair and twisting rainbows.The authors report this generalization despite such transformations not being explicitly present in the video motions.Source: §1 · p. 2
  • Less than 1 second of latency makes LightningDrag substantially more practical than prior drag-based editing methods.The approach is designed for high-quality editing across diverse image categories and styles.Source: §1 · p. 2
  • Point augmentation and sequential dragging are test-time strategies for further refining drag-based editing results.Source: §1 · p. 3

2. Related Works

Prior point-based editing methods provide precise spatial control but remain constrained by GAN capacity or expensive diffusion inference. LightningDrag instead trains a fast conditional generation pipeline on large-scale video data for general drag-based editing.

Point-based image editing

  • Point-based editing targets pixel-level manipulation, but GAN-based methods face capacity and real-image inversion limits.Pan et al. [44] introduced interactive point-based editing by optimizing GAN latent codes.Source: §2 · p. 3
  • Most diffusion-based drag-editing methods remain impractical because latent optimization or gradient-based guidance requires repeated computation.Nie et al. [43] avoids diffusion-latent gradients but still requires repeated denoising operations.Source: §2 · p. 3
  • Existing generation-based approaches reduce latency but focus narrowly on articulated objects or single human images with clothes, unlike LightningDrag’s general-image scope.Li et al. [29] model part-level articulated-object movements, while Chen et al. [8] focuses on single human images with clothes.Source: §2 · p. 3

Learning image editing from videos

  • LightningDrag trains a conditional generation pipeline on large-scale video data, distinguishing it from prior video-assisted methods that use limited supervision or retain gradient-based guidance.Luo et al. [36] use around 100 supervision pairs and still rely on time-consuming gradient-based guidance.Source: §2 · p. 3

3. Preliminaries

Latent diffusion models encode images into a lower-dimensional VAE latent space and model a noisy latent Markov process. LightningDrag builds its pipeline on a publicly available Stable Diffusion model.

3.1. Latent Diffusion Models

  • Latent diffusion first maps an image x0 into a lower-dimensional latent z0 through a variational auto-encoder.The encoding is written as z0 = E(x0).Source: §3.1 · p. 4
  • The diffusion model approximates the latent data distribution as the marginal pθ(z0) of a joint process involving z1:T.The terminal latent pθ(zT) is standard normal, and reverse transitions are Gaussian conditioned on the current latent.Source: §3.1 · p. 4
  • The forward noising process uses Gaussian noise ϵ ∼ N(0, I) and the cumulative noise coefficient ᾱt.Source: §3.1 · p. 4
  • LightningDrag develops its proposed editing pipeline on the publicly released Stable Diffusion model.Source: §3.1 · p. 4

4. Methodology

The methodology section organizes LightningDrag around video-derived supervision, model architecture, inference-time improvements, and user-facing strategies for correcting failure cases.

4. Methodology

  • LightningDrag constructs training supervision pairs from videos before specifying the model architecture and inference procedures.Source: §4 · p. 4
  • The methodology includes test-time techniques intended to improve editing results.Source: §4 · p. 4
  • The section also presents user strategies for fixing failure cases after generation.Source: §4 · p. 4

4.1. Paired supervision from video data

LightningDrag constructs paired supervision from video frames, using motion to represent drag-relevant transformations and identify corresponding edit points and regions.

  • Video motion naturally captures drag-relevant transformations, including zooming, pose changes, orientation changes, and object deformation.Source: §4.1 · p. 4
  • Static-camera videos provide source and target frames in which local motion simulates drag-based editing while other regions remain static.Source: §4.1 · p. 4
  • Handle points are sampled from strong optical flow, and CoTracker2 [22] tracks their corresponding target points across frames.Source: §4.1 · p. 4
  • Each training sample combines source and target images, handle and target points, and a binary mask identifying motion regions to edit.Source: §4.1 · p. 4

4.2. Architecture Design

LightningDrag formulates drag editing as conditional generation, combining inpainting, appearance preservation, and point-conditioned attention to preserve identity and follow user instructions.

4.2. Architecture Design

  • The architecture enforces untouched unmasked regions, preserves source-image identity, and moves handle-point content toward target coordinates.Source: §4.2 · p. 4

4.2.1 Inpainting Backbone.

  • The Stable Diffusion Inpainting U-Net receives noise latents, a binary mask, and masked source-image latents as its inputs.Source: §4.2.1 · p. 4
  • Source-image features replace text prompting through IP-Adapter [64], avoiding a redundant and difficult user-provided text prompt.Source: §4.2.1 · p. 4

4.2.2 Appearance Encoder.

  • The Appearance Encoder uses clean reference latents to extract self-attention features once, improving inference efficiency while preserving fine-grained reference details.Source: §4.2.2 · pp. 4–5

4.2.3 Point Embedding Attention.

  • Handle and target points become same-resolution maps, with each pair assigned an integer identifier and all other pixels set to zero.Source: §4.2.3 · p. 5
  • A convolutional point-embedding network produces multiresolution embeddings, while point-following attention explicitly strengthens correspondence between input handles and generated targets.Source: §4.2.3 · p. 5

4.3. Test-time Techniques to Improve Editing Results

LightningDrag improves inference stability and point adherence with source-based noise initialization and time-dependent classifier-free guidance schedules.

4.3.1 Noise prior

  • Adding noise to the source-image VAE latent narrows the training–testing gap and yields more stable outcomes than randomly initialized noise.Source: §4.3.1 · p. 5
  • Noised source latents produce the best noise-prior results among the evaluated strategies and are adopted in the pipeline.Source: §4.3.1 · pp. 5–6, Figure 4 · p. 6

4.3.2 Point-following classifier-free guidance

  • Point-following CFG uses a time-dependent scale to balance point-following accuracy against generated-image quality during denoising.Source: §4.3.2 · p. 6
  • Without CFG, dragging is unreliable; constant CFG enables movement but can cause over-saturation, whereas decaying schedules improve image quality.Source: §4.3.2 · p. 6, Figure 5 · p. 6
  • The Inverse square schedule achieves the best image quality among the tested decaying schedules, while Linear and Square retain slight degradation.Source: §4.3.2 · p. 6

4.4. “Drag engineering” to improve the editing

LightningDrag offers two user-facing drag-engineering strategies for correcting imperfect edits: adding point pairs and splitting a drag into sequential rounds.

4.4.1 Point augmentation

  • Point augmentation adds handle–target pairs when specified regions fail to reach their targets, conveying editing intent more explicitly.Source: §4.4.1 · p. 6, Figure 6 · p. 7

4.4.2 Sequential dragging

  • Sequential dragging decomposes a difficult edit into multiple rounds that move semantic content toward final targets.Source: §4.4.2 · p. 7
  • Sequential dragging is supported by appearance and identity preservation, which prevents cumulative appearance shifts across repeated edits.Source: §4.4.2 · p. 7
  • The model’s negligible latency allows sequential dragging without significantly undermining user experience.Source: §4.4.2 · p. 7

5. Experiments

LIGHTNINGDRAG achieves strong DragBench accuracy and appearance preservation while substantially reducing inference time. Experiments also show robust qualitative editing and support sequential or multi-round corrections.

5.1. Implementation details

  • The experiments use Stable Diffusion V1.5 components, train on 220k video samples, evaluate with 25-step DDIM sampling, and support sequential or multi-round dragging for difficult edits.Sequential dragging decomposes a difficult trajectory into shorter operations, while multi-round dragging lets users iteratively edit based on prior outputs.Source: §5.1 · p. 7, Figure 7 · p. 8, §5.4 · p. 8

5.2. Evaluation on DragBench

  • LIGHTNINGDRAG attains the lowest Mean Distance on DragBench and exceeds other methods in Image Fidelity except SDEDrag, whose score often reflects undesired identity mapping.Table 1 evaluates 205 samples using Image Fidelity and Mean Distance; qualitative results further support the identity-preservation finding.Source: §5.2 · p. 7, Table 1 · p. 7

5.3. Time efficiency

  • With LCM-LoRA, LightningDrag requires less than 1 second per dragging operation, while remaining an order of magnitude faster than most baselines without acceleration.Its execution time is constant regardless of dragging distance, whereas SDEDrag varies with handle-target distance.Source: §5.3 · pp. 7–8, Table 2 · p. 8

5.4. Qualitative results

  • Qualitative comparisons show that LIGHTNINGDRAG preserves source appearance while handling pose changes, object scaling, translation, and local deformation more effectively than prior methods.DiffEditor and Readout Guidance often lose identity, while DragDiffusion and SDEDrag sometimes fail to move the desired regions.Source: §5.4 · p. 8

6. Conclusion, Limitations and Future Works

The paper concludes that video motion cues enable high-quality drag editing in approximately 1 second, with experiments showing advantages in speed and quality. Its main limitation is inherited from Stable Diffusion V1.5, especially inadequate detail in small complex regions.

Conclusion

  • Video motion cues enable LIGHTNINGDRAG to learn object changes and deformations without dedicated drag-editing training data, while experiments show superior speed and quality.The authors present the method as a practical approach for high-quality drag-based editing in approximately 1 second.Source: §6 · p. 8

Limitations and Future Works

  • Because it is built on Stable Diffusion V1.5, LightningDrag can produce inadequate detail in small regions, particularly complex human hands and faces.The authors identify larger diffusion models such as SDXL as future work to potentially mitigate this limitation.Source: §6 · p. 8
Loading 2405.13722v2…