Objective. To investigate the effects of Compaximab and raizumab on retinal function and serum interleukin-17A level in retinopathy of prematurity. Methods. Sixty cases of retinopathy of prematurity treated in our hospital from February 2019 to April 2021 were selected. The patients were randomly divided into control group (
n
=
30
) and research group (
n
=
30
). The control group was treated with Compaq and the research group was treated with razumab. The curative effect, retinal function, incidence of complications, intraocular pressure at different time, and the level of serum interleukin-17A were compared. Results. Compared with the two groups, the curative effect of the research group 93.33% (28/30) was greater than that of the control group 66.67% (20/30), and the difference was statistically significant (
P
<
0.05
). Compared with the incidence of complications, the incidence of corneal opacity, lens opacity, preretinal and vitreous hemorrhage, endophthalmitis, and traction retinal detachment in the research group was greatly lower, and the difference was statistically significant (
P
<
0.05
). Following the therapy, the IOP of the two groups decreased at different times. The IOP of 1 min, 10 min, and 30 min in the research group was obviously lower, and the difference was statistically significant (
P
<
0.05
). Following treatments, the levels of serum IL-17A were decreased. Compared with the control group, the level of serum IL-17A in the research group was greatly downregulated, and the difference was statistically significant (
P
<
0.05
). Conclusion. Intravitreal injection of razumab is an effective treatment for retinopathy of prematurity, which can effectively improve the retinal function of infants. The level of serum interleukin-17A can be reduced and intraocular pressure can be regulated, which is safe and effective.