An enhanced wind turbine blade surface defect detection algorithm, CGIW-YOLOv8, has been introduced to tackle the problems of uneven distribution of defect samples, confusion between defects and background, and variations in target scales that arise during drone maintenance of wind turbine blades. This algorithm is given based on the YOLOv8 model. Initially, a data augmentation method based on geometric changes and Poisson mixing was used to enrich the dataset and address the problem of uneven sample distribution. Subsequently, the incorporation of the Coordinate Attention (CA) mechanism into the Backbone network improved the feature extraction capability in complex backgrounds. In the Neck, the Reparameterized Generalized Feature Pyramid Network (Rep-GFPN) was introduced as a path fusion strategy and multiple cross-scale connections are fused, which effectively enhances the multi-scale expression ability of the network. Finally, the original CIOU loss function was replaced with Inner-WIoU, which was created by applying the Inner-IoU loss function to the Wise-IoU loss function. It improved detection accuracy while simultaneously speeding up the model's rate of convergence. Experimental results show that the mAP of the method for defect detection reaches 92%, which is 5.5% higher than the baseline network. The detection speed is 120.5 FPS, which meets the needs of real-time detection.