## 3 Methodology
### Diffusion Module  
Recent years have seen widespread interest in diffusion models [26] as a category of generative models. Their core objective is to generate desired data samples from a specified probability distribution. These models consist of a forward diffusion process and an inverse diffusion process: during the forward diffusion process, the model continuously adds noise to the original image, disrupting its information. In the inverse diffusion process, the model analyzes the noisy image and iteratively performs denoising operations to progressively restore the noise-free original image, approaching the target distribution. In terms of data modeling, diffusion models offer significant advantages, particularly in handling highly complex data distributions. What sets them apart is their ability to effectively capture long-range dependencies within the data during the diffusion process. Moreover, diffusion models can generate samples in a continuous and incremental fashion without requiring additional training, unlike Generative Adversarial Networks (GANs), which usually necessitate extra training to generate high-resolution samples--this characteristic contrasts sharply with other generative models. This section utilizes the LDM to achieve the goals of text erasing and background repairing. LDM is a generative model based on a denoising probability model that is aimed at generating data samples by executing a diffusion process in the latent space. As opposed to operating directly in the high-dimensional data space, the latent diffusion model first maps the original data into a lower-dimensional latent space. Within this latent space, the model gradually disrupts the latent variables through an additive noise forward process, and then it learns to recover the original latent variables from the noise through the inverse process. A structural diagram of the LDM is presented in Figure 5.  
Specifically, the forward process transforms the latent variables stepwise into a standard normal distribution, with the added noise causing the data distribution to become increasingly blurred. The inverse process is the core component of the model, where it learns denoising steps to progressively revert the noisy latent variables back to clear latent representations. Finally, these latent representations are mapped back into the data space by means of a decoder to generate new samples consistent with the original data distribution. The entire LDM can be divided into three main parts: perceptive compression, latent diffusion, and conditional mechanisms. Figure 5: Architecture of the LDM module. Firstly, there is perceptive compression. The core goal of this stage is to map high-dimensional and complex raw data onto a low-dimensional latent space to reduce the dimensions and computational complexity of the data. To achieve this, models commonly employ automatic encoders, such as Variational Autoencoders (VAEs) and other deep neural network structures. The encoder portion is responsible for extracting the key features and semantic information from the data, compressing them into compact latent representations. By operating in the low-dimensional space, the model can more effectively learn the distribution of the data and reduce resource consumption. Additionally, to ensure the quality of the latent representations, the model uses techniques such as perceptual loss functions during training to ensure that the compressed representations still retain the sensory features and important information of the original data. The latent diffusion process is the core part of the model, where it executes the diffusion process in the previously obtained low-dimensional latent space, including both forward and inverse diffusion steps. The forward diffusion process starts from the latent representation and gradually adds Gaussian noise to it, bringing it closer to a standard normal distribution. This defines a simple noise distribution that facilitates the modeling of the inverse process.