Actually, I think Austria-Hungary can stay together, and I think it could even prosper quite a bit without a lot of strife. All you need is for the option for the various minorities to be worse than staying in the Empire. Then the nationalism will be directed at autonomy, preserving the language, handling taxes locally etc, like for example Welsh nationalism.
By 1914, Franz Ferdinand had abandoned the federation plan and wanted a centralised state with a single national parliament - but with equal voting rights for all citizens, regardless of language, and rights to use your own language in your own part of the Empire.
We also need to make the situation in a lot of countries around Austria-Hungary worse (at least compared to the Empure) for the minorities to think twice or thrice about wanting to be part of another nation rather than the Empire.
By 1914, Austria-Hungary was one of the fastes growing economies on earth. Russia grew more in percent, but Austria-Hungary grew more in absolute numbers. This was miamly driven by Austria and Bohemia-Moravia, with the other areas lagging behind, especially the Hungarian part of the Empire. Centralised services such as the post office, railroads and pensions for army and state employees were holding the Empire together quite a bit (a Polish conductor was cited saying 'The Empire cannot fall, who will pay my pensions?').
So, first we need to avoid ww1 to let the Empire grow more economically and grow together better. Without the stress of ww1, I suppose Franz Joseph will live a bit longer, but he will probably still die before the 1917 Ausgleich. The Hungarians planned to get everything short of complete autonomy, and Franz Ferdinand would have none of it. The Hungarian nobility would over-play their hand, over-estimate the support of other ethnic groups in Hungary (mainly Romanians, Croats, Serbs, Slovaks) and of their own people. Gerrymandering and land ownership rules had disenfranchised most people in the Hungarian part of the Empire and let the Hungarian nobility run the parliament. The Hungarian serfs (more or less still, even though serfdom had been abolished) was voting with their feet and leaving to emigrate, mainly to USA in massive numbers.
We also need to Balkans to be more of a mess to make Croats, Slovenes and Servs in the Empire think that things are not too bad where they are. A more extended Serb pariah status after the murder of the royal family 1903 (OTL, the French still worked with the Serbs and sold arms) and thus a longer, more bloody and messed up 1st and 2nd Balkans War - with the Ottomans doing better and perhaps with Romanian participation, and Russian intervention against Romania to support Bulgaria (not Serbia) can set things up nicely.
Romania now hates Russia for the intervention. Serbia is weaker, more of a pariah and cannot count on Russian support. Bulgaria is perhaps a bit better off, the Ottomans have done far better and the massive ethnical cleansing of muslims from the Balkans cannot happen to the same extent, because the Ottomans are stronger, not as soundly defeated and the Balkan countries are weaker. The Balkan countries are still looking more to the Ottomans and less to Austria-Hungary, they are weaker and hate each other more. Ethical strife and ethnic cleansing of muslims turn into bloody guerilla wars as the muslims resist, probably with some money coming from the Ottomans, especially as they become more flush with cash developing the oil fields in Arabia and Iraw (no ww1, remember?). Suddenly life in Bosnia, under the oh so oppresive thumb of the Austrians seem quite nice to the Serbs living there. What? Railroads, sewers, no cholera or turbercolosis epedemics? No strife and guerilla warfare? Lots of jobs? Can speak my own language at the courts, with the administration and in school? Sounds peachy!
The Czechs is a bigger problem. Perhaps tying their economical and industrial success to customs treaties and infrastructure set up and operated by the Austrians? Imperial German designs on the Sudet could help - some crazy undiplomatic comment by Wilhelm II when he is informed that Czech nationalists want to have their own state along the lines of "Then we must of course protect our brothers in the Sudet if that happens. The army would march within two days." He was good at making such offhand comments that made diplomats cringe - and it could have the Czechs cringe as well. Some trouble in the Polish parts of Germany and some comments about Slavs in the wake of souring German-Russian relations could have the Czechs think that they'd be awfully alone with a hostile powerful neighbour to the north if they went their own way.
Then we have the Poles - they are not a big problem. They were pretty happy in Austria - they had it better than the Poles in Russia, at any rate. As long as there's no Polish state, they'll be rather content.
The Italians are probably not a big problem. They never showed any big natioanlistic tendencies. Have Italy have slightly bigger issues integrating the north and the south, amd bog down against the Ottomans in Libya. Some socialist riots fired upon by the military and other not so nice things in Italy could have the Italians in the Empire think they'd be better of to stay put.
So, to sum things up;
1911: The Italians bog down in Libya in a multiyear campaign against Omar Mukhtar and Ottoman forces. The Ottomans, while lacking a strong navy to punch back, still launch pinprick attacks that shame the Italian navy (mostly by torpedo boats). Eventually, the Italians get Tripolitania, while the Ottomans retain Cyrenaica.
1912-13: 1st Balkan War. Serbia (but not Montenegro, since they want nothing to do with Serbia due to the extended pariah status), Greece and Bulgaria attack the Ottoman Empire. The Serbians are less well armed due to their pariah status and Greece still suffers from the 1897 bankrupcy. The Bulgarians make most gains, but things are far more bloody and the Ottomans do better. When peace is concluded, the Ottomans still control a small strip of land from Thrace to Albania. 2nd Balkan war sees Bulgaria do far, far better, until Romania intervenes and crushes Bulgaria. Russia intervenes against Romania, saving Bulgaria.
1914: No assassination of Franz Ferdinand. No ww1.
1917: Franz Joseph dies, Franz Ferdinand is crowned Emperor and Karl crowned hier. Ausgleich happens. Franz Ferdinand refuses to be crowned and uses some riots in Budapest as an excuse to call up the army to crush the Hungarian nobility. The Hungarians fight for a while, before running out of supplies. They have no international support, their own minorities are fighting against them, Russia is threatening to intervene, they have little to no industry to support their Honved, and much of their own people are avoiding conscription. The Hungarian nobility is crushed. A land reform takes place and the two parliaments merged into one. Franchise is extended to all male citizens, regardless of property ownership. All citizens gain the right to petition the government, go to school and work with the administration in their local language in their local area.
Franz Ferdinand is first a uniting figure for his victory and prestige and 'freeing' the minorities in the Hungarian part of the Empire. Later he becomes a unifying factor in another way - as he fights the parliament about his right to appoint a government and parliamentarism, losing the battle in the early 20s. His resistance unites many ethnic groups and parties against him and show them that they can work together over language and ethnic barriers.
1925: The Empire is prosperous, peaceful and a nice place to live as parliamentarism and regional autonomy increases. Sure, there are nationalists, but few listen to fringe groups advocating their own states, after all, life is pretty good in the Empire, is it not? Would you rather live in Romania, paying all those indemnities to Russia and trying to keep a large army at the same time? Or in Serbia, where no-one will go, fighting muslim guerillas in Kosovo. There's work, the pensions are coming on time every month, the trains run decently on schedule, lots of jobs and investments to make, and chances to climb both the political and economical ladder.
Under these circumstances, I think the Empire could very well survive into modern times - if another nation falls to communism, living in the Empire will be even better, too.
Remember, that it took 4 years of the most brutal war ever seen in mankind's history and 80% casualties before the Empire started to collapse, and it was not until the state started collapse that people really turned to the nationalist groups en masse, as they were the only organised option.