ogkalu2 / Merge-Stable-Diffusion-models-without-distortion

Adaptation of the merging method described in the paper - Git Re-Basin: Merging Models modulo Permutation Symmetries (https://arxiv.org/abs/2209.04836) for Stable Diffusion
MIT License
139 stars 21 forks source link

Code expects models to have 'state_dict' #31

Closed zwishenzug closed 1 year ago

zwishenzug commented 1 year ago

Some models don't have a state dict, they just skip that layer and have the keys directly.

After the torch.load parts I had to add some code like this to wrap those models:

if not 'state_dict' in model_a:
    model_a = {'state_dict': model_a}
hobolyra commented 1 year ago

this saved my butt, thanks!