Measurement of Higgs boson production cross sections using 2022 and 2023 CMS data in the diphoton decay channel