After adjustment for covariates, both TyG-BMI and AIP were independent risk factors for DM (TyG-BMI: OR = 1.0100, <i>p</i> < 0.001; AIP: OR = 2.7800, <i>p</i> < 0.001). This evidence concerns the gene AIP and autoimmune pancreatitis.