TL;DR
ScribbleEdit introduces a large-scale synthetic dataset and an automated pipeline that pairs freehand human scribbles with natural language instructions to enable precise, localized image editing. By finetuning diffusion and autoregressive models on this dataset, the authors demonstrate a massive leap in a model's ability to simultaneously respect rough spatial boundaries and complex semantic details.
What Problem Does This Paper Address?
While generative image editing models have achieved stunning realism, giving users precise, intuitive control over where and what to edit remains a challenge.
Natural language instructions are highly expressive for high-level semantics (e.g., "add a shiny silver trumpet"), but they lack spatial specificity—it is hard to describe exactly where an object should sit using words alone. Conversely, freehand scribbles are an intuitive way for users to sketch out a rough location and shape, but they cannot convey fine-grained visual attributes like texture, color, or style.
To get the best of both worlds, models must jointly interpret both text and scribbles. However, existing off-the-shelf models struggle with this because they lack specialized training data. They often treat abstract human scribbles as literal line art to be drawn into the image rather than conceptual boundaries.
Methods
To bridge this data gap without relying on expensive manual annotation, the authors developed an automated synthetic data generation pipeline:
- Object Segmentation: They take an image containing a target object from an existing database and use Grounding DINO combined with the Segment Anything Model (SAM) to generate a precise mask of the object.
- Input Image Generation: They erase the object using the LaMa inpainting model, creating a "synthetic base image" that serves as the background.
- Instruction Generation: They pass the original image and the inpainted base image to a Vision-Language Model (Gemma 3-4B), prompting it to generate a natural language instruction describing the object's appearance and location.
Using this pipeline, they benchmark and finetune two distinct architectures:
- Image-Conditioned ControlNet-Scribble: A diffusion baseline modified to condition on the latent representation of the original image, ensuring the background remains intact during editing.
- BAGEL-7B-MoT: A unified autoregressive multimodal large language model. To prevent it from altering unedited parts of the image, they introduce a spatially weighted MSE loss, assigning tokens within the target edit area 5 times the weight of background tokens.
Datasets
The paper introduces the ScribbleEdit dataset:
- Source Material: Built using 12,500 image-scribble pairs from the Sketchy Database. Crucially, these scribbles are drawn by real humans, capturing the abstract and imprecise nature of actual user inputs rather than clean, synthetic edge maps.
- Dataset Splits: The final filtered dataset contains 11,775 unique photos. To optimize training costs, they sample a subset where each photo is paired with at most two scribbles, resulting in 18,876 training, 2,328 validation, and 2,346 test instances.
Key Insights and Ideas
- Scribbles as Constraints, Not Templates: Before finetuning, models often literally draw the scribble lines onto the final image. Finetuning teaches the model to interpret the scribble as a spatial constraint, seamlessly blending the requested object into the designated area.
- The Power of Weighted Loss for LLMs: For autoregressive models like BAGEL, standard training can cause the model to regenerate and alter the background. The spatially weighted MSE loss proved essential to keep the model focused strictly on the edit region.
- Robustness via Modality Dropping: By randomly dropping either the text or scribble inputs (with a 10% probability) during training via Classifier-Free Guidance (CFG), the finetuned models remain robust at inference time even if a user provides only a scribble or only text.
Key Results
Finetuning on ScribbleEdit yielded substantial quantitative and qualitative improvements across both diffusion and autoregressive architectures:
- BAGEL-7B-MoT (Finetuned) emerged as the top-performing model for alignment, achieving the highest Histogram Intersection (0.83 Entire / 0.72 BBOX) and CLIP score (0.88), showing it followed both spatial and textual cues best.
- Image-Conditioned ControlNet-Scribble achieved the lowest FID score (28.47), indicating superior image realism and background preservation.
- Qualitative Impact: As shown in Figure 2, zero-shot models frequently failed by either ignoring the scribble entirely or generating bizarre, scribble-like artifacts. The finetuned variants successfully generated realistic objects that matched the geometry of the scribble and the description of the text.
Limitations and Future Work
- Pipeline Noise: An error analysis revealed that the automated pipeline occasionally generates imperfect data: 16% of test examples had unclear/incorrect scribble instructions, and 34% had flawed text instructions.
- Scalability Constraints: Relying on the pre-existing Sketchy Database ensures realistic human drawings but limits the dataset's scalability. Future work will explore generating semantically aware synthetic scribbles that mimic human behavior (e.g., via CLIPasso).
- Scope of Edits: The current dataset is strictly focused on object addition. The authors note that incorporating hierarchical segmentation tools (like UnSAMv2) could expand future datasets to support more complex, fine-grained, or partial image modifications.
Summary updated