Photocatalytic hydrogen production promisingly mitigates and ameliorates the status quo of energy shortage and decarbonization of the energy supply. Given this, a photocatalyst was prepared by modifying spongy g-C3N4 with covalent organic frameworks (COFs). As an electron acceptor with a large specific surface, COFs can trap more transition electrons, leading to an increase in the photogenerated carriers involved in the surface reaction and increasing the active sites of the photocatalyst. The S-scheme heterojunction structure formed in g-C3N4/COFs composite catalyst triggers a decrease in the recombination rate of photogenerated electron-hole pairs as well as an increase in photogenerated electrons. The photocatalytic hydrogen production rate reached the maximum value of 7788.10 μmol·h−1·g−1, almost 7 times that of g-C3N4. The AQE of the catalyst reached 29.6 %. The electron transfer path from g-C3N4 to COFs was verified by density functional theory (DFT) calculation.