Attorneys who do family law can charge by the hour or according to a set fee, but not according to the outcome of the case. The billing method and the fee charged is based on whatever you and your attorney agree to.
Some divorce mills will charge a flat rate for no-contest divorces, like $500.00. Be aware that the quality of work you get and the attention paid to your case will not likely be very good. Most family law attorneys charge an initial retainer and work off of that retainer by charging hourly against it.
It sounds like you need to make sure to hire a lawyer to make sure this goes smoothly. Your "sole custody" is against the presumption in TX, meaning hard to get, but with these facts it may be possible. An attorney would help you attain your goals. Good luck.
Disclaimer: This answer is intended for informational or educational purposes only and should not be considered legal advice nor forming any attorney-client relationship.
A weekly guide with tips and legal advice for each stage of the process.