n00mkrad/text2image-gui

Cant convert files

Opened this issue · 9 comments

I tried converting 3 different safetensor files to .ckpt files but it fails everytime

System Specs: Win 10 Pro on I9 13900k, RTX 4070ti, 32gb DDR5

I've also run into this issue. Models were downloaded and saved into the SDG-1.9.1>Data>Models folder as .safetensors. Workflow = Open NMKD, clicking Developer Tools, Convert Models,. The .safetensors file show in the Model File drop-down list (when Model Input Format is set to .safetensors), but when attempting to convert to Pytorch format, NMKD states "Converting model '...safetensors', Failed to convert model".

System Specs: Win 10 Pro on I9 13900k, RTX 4070ti, 32gb DDR5

I've also run into this issue. Models were downloaded and saved into the SDG-1.9.1>Data>Models folder as .safetensors. Workflow = Open NMKD, clicking Developer Tools, Convert Models,. The .safetensors file show in the Model File drop-down list (when Model Input Format is set to .safetensors), but when attempting to convert to Pytorch format, NMKD states "Converting model '...safetensors', Failed to convert model".

Yeah, thats exactly whats happening with me, except my specs are a bit lower (Windows 11 Pro, I5-13600kf, RTX 3060 TI, 32GB DDR4)

Have you checked what kind of model it is? I got some information from the discord that if it's anything but a .ckpt model, the import won't work.

This will likely be solved with 1.10 which natively supports loading Safetensors and Diffusers models.

Have you checked what kind of model it is? I got some information from the discord that if it's anything but a .ckpt model, the import won't work.

Ok so, im refering to the feature that makes you able to transform other (e.g. Safetensors) type of models into .ckpt models.
Its in dev tools. and is called convert models,
and yea, it doesnt work, or didnt when i tried

It fails to convert the model from torch to onyx for me as well.

has anyone fixed this? im having the same issue with the latest version 1.12.0 my specs exceed minimum specs, I reinstalled everything, ran as admin, tried a different .safetensor, reinstalled my gpu driver. there is absolutly no help related to this issue.

general log

[00000200] [12-28-2023 22:05:33] Conversion Error: Failed to convert model.
[00000201] [12-28-2023 22:05:33] at StableDiffusionGui.Main.Utils.ConvertModels.d__1.MoveNext()

convert log

[00000149] [12-28-2023 22:05:14] Traceback (most recent call last):
[00000150] [12-28-2023 22:05:14] File "P:\SDGUI\Data\repo\scripts\diff\convert_diffusers_to_original_stable_diffusion.py", line 290, in
[00000151] [12-28-2023 22:05:14] unet_state_dict = torch.load(unet_path, map_location="cpu")
[00000152] [12-28-2023 22:05:14] File "P:\SDGUI\Data\venv\lib\site-packages\torch\serialization.py", line 791, in load
[00000153] [12-28-2023 22:05:14] with _open_file_like(f, 'rb') as opened_file:
[00000154] [12-28-2023 22:05:14] File "P:\SDGUI\Data\venv\lib\site-packages\torch\serialization.py", line 271, in _open_file_like
[00000155] [12-28-2023 22:05:14] return _open_file(name_or_buffer, mode)
[00000156] [12-28-2023 22:05:14] File "P:\SDGUI\Data\venv\lib\site-packages\torch\serialization.py", line 252, in init
[00000157] [12-28-2023 22:05:14] super().init(open(name, mode))
[00000158] [12-28-2023 22:05:14] FileNotFoundError: [Errno 2] No such file or directory: 'P:/SDGUI/Data/sessions/2023-12-28-21-49-24/conv-temp-1703801103208\unet\diffusion_pytorch_model.bin'
[00000165] [12-28-2023 22:05:32] +--------------------- Traceback (most recent call last) ---------------------+
[00000166] [12-28-2023 22:05:32] | P:\SDGUI\Data\repo\scripts\diff\convert_original_stable_diffusion_to_diffus |
[00000167] [12-28-2023 22:05:32] | ers.py:138 in |
[00000168] [12-28-2023 22:05:32] | |
[00000169] [12-28-2023 22:05:32] | 135 ) |
[00000170] [12-28-2023 22:05:32] | 136 args = parser.parse_args() |
[00000171] [12-28-2023 22:05:32] | 137 |
[00000172] [12-28-2023 22:05:32] | > 138 pipe = download_from_original_stable_diffusion_ckpt( |
[00000173] [12-28-2023 22:05:32] | 139 checkpoint_path=args.checkpoint_path, |
[00000174] [12-28-2023 22:05:32] | 140 original_config_file=args.original_config_file, |
[00000175] [12-28-2023 22:05:32] | 141 image_size=args.image_size, |
[00000176] [12-28-2023 22:05:32] | |
[00000177] [12-28-2023 22:05:32] | P:\SDGUI\Data\venv\lib\site-packages\diffusers\pipelines\stable_diffusion\c |
[00000178] [12-28-2023 22:05:32] | onvert_from_ckpt.py:1360 in download_from_original_stable_diffusion_ckpt |
[00000179] [12-28-2023 22:05:32] | |
[00000180] [12-28-2023 22:05:32] | 1357 # Convert the UNet2DConditionModel model. |
[00000181] [12-28-2023 22:05:32] | 1358 unet_config = create_unet_diffusers_config(original_config, imag |
[00000182] [12-28-2023 22:05:32] | 1359 unet_config["upcast_attention"] = upcast_attention |
[00000183] [12-28-2023 22:05:32] | > 1360 converted_unet_checkpoint = convert_ldm_unet_checkpoint( |
[00000184] [12-28-2023 22:05:32] | 1361 checkpoint, unet_config, path=checkpoint_path, extract_ema=e |
[00000185] [12-28-2023 22:05:33] | 1362 ) |
[00000186] [12-28-2023 22:05:33] | 1363 |
[00000187] [12-28-2023 22:05:33] | |
[00000188] [12-28-2023 22:05:33] | P:\SDGUI\Data\venv\lib\site-packages\diffusers\pipelines\stable_diffusion\c |
[00000189] [12-28-2023 22:05:33] | onvert_from_ckpt.py:422 in convert_ldm_unet_checkpoint |
[00000190] [12-28-2023 22:05:33] | |
[00000191] [12-28-2023 22:05:33] | 419 |
[00000192] [12-28-2023 22:05:33] | 420 new_checkpoint = {} |
[00000193] [12-28-2023 22:05:33] | 421 |
[00000194] [12-28-2023 22:05:33] | > 422 new_checkpoint["time_embedding.linear_1.weight"] = unet_state_di |
[00000195] [12-28-2023 22:05:33] | 423 new_checkpoint["time_embedding.linear_1.bias"] = unet_state_dict |
[00000196] [12-28-2023 22:05:33] | 424 new_checkpoint["time_embedding.linear_2.weight"] = unet_state_di |
[00000197] [12-28-2023 22:05:33] | 425 new_checkpoint["time_embedding.linear_2.bias"] = unet_state_dict |
[00000198] [12-28-2023 22:05:33] +-----------------------------------------------------------------------------+
[00000199] [12-28-2023 22:05:33] KeyError: 'time_embed.0.weight

FileNotFoundError: [Errno 2] No such file or directory: 'P:/SDGUI/Data/sessions/2023-12-28-21-49-24/conv-temp-1703801103208\unet\diffusion_pytorch_model.bin'

thanks, that doesnt help at all