We study the generation of primeval magnetic fields during inflation era in nonlinear theories of electrodynamics. Although the intensity of the produced fields strongly depends on characteristics of inflation and on the form of electromagnetic Lagrangian, our results do not exclude the possibility that these fields could be astrophysically interesting.