You know, there's a world of difference between walking out of your children's lives, and leaving their father. I had to leave XH for my own sanity, which was already well shaken, and had such low self-esteem I didn't believe I could look after them as well as he could (!); plus, as you say with yours, their lives were based in that house, while I was the only one unhappy, so I didn't feel I had a right to take them away. But I did make it very clear (after I realised XH had been telling them the opposite!) that they were more than welcome to come with me forever or stay with me occasionally or whatever suited them. Fast forward a couple of years, and two do live with me out of choice, while the other two have their own lives but choose to stay at mine when they need to crash out. They wish their father well but they do not want to spend a lot of time in his company. They don't feel that I left them, because I never did. And although they were bewildered and in a couple of cases angry, they didn't end up hating me, because their habit of loving me was too strong. They are good boys (understatement of the century).
It is probable that DS2's failure to complete his university studies was due to us splitting up when we did. I feel bad about that on the rare occasions when I feel anything other than numb. But with the headspace I was in, I could not have stayed even for them. It was more than unhappiness, it was madness. The very centre of my universe was skewed - the children always used to be at that centre. I couldn't even think about what was better for them, though in hindsight, my walking was better for them as well, and I wish I'd done it years before, while my head was still relatively straight.
Thing is, your two are old enough to understand and have an input in the decision. If you explain that you love them as much as ever, don't want to disrupt their lives, but simply cannot live with their father any more, you are treating them as the adults they are or soon will be - communicating, discussing, negotiating options. They still need your love and care - we never really grow out of needing to know our parents love us - but they also need to have some say their own futures. Whether they will hate you for it I can't say. It may be a long while before they really understand. It's not going to be easy for any of you, however you play it. Like others have said, the important thing is that they know you are not leaving them and that you'll always be there for them, wherever "there" may be in future. Whatever I may say about XH (and I often do!) he also is still there for them, strange and damaged perhaps, not so reliable these days, but they do know he cares and would give them his last penny if they needed it. That really is the most important thing.