  While during inflation a phase of increasing gauge coupling allows for a
scale-invariant hyperelectric spectrum, when the coupling decreases a flat
hypermagnetic spectrum can be generated for typical wavelengths larger than the
effective horizon. After the gauge coupling flattens out the late-time
hypermagnetic power spectra outside the horizon in the radiation epoch are
determined by the hyperelectric fields at the end of inflation whereas the
opposite is true in the case of decreasing coupling. Instead of imposing an
abrupt freeze after inflation, we consider a smooth evolution of the mode
functions by positing that the gauge couplings and their conformal time
derivatives are always continuous together with the background extrinsic
curvature. The amplified gauge power spectra are classified according to their
transformation properties under the duality symmetry. After clarifying the role
of the comoving and of the physical spectra in the formulation of the relevant
magnetogenesis constraints, the parameter space of the scenario is scrutinized.
It turns out that a slightly blue hyperelectric spectrum during inflation may
lead to a quasi-flat hypermagnetic spectrum prior to matter radiation equality
and before the relevant wavelengths reenter the effective horizon. In this
framework the gauge coupling is always perturbative but the induced large-scale
magnetic fields can be of the order of a few hundredths of a nG and over
typical length scales between a fraction of the Mpc and $100$ Mpc prior to the
gravitational collapse of the protogalaxy.
