You are upset by this random strangers nasty comments because your (D)H has made you feel totally unattractive and that you should be grateful for any attention anyone gives you. I don;t think the two are unrelated at all.
What exactly is "beautiful" and "ugly"? Your nose might be the wrong shape for current fashion, or you might have too round a face. My nose turns slightly to one side and I have unbalanced nostrils. I also have a receding chin and freckles and my hair is going grey and my neck is slightly crepey (because I'm an old gimmer).
But I don't scare young children in the street so my looks are perfectly adequate, unless I decide to change career to become a supermodel aged 48 in which case they will be totally inadequate.
One of the most ugly people I ever knew in real life was a man who worked for me who had a very unfortunate squint and dreadful hair and was slightly podgy. 3 months after working with him, I would have walked over broken glass for him as he was one of the smartest funniest and loveliest men I have ever met. He was a really attractive person in every way that mattered and I would have had a wild impetuous fling with him in a heart beat if he hadn't been very happy with his girlfriend and also my junior!
As Judge Judy says "Beauty fades but dumb is forever".
Thankfully for your DH cruel and spiteful can probably be worked on with some counselling and thankfully for you, so can lack of self esteem and peculiar priorities when valuing people.
If your health is affected then by all means work on losing weight - you don't need to go to the gym to lose weight. Wrap yourself in whatever all-encompassing clothing you feel you need and get out for a walk 5 times a week. And add 5 minutes to whatever you can manage every time until you're walking briskly for 45 minutes. Then start the Couch to 5K plan and learn to run. If I can do it - anyone can.