Electrical noise resets & chattering in relay modules using ESP8266
I would recommend connecting LEDs to +3.3V with current limiting resistors and switching them on by driving output low. You can also continue driving them by output high, but you do need current-limiting resistors anyway.

Also your phototransistors seem to be connected in wrong direction. It doesn't matter where you put the resistor (pull-up or pull-down) and connect output to relay, but emitter should go to the ground, not Vcc in either case.



I would also suggest supplementing capacitor on power supply with one of your own. And if it is the same to you I'd rotate the module to put antenna as far away from power supply and relays as possible.