Below you can see the front-view size comparison of the Leica S2 and Pentax 645Z. The Pentax 645Z is 4 mm narrower and 3 mm shorter than the Leica S2 but it is also 42 mm thicker.
The chart below depicts how two cameras compare with average dimensions of the cameras in their class.