So to start off, I don't think Austria-Hungary really had serious ethnic tensions, any real study into the matter shows most minorities just wanted their own place within the empire but were still loyal(as we saw when they fought the worst war in human history in terrible conditions for 4 years) and supported the empire overall. So I think the best path for AH is something like this:
-Reform Cisleithania into a US style federal system, based off the old crown lands. I'm thinking they get the same amount of autonomy the kresmier constitution gave. The Kaiser appoints all state ministers and has an absolute veto over state policy to keep everyone in line, this shouldn't be too hard for anyone to accept as most people in AH were monarchists. Make German the secondary language across Cisleithania, children would be taught their mother tongue up until middle school when they would be taught German, should be acceptable to most people.
-Destroy the power of the Hungarian aristocracy, full male suffrage for all.
-Create Croatia as a federal state of Hungary similar to the solution with the Austrian half of the empire.
- DONT end magyarization, excluding Croatia, end magyarization there. Magyarization was actually quite successful, with 50% of Hungarian citizens speaking Hungarian by 1914, much higher then the 30% German in Austria. If Magyarization is allowed to keep going, by the 1940s or 50s there would likely be a giant 70-80% Hungarian speaking majority, Hungary would become a giant block of stability in the empire.
-Create as many shared institutions between Austria and Hungary as possible, to make the emperors subjects feel united instead of split. Wherever cooperation is possible, it should happen.
-Create a common Austro-Hungarian parliament that would vote on issues regarding the shared institutions, army funding, war credits, etc. This would unite people further, 50% of the reps would be from Austria and 50 from Hungary, the parliament would be chosen by voting so no more negotiations with the Hungarian aristocracy. The Emperor has absolute veto over this parliament as well to make sure things like army funds are never an issue.
I think with these reforms, you have a pretty good dualist system that should encounter very few issues from its people's. Oh and no more ausgleichs, the common parliament should be able to handle everything the ausgleichs did.