advice please!

lately i've been really tired of feeling so sorry for myself and feeling so insecure about myself and how i look. i want to be happy with myself and be confident. i've always felt like i was ugly and not good enough. i've been in a relationship for a while now and it's serious. we've lost our virginities to each other and we're our first loves. he's a great guy. he compliments me everyday and lets me know im loved and beautiful but it's hard to believe. i never thought someone would think of me like that. i have this really bad habit of comparing myself to his ex or another girl he used to like because they're really pretty. i just end up feeling like he can do better than me. my fear is always him losing feelings for me and getting back together with his ex or just realizing i wasn't good enough. i know it's wrong to think like that and it's not helping me. i definitely don't want it to affect my relationship and i want to stop that habit. he knows how i'm insecure and he doesn't want me feeling like this. so does anyone know how i can learn to stop comparing myself to other girls and finally be confident and happy with myself? i would appreciate all feedback thank you!