diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

using these models inside of automatic's webui?

Open jtoy opened this issue 3 years ago • 5 comments

Describe the bug

I can train models and generate images, but when I convert the model to a ckpt with the hugging face official repo https://github.com/huggingface/diffusers/blob/main/scripts/convert_diffusers_to_original_stable_diffusion.py and another converter https://gist.github.com/jachiam/8a5c0b607e38fcc585168b90c686eb05 the model wont load. I get 2 different errors:

unable to unpickle data

and

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper__index_select)

respectively. Has anyone got a trained model to convert to ckpt for usage?

Reproduction

No response

Logs

No response

System Info

Ubuntu 22.04.1 LTS, Python 3.10.6, diffusers 0.7.2

jtoy avatar Nov 17 '22 01:11 jtoy

Example Workflow...

Go to: Wherever diffusers is located/scripts

Copy/Paste:

convert_diffusers_to_original_stable_diffusion.py convert_original_stable_diffusion_to_diffusers.py

Place the above ^ .py files in the below path:

Ex:

/diffusers/examples/dreambooth

conda activate diffusers

cd /diffusers/examples/dreambooth

python convert_diffusers_to_original_stable_diffusion.py --model_path output/1608 --checkpoint_path /stable-diffusion-webui/models/Stable-diffusion/desired-name-v-1-5-14-14-1608-SV.ckpt

python convert_original_stable_diffusion_to_diffusers.py --checkpoint_path=models/v1-5-pruned-emaonly.ckpt --scheduler_type=ddim --dump_path=models/v-1-5-diffusers

JPW0080 avatar Nov 17 '22 07:11 JPW0080

I was doing that before and I did it again, but it doesnt work for me. This is the command I run: python convert_diffusers_to_original_stable_diffusion.py --model_path /home/jtoy/sd/models/3 --checkpoint_path wtf5.ckpt

the md5 forconvert_diffusers_to_original_stable_diffusion.py is 05a30408ccc4b479f96cf535719bae14

Loading weights [0e200e66] from /home/jtoy/stable-diffusion-webui/models/Stable-diffusion/wtf5.ckpt Error verifying pickled file from /home/jtoy/stable-diffusion-webui/models/Stable-diffusion/wtf5.ckpt: Traceback (most recent call last): File "/home/jtoy/stable-diffusion-webui/modules/safe.py", line 97, in load check_pt(filename) File "/home/jtoy/stable-diffusion-webui/modules/safe.py", line 77, in check_pt check_zip_filenames(filename, z.namelist()) File "/home/jtoy/stable-diffusion-webui/modules/safe.py", line 69, in check_zip_filenames raise Exception(f"bad file inside {filename}: {name}") Exception: bad file inside /home/jtoy/stable-diffusion-webui/models/Stable-diffusion/wtf5.ckpt: wtf/data.pkl

The file may be malicious, so the program is not going to read it. You can skip this check with --disable-safe-unpickle commandline argument.

jtoy avatar Nov 28 '22 01:11 jtoy

on more testing, If I run with --disable-safe-unpickle, it does load. How do I fix the models they can load without that error? I want to share it with some non technical friends.

jtoy avatar Nov 28 '22 01:11 jtoy

do you all get this same error?

jtoy avatar Nov 28 '22 02:11 jtoy

Indeed, perhaps provide the .sh/.bat with the COMMAND_LINE_ARGS=--disable-safe-unpickle

Else, use very old webui before the command was needed... [Not recommended]

JPW0080 avatar Nov 29 '22 10:11 JPW0080