If the two models have the exact same structure (i.e. their state dicts have the same layers in the same order) then the following should work:
sum((x - y).abs().sum() for x, y in zip(model1.state_dict().values(), model2.state_dict().values()))