The new all-inorganic CsPbX
3perovskite material is expected to be used as an absorbing layer to prepare solar cells for efficient and stable commercial devices. However, the high cost and poor stability issues caused by hole transport materials and precious metal electrodes urgently need to be addressed. Therefore, carbon-based perovskite solar cells (C-PSCs) based on the HTL-free all-inorganic system have attracted widespread attention. This article adopts a strategy of finely regulating the ratio of I and Br in X-site of perovskite. Based on the one-step anti-solvent method, CsPbI
xBr
3-xfilms and HTL-free C-PSCs were prepared under ambient air conditions. By comparing their light absorption characteristics, carrier transport, and corresponding optoelectronic properties, a balance point between efficiency and stability was found. Finally, HTL-free C-PSCs achieved the best efficiency of 10.10 % and could be stably prepared under ambient air environments. Afterwards, in order to further improve the performance of the corresponding devices, phenylethylammonium bromide (PEABr) was introduced into the perovskite. And compare the crystallinity, carrier transport, defect situation, and corresponding optoelectronic properties of perovskite films and devices under different conditions. Ultimately, the perovskite film treated with PEABr had better crystallinity and lower defect density, while generating a small amount of two-dimensional perovskite could passivate the perovskite film and suppress non-radiative recombination of charge carriers. After appropriate PEABr treatment, the photoelectric conversion efficiency (PCE) of the device was significantly enhanced, increasing from 10.18 % of the optimal device in the control group to 12.61 %. Thus, this method provides an optimization approach for the preparation of efficient and low-cost HTL-free C-PSCs under ambient air environments.