Catalysis of the reactions: 7,8-dihydrobiopterin + NADP+ = sepiapterin + NADPH + H+ and (6R)-L-erythro-5,6,7,8-tetrahydrobiopterin + 2 NADP+ = 6-pyruvoyl-5,6,7,8-tetrahydropterin + 2 H+ + 2 NADPH.
7,8-dihydrobiopterin:NADP+ oxidoreductase activity