My partner (male) of over 10 years had a similar compulsion. It was as a result of a lot of things in his childhood that happened that were basically screwed up.
I knew he watched a lot of porn because unfortunately it is something that I really don't like and I have checked his computer for years. I knew from the content and the number of times it was accessed that something was wrong but I didn't know what. This formed a sexual addiction which has all the elements you talk about, compulsion, more extreme content, shame and then the self loathing. He also used sexual imagery, even to get through work and always in social situations. It was about trying to escape how desperate he felt and so that few seconds where your mind is blank took away the problems but of course only to emerge again very soon after, a vicious circle.
You'll be pleased to know that there is light at the end of the tunnel if you can commit yourself to getting help. My partner went to a counsellor who specialised in Cognitive Behavour Therapy (CBT). She taught him coping mechanisms for when he felt bad and how to cope and use other methods to avoid going back to that trigger.
It took about 12 sessions of therapy and then putting everything he had learnt into practice, altogether I would say about 12 months from the start of the therapy. You don't have to promise not to use porn, you just have to understand what the reason is you want to. Is it just a sexual release and it's "normal" content or is the addiction creeping back in which is just masking an underlying problem.
You need to understand the deep down reason why you have the addiction and the counsellor will help you to find that. You don't have to tell them chapter and verse about your life unless you want to, they are just interested in helping you change your life.
I still don't know if it was the right thing for him to tell me everything after the event, it really damaged my confidence and self esteem, I also went to the counsellor separately, you might need to talk to your partner. She'll probably be horrified but then so are you when you look back at your internet history, knowing you need help is the first step and you've already done that
It's been 18 months since the start of the counselling and he says he feels like a new man, uses the techniques he was taught, no longer uses sexual imagery.
I hope this helps and good luck with taking control of your life, you've already made a start towards it.