As the global trend of diabetes intensifies, the burden of vision-threatening retinopathy, particularly diabetic retinopathy (DR), is increasing. There is an urgent need to seek strategies for early prevention and control of DR. This study attempted to comprehensively evaluate the relationship between dietary nutrient intake and the risk of DR to provide assistance for doctors in guiding the diet of diabetic patients. Data from eligible participants with diabetes from the US National Health and Nutrition Examination Survey (NHANES) from 2003–2018 were analyzed. Univariate logistic regression was used to assess the association between 58 dietary nutrient intakes and self-reported eye disease risk. Multivariate logistic regression model was used to further evaluate the relationship between the two groups after adjusting relevant confounding factors. A total of 4595 diabetic patients were included. People with self-reported eye affliction/retinopathy had lower dietary fiber, butanoic, octanoic, vitamin A, alpha-carotene, folate, magnesium, copper and caffeine intake compared to those without self-reported eye affliction/retinopathy. The pooled ORs (95% CIs) were 0.78 (0.62–0.98), 0.79 (0.63–0.99), 0.72 (0.58–0.91), 0.74 (0.59–0.93), 0.70 (0.55–0.88), 075 (0.60–0.95), 0.79 (0.64–0.99), 0.67 (0.54–0.84) and 0.80 (0.64–0.99). Dietary cholesterol and hexadecenoic intake were higher, with the pooled ORs (95% CIs) of 1.26 (1.01–1.58) and 1.27 (1.02–1.59), respectively. Our research found that among dietary nutrients, dietary fiber, butanoic, octanoic, vitamin A, alpha-carotene, folate, magnesium, copper and caffeine intake reduced the occurrence of DR. Cholesterol and hexadecenoic intake promoted the occurrence of DR. This suggests that certain dietary nutrients should be paid more attention in the prevention of DR.