When extracting a sd 1.5 .safetensors using the from_single_file and then save_pretrained methods (as found in the convert_original_stable_diffusion_to_diffusers.py script), a handful of the vae keys are not properly renamed.
This fixes that issue.
I determined this by first extracting and then re-compiling the v1-5-pruned-emaonly.safetensors file using the stock script, then re-compiling it the same way.
I then did a diff of the keys from the two checkpoints, and noted the differences this change fixes.
After applying this patch, the keys between the two models were almost exactly the same, with the exception of a handful of other keys that don't appear to be related to the actual model weights.
Fixes # (issue)
Before submitting
[ x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
d8ahazard
changed the title Fix possible re-conversion issues after extracting from diffusers Fix possible re-conversion issues after extracting from safetensors1 year ago
Properly rename specific vae keys.
What does this PR do?
When extracting a sd 1.5 .safetensors using the from_single_file and then save_pretrained methods (as found in the convert_original_stable_diffusion_to_diffusers.py script), a handful of the vae keys are not properly renamed.
This fixes that issue.
I determined this by first extracting and then re-compiling the v1-5-pruned-emaonly.safetensors file using the stock script, then re-compiling it the same way.
I then did a diff of the keys from the two checkpoints, and noted the differences this change fixes.
After applying this patch, the keys between the two models were almost exactly the same, with the exception of a handful of other keys that don't appear to be related to the actual model weights.
Fixes # (issue)
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@patrickvonplaten
@sayakpaul