Aggregation-induced emission (AIE) photosensitizers are promising for photodynamic therapy, yet their short excitation wavelengths present a limitation. In this study, we develop a series of organic photosensitizers with dual modulation capabilities based on excited-state intramolecular proton transfer (ESIPT) and AIE. Notably, we synthesize near-infrared (NIR)excited photosensitive nanoparticles through a coassembly strategy utilizing upconversion nanoparticles (UCNPs) and amphiphilic polymers. The spectroscopic analysis and theoretical calculations elucidate the significant impact of additional or π-spacer groups on the conformational change and the energy barrier of the ESIPT process. An efficient Forster resonance energy transfer between the photosensitizer and UCNPs is achieved through the coassembly strategy. Both in vitro and in vivo experiments demonstrate the antitumor efficacy of these nanoparticles under NIR excitation. This work not only introduces a novel approach for simultaneously modulating AIE properties and the ESIPT process but also provides a robust solution for overcoming the excitation wavelength limitations of many organic photosensitizers.