  WE analyse the universe inflation when the source of gravity is
electromagnetic fields obeying nonlinear electrodynamics with two parameters
and without singularities. The cosmology of the universe with stochastic
magnetic fields is considered. The condition for the universe inflation is
obtained. It is demonstrated that singularities of the energy density and
pressure are absent as the scale factor approaches to zero. When the scale
factor goes to infinity one has equation of state for ultra-relativistic case.
The curvature invariants do not possess singularities. The evolution of
universe is described showing that at large time the scale factor corresponds
to the radiation era. The duration of universe inflation is analysed. We study
the classical stability and causality by computing the speed of the sound.
Cosmological parameters such as the spectral index $n_s$, the tensor-to-scalar
ratio $r$ and the running of the spectral index $\alpha_s$ are evaluated.
