Yeah, I've used food for the past 20 years to control my depression. At first it didn't seem to matter too much that I gained a bit of weight because I felt so much better when I ate. Then when my depression shifted I spent a while being fat and happy. The trouble was I just kept getting fatter and fatter.

Somehow I kept telling myself I could get thin again whenever I wanted. I've lost a bit of weight, but the trouble is for every pound I lose I put 2 back on.
In the long run, self medicating with food is just as harmful as any other kind of self medicating and just as hard to beat too. Maybe you could use food as an incentive to spend more time out of bed and exercising a bit more. Please don't allow yourself to do what I did, it really isn't worth the transitory pleasure.