Abstract
Text-based image editing is typically approached as a static task that involves operations such as inserting, deleting, or modifying elements of an input image based on human instructions. Given the static nature of this task, in this paper, we aim to make this task dynamic by incorporating actions. By doing this, we intend to modify the positions or postures of objects in the image to depict different actions while maintaining the visual properties of the objects. To implement this challenging task, we propose a new model that is sensitive to action text instructions by learning to recognize contrastive action discrepancies. The model training is done on new datasets defined by extracting frames from videos that show the visual scenes before and after an action. We show substantial improvements in image editing using action-based text instructions and high reasoning capabilities that allow our model to use the input image as a starting scene for an action while generating a new image that shows the final scene of the action.
Introduction
Most current text-to-image editing tools are "static." They excel at swapping a cat for a dog, changing a style from "oil painting" to "sketch," or adding a hat to a person. However, they struggle with dynamic actions. If a state-of-the-art model is given an image of a closed cupboard and the instruction "open the cupboard," it usually either ignores the command or generates a completely new kitchen that bears little resemblance to the original. The challenge lies in the "action discrepancy"—the model must understand the physical transformation required by a verb while maintaining pixel-level loyalty to the objects' colors, textures, and surroundings.
To address this, we introduce EditAction, a framework that moves text-based image editing from static object manipulation to dynamic action implementation. By training a diffusion model to recognize contrastive action discrepancies, we enable users to change the posture and position of objects while strictly preserving the visual identity of the original scene.
Methodology
EditAction is built upon the architecture of InstructPix2Pix and incorporates three key technical innovations:
- Contrastive Action Learning: Instead of simple supervised learning, the diffusion model is adapted to act like a classifier. During training, the model is shown an input image and an edited image. It must maximize the likelihood of the "correct" action text while suppressing a randomly selected "incorrect" action. This forces the model to focus specifically on the visual changes that define a specific verb.
- Strategic Freezing: To prevent the model from losing its "common sense" about object appearance (catastrophic forgetting), the cross-attention layers are frozen. These layers handle the mapping between text and vision. By keeping them static, the model is forced to use original object representations while only updating the spatial layers that control positioning and pose.
- Regularization for Stability: A regularization loss ($L_{reg}$) ensures the fine-tuned model's weights do not drift too far from the original pre-trained U-Net, preventing the hallucinations or random artifacts often seen when fine-tuning on specialized datasets.
Datasets
Since no dedicated "action-editing" dataset existed, we created two new benchmarks by extracting the first and last frames of action sequences from existing video datasets:
- LC (Low Complexity): Based on MPII-Cooking, featuring a fixed camera view of people preparing food. It contains ~13,700 image pairs across 61 different actions.
- HC (High Complexity): Based on EPIC-Kitchens, captured via head-mounted cameras. This is significantly harder because the background shifts and rotates as the person moves. It contains ~37,400 pairs across 260 actions.
Key Results
EditAction was compared against several baselines, including Imagic, Plug-and-Play, and MasaCTRL.
- Action Accuracy: On the LC dataset, EditAction achieved an action recognition accuracy of 71.4% (measured by a separate video-action recognition model), outperforming the next best baseline by a significant margin.
- Image Quality: It achieved the lowest (best) FID (Fréchet Inception Distance) scores on the HC dataset (97.28), indicating that the generated images were both high-quality and closely related to the ground truth.
- Speed: As an inference-based model, EditAction takes only about 9.4 seconds per image, comparable to standard InstructPix2Pix and much faster than optimization-based methods like Imagic.
Conclusion
EditAction demonstrates that actions can be treated as spatial shifts rather than changes in object identity. By focusing on the discrepancy between "before" and "after," the model learns the physics of the action and can even extrapolate logical scene extensions (e.g., imagining the interior of a dishwasher). Future work will explore the use of segmentation masks to resolve object ambiguity in crowded scenes and improve fine-grained logical consistency in complex interactions.
Summary updated