Jack000 / glid-3-xl-stable

stable diffusion training
MIT License
290 stars 36 forks source link

How to use merge.py? #5

Closed tlack closed 2 years ago

tlack commented 2 years ago

I've been finetuning an SD model and training seems to work OK.

But I'm stuck when merging the files back together for inference.

Which files in logs/ need to be combined to create a usable output model-merged.pt?

When I try python3 merge.py ../sdv14ema.ckpt logs/output015000.pt and use the resulting model-merged.pt for inference, I get this error:

$ python sample.py --model_path model-merged.pt --batch_size 3 --num_batches 3 --text "A Humvee in a ditch"
... lots of output trimmed ...
        Unexpected key(s) in state_dict: "epoch", "global_step", "pytorch-lightning_version", "state_dict", "callbacks", "lr_schedulers".

I have tried with the ema-0.9999-015000.pt and opts015000.pt files and neither seem to contain the right keys.

What am I doing wrong?

tlack commented 2 years ago

To answer my own question, turns out sample.py uses the output/model015000.pt file directly. I was mixing up the commands and their input.

My experiment seems to have worked.

Thanks for creating this great repo.