You now have an option to (1) do what's right for you, and (2) potentially have some friends at the end of it. BTW it's not guaranteed that you can have either of these, let alone both.
If you are convinced that you want to leave, I think the best way to phrase it is "I no longer believe that the direction we're headed is the right one. You deserve a co-founder who is all in and believes in the mission. Even though I know this will be painful for everyone, the best path for the rest of you is if I leave now." Expect to give up most or all of your equity position, and maybe stay working a little longer than you'd like to get things wrapped up and in a good place to hand off. Also expect that this won't work and everyone will still be mad at you, but you'll learn a lot and your conscience will be clear. Maybe someday your friends will stop being upset and will realize that you were right, and you can be friends again. No guarantees though.
Best of luck to you.