The surface properties of target substrates are crucial for the in situ crystallization and growth of metal halide perovskite films fabricated by the anti-solvent method. In this work, a high-quality quasi-2D perovskite film with various-n phases is fabricated on the commonly used poly(3,4-ethylenedioxythiophene):poly(styrene sulfonate) (PEDOT:PSS) by introducing a branched polyethylenimine (PEI) modifying layer. PEI suppresses the influence of acidic surface of the PEDOT:PSS and regulates the components of the perovskite film, increasing the proportion of large-n phases. Additionally, PEI reduces the formation of defects in perovskite films, leading to higher photoluminescence quantum efficiency and longer photoluminescence lifetime. Based on this high-quality perovskite film, a flexible light-emitting diode with an ultimate current efficiency of 63.2 cd/A is achieved, nearly twofold higher than that of the device (35.1 cd/A) without a PEI modifying layer.