Schwarz was born in Hernwiess, in the Margraviate of Baden on 8 January 1762, the son of a baron of the Holy Roman Empire and entered French military service in 1776. He served as an officer of the 2nd Hussar Regiment in the War of the First Coalition. Three squadrons of the 2nd Hussars participated in the Battle of Valmy on 20 September 1792 as part of the Flankers of the Left contingent. On 6 November 1792, the regiment fought at the Battle of Jemappes in the Avantgarde of Pierre de Ruel, marquis de Beurnonville's Right Wing. The 2nd was present at the Battle of Hondschoote on 6 to 8 September 1793 and the Second Battle of Wissembourg at the end of the year.