Unverified Commit e8c9069d authored by chillpixel's avatar chillpixel Committed by GitHub
Browse files

Update loaders.py (#4805)

* Update loaders.py

Solves an error sometimes thrown while iterating over state_dict.keys() caused by using the .pop() method within the loop.

* Update loaders.py
parent 766aa50f
...@@ -1080,7 +1080,7 @@ class LoraLoaderMixin: ...@@ -1080,7 +1080,7 @@ class LoraLoaderMixin:
@classmethod @classmethod
def _maybe_map_sgm_blocks_to_diffusers(cls, state_dict, unet_config, delimiter="_", block_slice_pos=5): def _maybe_map_sgm_blocks_to_diffusers(cls, state_dict, unet_config, delimiter="_", block_slice_pos=5):
# 1. get all state_dict_keys # 1. get all state_dict_keys
all_keys = state_dict.keys() all_keys = list(state_dict.keys())
sgm_patterns = ["input_blocks", "middle_block", "output_blocks"] sgm_patterns = ["input_blocks", "middle_block", "output_blocks"]
# 2. check if needs remapping, if not return original dict # 2. check if needs remapping, if not return original dict
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment