Weight Gain After Surgery...Advice please?!

Sa
Hey everyone! So I had ankle surgery at the beginning of April...was in a cast non weight bearing for 5 weeks then in an aircast that I can walk with and still in it (hopefully getting out soon, but still lots of PT ahead!). Anyways, because I've been unable to do any kind of exercise other than just walking I've noticed a decent amount of weight gain (probably 10-20 pounds, hard to get a good weight with a boot on). Has anyone been through something similar? Any advice on how to start losing the weight even though I can't really exercise right now??