An image inpainting algorithm is designed by combining densely connected attention blocks for the problems of obvi-ous image inpaintingmarks and unstable model training.A two-stage inpainting network with fine inpainting and coarse in-painting is introduced into the generator,and a densely connected attention block with four channel attention blocks is used in the fine inpainting network.At the same time,the VGG16 feature extraction model is added,and WGAN-GP is introduced as the discriminator loss function to improve the image inpainting effect by multi-loss fusion.To verify the inpainting effect of the model on CelebA dataset,the algorithm outperformed three mainstream algorithms,DCGAN,CE,and DD,in both subjective and objective indicators.