  We consider dissipative effects occurring in the optically thick inner parts
of the relativistic outflows producing gamma-ray bursts and X-ray flashes,
emphasizing specially the Comptonization of the thermal radiation flux that is
advected from the base of the outflow. Such dissipative effects --e.g. from
magnetic reconnection, neutron decay or shocks -- would boost the energy
density of the thermal radiation. The dissipation can lead to pair production,
in which case the pairs create an effective photosphere further out than the
usual baryonic one. In a slow dissipation scenario, pair creation can be
suppressed, and the effects are most important when dissipation occurs below
the baryonic photosphere. In both cases an increased photospheric luminosity is
obtained. We suggest that the spectral peak in gamma ray bursts is essentially
due to the Comptonized thermal component from the photosphere, where the
comoving optical depth in the outflow falls to unity. Typical peak photon
energies range between those of classical bursts and X-ray flashes. The
relationship between the observed photon peak energy and the luminosity depends
on the details of the dissipation, but under plausible assumptions can resemble
the observed correlations.
