The segmentation accuracy of the lung images is affected by the occlusion of the front background objects. To address this problem, we propose a full-scale lung image segmentation algorithm based on hybrid skip connection and attention mechanism (HAFS). The algorithm uses yolov8 as the underlying network and enhancement of multi-layer feature fusion by incorporating dense and sparse skip connections into the network structure, and increased weighting of important features through attention gates. Finally the proposed algorithm was applied to the lung datasets Montgomery County chest X-ray and Shenzhen chest X-ray. The experimental results show that the proposed algorithm improves the precision, recall, pixel accuracy, Dice, mIoU, mAP and GFLOPs metrics compared to the comparison algorithms, which proves the advancement and effectiveness of the proposed algorithm.