If it is an electron wavelength, the mass to insert is the electron mass. If you speak about photons and you wanna define their wavelengths, then you cannot just insert the electron mass. The Compton wavelength of a photon is just the photon wavelength, which is simply
$$
\lambda=c/\nu=ch/E=2\pi\hbar/p
$$
where $E$ and $p$ are the energy and linear momentum of the photon.
Two more things:
1- Compton postulated its Compton wavelength for electrons since they were hitting on photons like waves. Therefore in its case you will have to insert the electron mass.
2- You may force your formula also for photons. Folk, do not get me wrong here, please. You may define the energy of the photon by $E=h \nu$ (which is the standard form) $\equiv m c^2$. It is just a definition of your new parameter $m$. Then you will obtain $\lambda =h/mc$ also for photons, where now $m$ is your new parameter. I owe to add that this definition of $m$ is not so bad, since photons at rest have mass 0, but for running photons you may define a mass. The photon mass in this case would be the product $m_0 \,\gamma$, where $m_0$ is the rest mass (which is zero) and $\gamma$ is its relativistic gamma (which is infinite). Of course, that is a product $0\cdot(+\infty)$ and is not defined. But as long as you know that the full consistent definition is $m=E/c^2$, you may say that the product $0\cdot(+\infty)$ makes the finite number $E/c^2$, and you are safe. After all, if you try to estimate how much photons are attracted by gravitational masses (gravitational lensing) and you postulate that their mass is your parameter $m$, you do not get far from the exact calculation in General Relativity.