We analyze the generation of seed magnetic fields during de Sitter inflation considering a noninvariant conformal term in the electromagnetic Lagrangian of the form [Formula: see text], where I(ϕ) is a pseudoscalar function of a nontrivial background field ϕ. In particular, we consider a toy model that could be realized owing to the coupling between the photon and either a (tachyonic) massive pseudoscalar field or a massless pseudoscalar field nonminimally coupled to gravity, where I follows a simple power law behavior I(k,η) = g/(-kη)β during inflation, while it is negligibly small subsequently. Here, g is a positive dimensionless constant, k the wave number, η the conformal time, and β a real positive number. We find that only when β = 1 and 0.1 ≲ g ≲ 2 can astrophysically interesting fields be produced as excitation of the vacuum, and that they are maximally helical.