The embodiment of the present disclosure provides an
image restoration method based on a text-guided and detail-preserving
diffusion model, which belongs to the technical field of
image processing, and specifically comprises the following steps: obtaining a preliminary degraded image according to a clear image, encoding the clear image into a latent space through an
encoder and adding
noise to obtain a
noise latent variable; inputting the preliminary degraded image and the
noise latent variable into a conditional
diffusion model as conditions to predict noise added in the t-th step, calculating a
latent variable that preserves details and
clarity, and decoding a new degraded image through a decoder according to the latent variable; inputting the new degraded image and the noise latent variable into the conditional
diffusion model as conditions again to obtain a final predicted noise, and calculating a loss according to the final predicted noise and a preliminary predicted noise to
train the conditional diffusion model; saving the model weight of the trained conditional diffusion model, and completing the
image restoration process of a target image by using the
inference process of DDIM. Through the scheme of the present disclosure, the restoration efficiency and adaptability are improved.