4-Hydroxyphenylpyruvate dioxygenase (HPPD) is a pivotal enzyme in tocopherol and plastoquinone synthesis and a potential target for novel herbicides. Thirty-five pyridine derivatives were selected to establish a Topomer comparative molecular field analysis (Topomer CoMFA) model to obtain correlation information between HPPD inhibitory activity and the molecular structure. A credible and predictive Topomer CoMFA model was established by "split in two R-groups" cutting methods and fragment combinations (q2 = 0.703, r2 = 0.957, ONC = 6). The established model was used to screen out more active compounds and was optimized through the auto in silico ligand directing evolution (AILDE) platform to obtain potential HPPD inhibitors. Twenty-two new compounds with theoretically good HPPD inhibition were obtained by combining the high-activity contribution substituents in the existing molecules with the R-group search via Topomer search. Molecular docking results revealed that most of the 22 fresh compounds could form stable π-π interactions. The absorption, distribution, metabolism, excretion and toxicity (ADMET) prediction and drug-like properties made 9 compounds potential HPPD inhibitors. Molecular dynamics simulation indicated that Compounds Y12 and Y14 showed good root mean square deviation (RMSD) and root mean square fluctuation (RMSF) values and stability. According to the AILDE online verification, 5 new compounds with potential HPPD inhibition were discovered as HPPD inhibitor candidates. This study provides beneficial insights for subsequent HPPD inhibitor design.