Subsequently, she has been involved with substance abuse and continuing to create risks at our home, including bringing over ex-convicts. Recently, I discovered the sexting had never stopped and that this other individual was in fact currently incarcerated for murder and kidnap (100 years).
This behavior may stop (highly unlikely) or get worse (likely) no matter what you do or don't do. First off, your three sons need to be protected. She is inviting a criminal element into your home around 3 young children and abusing substances that might render her unable to properly care for the children.
Spent time with attorneys today initiating a divorce, but worried about my wife's volatility. How do I avoid the nuclear bomb when it comes to the custody topic?
DO NOT discuss any of your plans with your wife. You do have the right to seek legal counsel without sharing that information with her. DO NOT minimize, withhold any of her bad behaviors or evidence from you attorney--impossible to go back later and say, well, by the way, she was also doing x,y,z.
The following may seem harsh, mean or whatever adjective you want to apply, BUT the paramount issue is keeping the three boys safe.
I would strategize with my attorney to seek temporary sole custody of the children and exclusive use of the marital home. This will likely involve getting a restraining order in the boys names against their mother. She is a danger to the children at this point. Your request to the court (at temporary custody hearing) will be visitation of the children to only be in a professionally supervised situation with Mom. Mom will be required to drug test prior to the visitation and also be enrolled in some sort of counseling and classes. My son's situation was eerily similar (criminal element and drug abuse).
To avoid the "nuclear bomb" make sure the children are with you or with some one who will not let her pick up the boys when she is served because she will not be aware of your intent until she is served.
At this point you have a lot on your side to keep the boys safe and avoid her making false allegations or playing games with custody until it all can be sorted out in court. As I said this strategy may seem harsh, but then you are talking about a mother that puts sexting, hanging out with criminals, and drugs before her own children.