Catalysis of the reaction: reduced riboflavin + NAD(P)+ = riboflavin + NAD(P)H + 2 H+. This reaction can utilize NADH and NADPH.
riboflavin mononucleotide (reduced nicotinamide adenine dinucleotide) reductase activity