diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-10 08:37:18 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-10 08:37:18 +0000 |
commit | a5121e7a0623db328a9462d340d389ed6737374a (patch) | |
tree | 2fa6051d457555ef2d61793af2756a44c0ea221c /modules/esrgan_model.py | |
parent | 550256db1ce18778a9d56ff343d844c61b9f9b83 (diff) | |
download | stable-diffusion-webui-gfx803-a5121e7a0623db328a9462d340d389ed6737374a.tar.gz stable-diffusion-webui-gfx803-a5121e7a0623db328a9462d340d389ed6737374a.tar.bz2 stable-diffusion-webui-gfx803-a5121e7a0623db328a9462d340d389ed6737374a.zip |
fixes for B007
Diffstat (limited to 'modules/esrgan_model.py')
-rw-r--r-- | modules/esrgan_model.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/esrgan_model.py b/modules/esrgan_model.py index 85aa6934..a009eb42 100644 --- a/modules/esrgan_model.py +++ b/modules/esrgan_model.py @@ -16,9 +16,7 @@ def mod2normal(state_dict): # this code is copied from https://github.com/victorca25/iNNfer
if 'conv_first.weight' in state_dict:
crt_net = {}
- items = []
- for k, v in state_dict.items():
- items.append(k)
+ items = list(state_dict)
crt_net['model.0.weight'] = state_dict['conv_first.weight']
crt_net['model.0.bias'] = state_dict['conv_first.bias']
@@ -52,9 +50,7 @@ def resrgan2normal(state_dict, nb=23): if "conv_first.weight" in state_dict and "body.0.rdb1.conv1.weight" in state_dict:
re8x = 0
crt_net = {}
- items = []
- for k, v in state_dict.items():
- items.append(k)
+ items = list(state_dict)
crt_net['model.0.weight'] = state_dict['conv_first.weight']
crt_net['model.0.bias'] = state_dict['conv_first.bias']
|