Residual lead iodide (PbI2) is deemed to a double-edged sword in perovskite film as small amounts of PbI2 are beneficial to the photovoltaic performance, but excessive will cause degradation of photovoltaic performance and stability. Herein, an in situ repair strategy has been developed by introducing amine-releasable mediator (methylammonium pyridine-2-carboxylic, MAPyA) to eliminate over-residual PbI2 and regulate the crystal quality of perovskite film. Notably, MAPyA can be partially decomposed into methylamine (MA) gas and pyridine-2-carboxylic (PyA) during high temperature annealing. The released MA can locally form liquid intermediate phase, facilitating the reconstruction of perovskite microcrystals and residual PbI2. Moreover, the leftover PyA is confirmed to effectively passivate the uncoordinated lead ions in final perovskite film. Based upon this, superior perovskite film with optimized crystal structure and holistic negligible PbI2 is acquired. The assembled device realizes outstanding efficiency of 24.06 %, and exhibits a remarkable operational stability that maintaining 87 % of its origin efficiency after continuous illumination for 1480 h. And the unencapsulated MAPyA-treated devices present significant uplift in humidity stability (maintaining ~93 % of the initial efficiency over 1500 h, 50-60 % relative humidity). Furthermore, the further optimization of this strategy with nanoimprint technology proves its superiority in the amplificative preparation for perovskite films.