Look, obviously if one of my friends put weight on, it wouldnt change my relationship with them in any way whatsoever, they would still be my friends completely. That should be the reasonable answer, and I can’t believe there is a situation where I have to make that clear.
However, as they are my friend, and I care about them, I would ask if there was a particular reason for them gaining weight (if it is very visible and sudden change). If everything was ok, and if they were doing anything about it (if not then ask if they were thinking about doing something etc.) and if they needed any help if they were.
The fact is, obesity is not good for you. There is a higher risk of heart problems, sleep apnoea, gut problems, cancer and diabetes. Many of these things can be cured by losing weight.
Obviously you go about addressing weight issues with sensitivity, not by being a spare prick about it.