Eg. Kingdom of Bavaria
The German nobility as a legal body in its entirety ceased to exist with the coming into force of the German constitution from 1919 (also called the “Weimar constitution”) where Art. 109 (3) states:
Öffentlich-rechtliche Vorrechte oder Nachteile der Geburt oder des Standes sind aufzuheben. Adelsbezeichnungen gelten nur als Teil des Namens und dürfen nicht mehr verliehen werden.
“Privileges or disadvantages of public law from birth or estate [as in the “three estates” of nobility, clergy and peasants] are to be abolished. Noble titles are only considered part of the name and may no longer be bestowed.”
Many noble titles and privileges in various parts of the Empire were abolished (in their entirety or at least in practice) before that, however, starting with the November revolution (or rather, multiple connected revolutions in multiple parts of the Empire) of 1918.
For instance, the Bavarian king Ludwig III. was deposed on November 8th, 1918 when Kurt Eisner proclaimed the Free State of Bavaria (“Freistaat” in German, which is roughly equivalent to republic and in Eisner’s case actually meant a Communist Soviet-style government), making Ludwig the first German state-monarch to lose his crown.