d8ahazard / sd_dreambooth_extension

Other
1.85k stars 281 forks source link

Fix VAE checkpoint export #1414

Closed RossM closed 7 months ago

RossM commented 7 months ago

reshape_weight_for_sd() was being applied to biases as well as weights.

This is not the most elegant fix, but it is the simplest.

Describe your changes

Fixes convert_vae_state_dict() to not add extra size-1 dimensions to the biases when renaming to_q -> q etc.

Issue ticket number and link (if applicable)

https://github.com/d8ahazard/sd_dreambooth_extension/issues/1405 https://github.com/d8ahazard/sd_dreambooth_extension/issues/1407

Checklist before requesting a review

fulleclip commented 7 months ago

My knowledge is not too extensive, do you mean that you have managed to solve the model loading problem? Could you explain better how to do it?

d8ahazard commented 7 months ago

Thanks!

fulleclip commented 7 months ago

okay, I just saw the modification of the file, I'm a little green on this, I'm going to try

fulleclip commented 7 months ago

After modifying the indicated files, dreambooth now does not load, these are the errors it shows

Exception importing api Traceback (most recent call last): File "D:\sd1\stable-diffusion-webui\extensions\sd_dreambooth_extension\scripts\api.py", line 27, in from dreambooth.dataclasses.db_config import from_file, DreamboothConfig File "D:\sd1\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\dataclasses\db_config.py", line 14, in from dreambooth.utils.image_utils import get_scheduler_names # noqa File "D:\sd1\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\utils\image_utils.py", line 138 try: ^ IndentationError: unindent does not match any outer indentation level *** Error loading script: main.py Traceback (most recent call last): File "D:\sd1\stable-diffusion-webui\modules\scripts.py", line 469, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "D:\sd1\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\sd1\stable-diffusion-webui\extensions\sd_dreambooth_extension\scripts\main.py", line 8, in from dreambooth.dataclasses.db_config import from_file, save_config File "D:\sd1\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\dataclasses\db_config.py", line 14, in from dreambooth.utils.image_utils import get_scheduler_names # noqa File "D:\sd1\stable-diffusion-webui\extensions\sd_dreambooth_extension\dreambooth\utils\image_utils.py", line 138 try: ^ IndentationError: unindent does not match any outer indentation level

RossM commented 7 months ago

After modifying the indicated files, dreambooth now does not load, these are the errors it shows

You should not need to modify anything, the change has been merged into the main branch. Just update your version. It sounds like you picked up another change I'm working on and screwed up the indentation.

fulleclip commented 7 months ago

perfect thanks, everything seems to work now