  We consider several gauge invariant higher dimensional operators that couple
gravity, gauge fields and scalar or fermionic fields and thus break conformal
invariance. In particular, we consider terms that break conformal invariance by
the photon coupling to heavy and light fermions. While the coupling to heavy
fermions typically do not induce significant magnetic fields, the coupling to
light fermions may produce observable magnetic fields when there are a few
hundred light fermions. Next we consider Planck scale modifications of the
kinetic gauge terms of the form f(phi) F_{mu nu} F^{mu nu} and h(psi) F_{mu nu}
\~F^{mu nu}, where f and h are functions of scalar and pseudoscalar fields phi,
psi, and F_{mu nu}, ~F^{mu nu} are the gauge field strength and its dual,
respectively. For a suitable choice of f sufficiently strong magnetic fields
may be produced in inflation to be potentially observable today. The
pseudoscalar coupling may lead to birefringence in inflation, but no observable
magnetic field amplification. Finally, we show that the photon coupling to
metric perturbations produces by far too weak fields to be of cosmological
interest.
