OphEdit: Training-Free Text-Guided Editing of Ophthalmic Surgical Videos

Ritul Jangir, Arkya Jyoti Bagchi, Aiman Farooq, Mangalton Okram, Dr. Saurabh Seetaram Korgaonkar, Deepak Mishra · 2026

Read OphEdit: Training-Free Text-Guided Editing of Ophthalmic Surgical Videos by Ritul Jangir, Arkya Jyoti Bagchi, Aiman Farooq, Mangalton Okram, Dr. Saurabh Seetaram Korgaonkar, Deepak Mishra (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-07695.txt.

Introduction

Ritul Jangir and five co-authors present OphEdit, a system for editing ophthalmic surgical videos with text instructions and no model training. Editing surgical footage is delicate: anatomy and timing must stay exact while instruments or procedural phases change. General video editors trained on natural scenes do not respect those constraints.

OphEdit inverts the video through a deterministic second-order ODE pipeline to capture attention value tensors, then injects selected tensors into the guidance branch while denoising toward the new prompt. This preserves the eye's anatomy while mapping the requested change onto the stream. Clinical evaluations found better structural fidelity and temporal consistency than natural-domain editors on complex changes like instrument swaps. The authors frame it as a way to generate annotated training data cheaply.

Catalog record

CREATORRitul Jangir, Arkya Jyoti Bagchi, Aiman Farooq, Mangalton Okram, Dr. Saurabh Seetaram Korgaonkar, Deepak Mishra
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE20 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.07695

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

OphEdit: Training-Free Text-Guided Editing of Ophthalmic Surgical Videos Ritul Jangir, Arkya Jyoti Bagchi, Aiman Farooq, Mangalton Okram, Dr. Saurabh Seetaram Korgaonkar, Deepak Mishra Abstract High-fidelity surgical video generation can greatly improve medical training and the development of AI, adapting these generative models for precise video editing remains a formidable challenge. Modifying surgical attributes, such as instrument tissue interactions or procedural phases is challenging due to the strict anatomical and temporal constraints. In this paper, we propose OphEdit, a novel training-free framework for the text-guided editing of ophthalmic surgical videos. Our approach leverages a deterministic second-order ODE inversion pipeline to capture Attention Value (V) tensors from the original video. By selectively injecting these stored tensors into the conditional Classifier-Free Guidance (CFG) branch during the denoising phase, OphEdit rigorously preserves the intricate anatomical geometry of the eye while seamlessly mapping text-driven semantic modifications onto the video stream. Clinical evaluations demonstrates that OphEdit effectively handles complex surgical transformations, such as instrument swaps and procedural variations, with superior structural fidelity and temporal consistency compared to natural-domain video editors. Our work represents the first application of training-free video editing in the ophthalmic surgical domain, offering a scalable solution for generating diverse, annotated medical datasets without the need for exhaustive manual recording or costly model fine-tuning. The code and prompts can be accessed at https://github.com/ophedit/OphEdit 1 Introduction Ophthalmic surgeries, such as cataract surgery, are recorded for medical education and surgical training, and, more recently, for developing AI systems [ 7 , 4 ] . Recent advancements in AI have led to models that can understand surgical flow, assess surgeon procedural performance, and support robot-assisted surgeries [ 8 ] . Training such systems requires large amounts of data, diverse cases, and very detailed, specific annotations that capture subtle differences in surgical phases and instrument movements. Obtaining large-scale surgical datasets remains a major challenge in the medical domain. Strict privacy regulations and ethical constraints limit access to patient data, while expert annotation is both time-consuming and costly due to the lack of detailed metadata in existing recordings. Furthermore, rare yet clinically critical surgical events are often underrepresented, resulting in insufficient coverage of complex scenarios. To mitigate this data bottleneck, text-guided video generation has emerged as a promising approach for synthesizing surgical content from natural language descriptions. While such generative methods help address data scarcity, the precise and controllable manipulation of surgical videos, such as editing specific procedural steps or introducing targeted variations, remains largely underexplored. Text-to-video (T2V) generation models [ 12 , 5 ] synthesize realistic video sequences conditioned on textual prompts. In the surgical domain, such models offer significant potential for augmenting training datasets by generating diverse procedural variations that are difficult to capture in real clinical environments. However, generating surgical videos presents significantly greater challenges than synthesizing typical real-world scenes. Ophthalmic procedures, in particular, require fine-grained modeling of each surgical step and precise simulation of instrument–tissue interactions, where even minor inconsistencies can compromise anatomical realism. Recent progress in large-scale text-to-video generation has been driven by models such as CogVideoX [ 12 ] , HunyuanVideo [ 6 ] , and OpenSora [ 13 ] , which demonstrate strong visual fidelity and long-range temporal coherence in natural-domain videos. Building upon these advancements, Ophora [ 7 ] introduced a large-scale text-guided framework tailored specifically for ophthalmic surgical video generation. By leveraging curated surgical datasets and transfer learning from natural-domain models, Ophora enables the synthesis of realistic cataract surgery videos with improved anatomical fidelity and procedural consistency. Despite these advancements, full video generation alone is insufficient for real surgical deployment. Existing text-to-video models primarily regenerate entire sequences rather than enabling precise, localized modifications within an existing surgical video. Such regeneration-based approaches are computationally inefficient and lack the fine-grained controllability required in clinically constrained environments, where preserving anatomical consistency is critical. To date, controllable text-guided editing of ophthalmic surgical videos remains largely unexplored. Training-based video editing frameworks typically require large paired datasets or task-specific fine-tuning. Such requirements are impractical in the surgical domain due to limited annotated data, strict privacy regulations, and the high cost of expert labeling. In contrast, training-free approaches leverage pre-trained generative models, enabling flexible and scalable adaptation without additional optimization. Recent zero-shot text-based video editing methods, including UniEdit [ 1 ] , FateZero [ 9 ] , and FLatten [ 2 ] , demonstrate the ability to modify videos without further training. For example, FateZero captures attention maps during latent inversion and reuses them during editing to preserve structural consistency, while FLatten [ 2 ] , proposes an optical flow-guided attention mechanism that enhances temporal consistency in diffusion-based text-to-video editing by constraining attention along motion trajectories across frames. However, directly applying these open-domain frameworks to surgical videos remains challenging. Surgical scenes demand strict anatomical preservation, minimal structural distortion, and highly localized modifications. Therefore, a domain-adapted editing framework is required—one that preserves anatomical integrity while enabling precise and controllable text-guided surgical modifications. To address this gap, we make three main contributions: • We propose the first training-free video editing framework tailored to ophthalmic surgery, enabling precise manipulation of procedural elements (e.g., instrument type, tissue response, surgical phase) via natural language • A novel inversion-editing pipeline that preserves anatomical fidelity by capturing attention value (V) tensors during second order solver inversion and selectively injects them into the denoising process, ensuring structural consistency • To prevent jittering artifacts, we introduce a second-order integration scheme. Computing dual-pathway latent updates at the log-SNR midpoint ensures rigorous spatio-temporal alignment, preserving the continuous procedural dynamics essential for clinical realism 2 Methodology Figure 1 shows our overall training-free video editing framework for ophthalmic surgical videos. Given an ophthalmic surgical video V , which was generated by a T2V model using source prompt p_{s} , our goal is to produce an edited video V^{\prime} that is based on target prompt p_{t} . This editing process should modify the desired semantic attributes while preserving anatomical structure and temporal consistency. The input video V is encoded to latent space z_{0} using the VAE encoder, and the corresponding text is encoded by the text encoder, and the noise is added to this joint (text + video tokens) representation to convert this to a noisy latent. During inference, the inversion method recovers the noisy latent representation from which this input video was generated. This enables controlled modification of the subsequent denoising trajectory. Editing is achieved by guiding reverse diffusion with the target prompt p_{t} . Figure 1 : Overview of our proposed training-free video editing framework. In the inversion stage, DDIM inversion captures the attention value tensor. In the denoising stage, the denoising process is guided by the target prompt with selective injection of stored values. 2.1 Deterministic Inversion using DDIM-Solver with Attention Value Storage Let \{t_{1},\dots,t_{N}\} represent the sequence of discrete diffusion timesteps decided by the scheduler. The latent diffusion process [ 10 ] is controlled by the cumulative noise parameter \alpha_{t} , which decides how much of the original signal remains. In the inversion phase, the diffusion model estimates the noise \hat{\epsilon}_{\theta}(z_{t},t,p_{s}) added at timestep t , allowing us to derive the predicted clean latent \hat{z}_{0} . To recover the specific noise latent ( z_{T} ) needed to reconstruct the original surgical video, we invert the standard denoising

Read the complete text