ShivamShrirao / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch
https://huggingface.co/docs/diffusers
Apache License 2.0
1.88k stars 506 forks source link

CKPT FILES won't load on AUTOMATIC 1111 - it gives an error, see description #5

Closed LIQUIDMIND111 closed 1 year ago

LIQUIDMIND111 commented 1 year ago

Describe the bug

SINCE its a CKPT, I am loading it on the MODEL FOLDER on automatic1111, since thats where i have many OTHER ckpt working models like WAIFU and EMA. As opposed from BIN MODELS in which they go in the EMBEDDINGS FOLDER, so i need to make sure these CKPT FILES also go also in the same folder as the MAIN MODEL.CKPT.

anyways, I MADE 4 female models, and they all read the same code ""e02601f3""" see below.

start error:

Loading weights [e02601f3] from C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\models\Stable-diffusion\lacarlacapellisexy.ckpt Traceback (most recent call last): File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 273, in run_predict output = await app.blocks.process_api( File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 742, in process_api result = await self.call_function(fn_index, inputs, iterator) File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 653, in call_function prediction = await anyio.to_thread.run_sync( File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, args) File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\modules\ui.py", line 955, in run_settings opts.data_labels[key].onchange() File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\webui.py", line 42, in f res = func(args, **kwargs) File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\webui.py", line 78, in shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights(shared.sd_model))) File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\modules\sd_models.py", line 176, in reload_model_weights load_model_weights(sd_model, checkpoint_info.filename, checkpoint_info.hash) File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\modules\sd_models.py", line 124, in load_model_weights pl_sd = torch.load(checkpoint_file, map_location="cpu") File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 705, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "C:\TEMP\Stable diff\Autom111\stable-diffusion-webui\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 242, in init super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

end error

Reproduction

No response

Logs

No response

System Info

sorry i dont know how to get this, but let me know how...

311-code commented 1 year ago

Do you have the same problem if you use SD-GUI-1.4.0? https://nmkd.itch.io/t2i-gui Just have to replace the model file under /data/models/stable-diffusion-1.4.ckpt. Might be a good test. I use automatic also and that's what I do is place just under embedding and models under those folders you mention. The fact that you are way far ahead of me and having that issues makes me want to wait a bit.

LIQUIDMIND111 commented 1 year ago

yes sir, i had an issue with the CKPT file, seems missing code or something, but i found another repo that has a WORKING CODE and i tested it and its great!! maybe Shivam should use that code instead!!!

feffy380 commented 1 year ago

maybe Shivam should use that code instead!!!

It would help if you actually provided a link instead of just complaining

LIQUIDMIND111 commented 1 year ago

maybe Shivam should use that code instead!!!

It would help if you actually provided a link instead of just complaining

Sorry d\good sir, I was so tired last night, the CKPT from this repo on collab, are not loading this morning on AUTOMATIC 1111, BUT a while ago, i made another ckpt, and it loads well, but all images were a mess, maybe i change a parameter in training and messed the model, not sure, i will try again soon.... some programmers are making ckpt files in half precision instead if 4gb you et a 2gb file... anyways, im glad to feedbakk...

Guizmus commented 1 year ago

In case anyone finds this issue when having the same problem in the future. The solution was given to me here : https://huggingface.co/Guizmus/DarkSoulsDiffusion/discussions/2#63712e52afbe42caa5a64c3f

the problems is solved by making a dedicated environment for your converting and pruning, where Pytorch in on version 1.12 and not 1.13