d8ahazard / sd_dreambooth_extension

Other
1.86k stars 282 forks source link

Unable to create model #544

Closed MarcosLopezC closed 1 year ago

MarcosLopezC commented 1 year ago
Python revision: 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Dreambooth revision: 9e3584f0edd2e64d284b6aaf9580ade5dcceed9d
SD-WebUI revision: 685f9631b56ff8bd43bce24ff5ce0f9a0e9af490

Checking Dreambooth requirements...
[+] bitsandbytes version 0.35.0 installed.
[+] diffusers version 0.10.2 installed.
[+] transformers version 4.25.1 installed.
[ ] xformers version N/A installed.
[+] torch version 1.12.1+cu113 installed.
[+] torchvision version 0.13.1+cu113 installed.

Have you read the Readme? Yes.

Have you completely restarted the stable-diffusion-webUI, not just reloaded the UI? Yes.

Have you updated Dreambooth to the latest revision? Yes.

Have you updated the Stable-Diffusion-WebUI to the latest version? Yes.

No, really. Please save us both some trouble and update the SD-WebUI and Extension and restart before posting this. Reply 'OK' Below to acknowledge that you did this. OK

Describe the bug

I am unable to create a model from Web UI using the Dreambooth extension. At first I thought maybe it was an issue with my installation, so I created brand new directory and installed AUTOMATIC1111/stable-diffusion-webui again (following the instructions in the README file to the letter. Immediately after I installed this extension, again following the instructions in the README file to the letter.

After everything installed and the application loaded I went directly to the Dreambooth tab on WebUI, then on the Create Model section I entered to the following parameters:

Name: marcoslopezc
Source Checkpoint: model.ckpt [7460a6fa]
Scheduler: ddim

(No check boxes were selected)

A few seconds after pressing the Create button, I was presented with the following error on the console:

venv "C:\PROJECTS\StableDiffusion\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 685f9631b56ff8bd43bce24ff5ce0f9a0e9af490
Installing requirements for Web UI

#######################################################################################################
Initializing Dreambooth
If submitting an issue on github, please provide the below text for debugging purposes:

Python revision: 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Dreambooth revision: 9e3584f0edd2e64d284b6aaf9580ade5dcceed9d
SD-WebUI revision: 685f9631b56ff8bd43bce24ff5ce0f9a0e9af490

Checking Dreambooth requirements...
[+] bitsandbytes version 0.35.0 installed.
[+] diffusers version 0.10.2 installed.
[+] transformers version 4.25.1 installed.
[ ] xformers version N/A installed.
[+] torch version 1.12.1+cu113 installed.
[+] torchvision version 0.13.1+cu113 installed.
#######################################################################################################

Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Dreambooth API layer loaded
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading weights [7460a6fa] from C:\PROJECTS\StableDiffusion\stable-diffusion-webui\models\Stable-diffusion\model.ckpt
Applying cross attention optimization (Doggettx).
Model loaded.
Loaded a total of 0 textual inversion embeddings.
Embeddings:
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Loading model from checkpoint.
Loading checkpoint...
v1 model loaded.
Creating scheduler...
Converting unet...
Converting vae...
Converting text encoder...
Pipeline or config is not set, unable to continue.
 Restored system models.
 Allocated: 2.0GB
 Reserved: 2.0GB

 Allocated 2.0/2.0GB
 Reserved: 2.0/2.0GB

Exception while extracting model: Unable to load weights from pytorch checkpoint file for 'C:\Users\Marcos/.cache\huggingface\hub\models--CompVis--stable-diffusion-safety-checker\snapshots\cb41f3a270d63d454d385fc2e4f571c487c253c5\pytorch_model.bin' at 'C:\Users\Marcos/.cache\huggingface\hub\models--CompVis--stable-diffusion-safety-checker\snapshots\cb41f3a270d63d454d385fc2e4f571c487c253c5\pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

If a crash has occurred, please provide the entire stack trace from the log, including the last few log messages before the crash occurred. N/A

Environment

What OS? Native Windows 10 (x64)

What GPU are you using? Nvidia RTX 3090 TI

Screenshots/Config If the issue is specific to an error while training, please provide a screenshot of training parameters or the db_config.json file from /models/dreambooth/MODELNAME/db_config.json N/A

d8ahazard commented 1 year ago

What source model are you trying to extract?

AlanApogee commented 1 year ago

I seem to have the same error, the source model is Linaqruf/anything-v3.0.

AlanApogee commented 1 year ago

Tried with a different model (hakurei/waifu-diffusion) same problem:

Fetching 15 files: 100%|█████████████████████████████████Fetching 15 files: 100%|█████████████████████████████████| 15/15 [08:15<00:00, 33.05s/it]
Pipeline or config is not set, unable to continue.
Restored system models.

Allocated: 2.0GB
Reserved: 2.0GB

Allocated 2.0/2.0GB
Reserved: 2.0/2.0GB

Exception while extracting model: 'torch.device' object has no attribute 'values'
Exception loading config: [Errno 2] No such file or directory: 'C:\\Users\\Administrator\\Desktop\\SD_WebUI\\stable-diffusion-webui\\models\\dreambooth\\waifuDF_nanash_DB\\db_config.json'
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\SD_WebUI\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\db_config.py", line 301, in from_file
with open(config_file, 'r') as openfile:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Administrator\\Desktop\\SD_WebUI\\stable-diffusion-webui\\models\\dreambooth\\waifuDF_nanash_DB\\db_config.json'Can't load config!
MarcosLopezC commented 1 year ago

What source model are you trying to extract?

In this particular case I was using the model described in the README file for WebUI: https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/blob/main/sd-v1-4.ckpt

However, the error occurred regardless of what model selected.

d8ahazard commented 1 year ago

Ah, I see the problem. The model(s) in question are just .ckpt files, not the newer model releases that also feature diffusers-based weights, which is what the URL stuff is currently for.

I can probably implement a feature that handles this some time down the road, but for now, I have bigger priorities. Feel free to submit a feature request for this - for now, this is not supported behavior. Sorry for the confusion.

MarcosLopezC commented 1 year ago

Well, what exactly do I have to do to get this thing to work? When I use the URL I get this error instead:

Loading model from hub.
v1 model loaded.
Creating scheduler...
Trying to create MarcosLopezC from huggingface.co/runwayml/stable-diffusion-v1-5
Loading model from hub.
Fetching 15 files: 100%|█████████████████████████████████████████████████████████████| 15/15 [00:00<00:00, 2491.96it/s]
Pipeline or config is not set, unable to continue.
 Restored system models.
 Allocated: 2.0GB
 Reserved: 2.0GB

 Allocated 2.0/2.0GB
 Reserved: 2.0/2.0GB

Exception while extracting model: 'torch.device' object has no attribute 'values'

No matter what I do I get an error in one form or another.

d8ahazard commented 1 year ago

Just download the checkpoint with your browser, save it to sdwebui\models\stable-diffusion...select it in the dreambooth tab.

On Thu, Dec 15, 2022 at 8:58 PM Marcos Vladimir López Castellanos < @.***> wrote:

Well, what exactly do I have to do to get this thing to work? When I use the URL I get this error instead:

Loading model from hub.

v1 model loaded.

Creating scheduler...

Trying to create MarcosLopezC from huggingface.co/runwayml/stable-diffusion-v1-5

Loading model from hub.

Fetching 15 files: 100%|█████████████████████████████████████████████████████████████| 15/15 [00:00<00:00, 2491.96it/s]

Pipeline or config is not set, unable to continue.

Restored system models.

Allocated: 2.0GB

Reserved: 2.0GB

Allocated 2.0/2.0GB

Reserved: 2.0/2.0GB

Exception while extracting model: 'torch.device' object has no attribute 'values'

No matter what I do I get an error in one form or another.

— Reply to this email directly, view it on GitHub https://github.com/d8ahazard/sd_dreambooth_extension/issues/544#issuecomment-1354114286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMO4NHVBJMK6PVSCVMVCODWNPLEXANCNFSM6AAAAAAS7GX534 . You are receiving this because you modified the open/close state.Message ID: @.***>