It is sometimes really challenging to define self-harming - or our struggles in general - without feeling like we might be just “emotional” or simply dismiss the reality of how we feel. Comparing doesn’t make you a horrible person, and from what I hear it is your partner who actually compares and has made you start entering in this cycle of comparision. The fact that it makes you feel horrible is absolutely understandable, because somehow the message it conveys is to dismiss how you feel and the reality of your pain.
Oftentimes a reason why we compare our struggles is because it’s just hard to admit it for what it is, and even more to make room for how we feel. We can be tempted to say “others have it way worse than me”, “I shouldn’t complain”, “I’m not that unlucky or struggling”. It’s kind of a way to gaslight ourselves, which can become, in your situation for example, a justification to do more and dive even deeper into our struggles, until it feels “real” enough.
Truth is: struggles can never be compared, because it always take place in a unique context, for a unique individual. There is no scale of suffering. A person who self-harms can do it only on a surface level, or not often, but still feeling the urge to cope that way when they feel distressed. Someone who is struggling with anorexia for example doesn’t have to be extremely underweight to be in a critical condition mentally. A person addicted to a substance won’t necessarily show the physical signs we expect them to display most of the time. It’s all different for each person, and through it all, the pain that stems from these habits is valid for each person. It’s completely subjective and can’t ever be compared.
I would recommend you to have a look at one of HS resources, which is the workbook Rewrite - a workbook about self-harm addressed both to people struggling with it and their loved ones. I have read it in the past, and I personally think that it could actually be a very good resource to open a healthier communication between you and your boyfriend regarding this specific topic.
On a different note, if there is trust and a healthy communication between you, then simply explaining how it makes you feel when he compares you to him, as honestly and lovingly as possible, is really the simplest thing to do. If he gets upset, then it would display some issues he would need to work on, with himself. Actually when he compares your self-harm to yours, he is doing it for himself and for some reason that is about his insecurities. It’s not about you. You, on your end, have the right to express when something makes you uncomfortable or brings you onto a path you don’t want. Your struggles are valid. It is not reflected by how many marks you’d have on your body or how deep it would be.
The question behind your situation is: when would be your pain valid enough to be seen as such? I can promise you, it is already, and it doesn’t need more harm than it is. Your partner may have his own definition and perception of self-harm, but that doesn’t invalidate yours either. The next steps will be for you to learn what’s behind this habit, and finding new ways to cope with emotions that might overwhelm you sometimes.