The simultaneous presence of a strong quasi-periodic oscillation, of period
similar to 10 s, in the optical and X-ray light curves of the X-ray transi
ent XTE J1118+480 suggests that a significant fraction of the optical flux
originates from the inner part of the accretion flow, where most of the X-r
ays are produced. We present a model of magnetic flares in an accretion dis
c corona where thermal cyclo-synchrotron emission contributes significantly
to the optical emission, while the X-rays are produced by inverse Compton
scattering of the soft photons produced by dissipation in the underlying di
sc and by the synchrotron process itself. Given the observational constrain
ts, we estimate the values for the coronal temperature, optical depth and m
agnetic field intensity, as well as the accretion rate for the source. With
in our model we predict a correlation between optical and hard X-ray variab
ility and an anticorrelation between optical and soft X-rays. We also expec
t optical variability on flaring time-scales (similar to tens of ms), with
a power-density spectrum similar to that observed in the X-ray band. Finall
y, we use both the available optical/extreme-ultraviolet/X-ray spectral ene
rgy distribution and the low-frequency time variability to discuss limits o
n the inner radius of the optically thick disc.