d8ahazard / sd_dreambooth_extension

Other
1.85k stars 283 forks source link

[Bug]: Can't create model using trained & generated model using dreambooth. #1451

Closed Deniryer closed 3 months ago

Deniryer commented 5 months ago

Is there an existing issue for this?

What happened?

Tested on A1111 & Vlad's fork.

Just finished training model with satisfactory results, so I wanted to move to another batch of concepts (since concept list won't work, always gives me same error to check prompt when attempting to use them) and I found out that model trained in Dreambooth literally breaks DB and model merging (apart from supermerger for some reason), however if does work and produce great outputs.

Steps to reproduce the problem

  1. Create model.
  2. Choose model previously trained with DB.
  3. Create new model.

Commit and libraries

Screenshot 2024-02-01 023728

Command Line Arguments

None.

Console logs

Using VENV: G:\SDNext\venv
02:35:33-829859 INFO     Starting SD.Next
02:35:33-830859 INFO     Logger: file="G:\SDNext\sdnext.log" level=INFO size=12413433 mode=append
02:35:33-831859 INFO     Python 3.11.6 on Windows
02:35:33-938314 INFO     Version: app=sd.next updated=2024-01-30 hash=9bf08c54
                         url=https://github.com/vladmandic/automatic/tree/master
02:35:34-379025 INFO     Platform: arch=AMD64 cpu=AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD system=Windows
                         release=Windows-10-10.0.22631-SP0 python=3.11.6
02:35:34-382024 INFO     nVidia CUDA toolkit detected: nvidia-smi present
02:35:35-634099 WARNING  Deleted files: ['modules/lora', '"Merged model loaded"']
02:35:35-685855 INFO     Extensions: disabled=['sd-webui-controlnet', 'stable-diffusion-webui-images-browser',
                         'sd-extension-chainner', 'sd-extension-system-info', 'sd-extension-rembg']
02:35:35-688860 INFO     Extensions: enabled=['Lora', 'sd-webui-agent-scheduler', 'stable-diffusion-webui-rembg']
                         extensions-builtin
02:35:35-690861 INFO     Extensions: enabled=['adetailer', 'sd-webui-infinite-image-browsing', 'sd-webui-supermerger',
                         'sd_dreambooth_extension'] extensions
02:35:35-693860 INFO     Startup: standard
02:35:35-695429 INFO     Verifying requirements
02:35:35-704368 INFO     Verifying packages
02:35:35-705871 WARNING  Uninstalling: bitsandbytes
02:35:36-200507 INFO     Verifying submodules
02:35:55-239844 INFO     Extension installed packages: sd_dreambooth_extension ['bitsandbytes==0.41.2.post2']
02:35:55-240844 INFO     Extensions enabled: ['Lora', 'sd-webui-agent-scheduler', 'stable-diffusion-webui-rembg',
                         'adetailer', 'sd-webui-infinite-image-browsing', 'sd-webui-supermerger',
                         'sd_dreambooth_extension']
02:35:55-241843 INFO     Verifying requirements
02:35:55-255861 INFO     Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
02:35:55-256866 INFO     Command line args: []
02:35:57-384494 INFO     Load packages: torch=2.1.2+cu121 diffusers=0.25.0 gradio=3.43.2
02:35:57-987732 INFO     Engine: backend=Backend.ORIGINAL compute=cuda mode=no_grad device=cuda
                         cross-optimization="xFormers"
02:35:58-027697 INFO     Device: device=NVIDIA GeForce RTX 4090 n=1 arch=sm_90 cap=(8, 9) cuda=12.1 cudnn=8801
                         driver=551.23
02:36:00-158490 INFO     Available VAEs: path="G:\AI\VAE" items=2
02:36:00-159493 INFO     Disabled extensions: ['sd-extension-chainner', 'sd-extension-system-info',
                         'sd-webui-controlnet', 'stable-diffusion-webui-images-browser']
02:36:00-170057 INFO     Available models: path="G:\AI\SD_Models" items=38 time=0.01
02:36:00-372554 INFO     Extension: script='scripts\faceid.py' [2;36m02:36:00-371552[0m[2;36m [0m[1;31mERROR   [0m
                         FaceID: No module named [32m'insightface'[0m
02:36:01-270436 INFO     Extension: script='extensions-builtin\sd-webui-agent-scheduler\scripts\task_scheduler.py' Using                         sqlite file: extensions-builtin\sd-webui-agent-scheduler\task_scheduler.sqlite3
02:36:02-093732 INFO     Extension: script='extensions\adetailer\scripts\!adetailer.py' [-] ADetailer initialized.
                         version: 24.1.2, num models: 9
02:36:02-308448 INFO     Extensions time: 1.98 { SDNext=0.06 Lora=0.45 sd-webui-agent-scheduler=0.43 adetailer=0.82
                         sd-webui-supermerger=0.13 sd_dreambooth_extension=0.05 }
02:36:02-343973 INFO     Load UI theme: name="black-teal" style=Auto base=sdnext.css
02:36:02-713192 INFO     Available models: path="G:\AI\SD_Models" items=38 time=0.00
bin G:\SDNext\venv\Lib\site-packages\bitsandbytes\libbitsandbytes_cuda121.dll
02:36:03-682552 INFO     Local URL: http://127.0.0.1:7860/
02:36:03-683552 INFO     Initializing middleware
02:36:04-040518 INFO     [AgentScheduler] Task queue is empty
02:36:04-041520 INFO     [AgentScheduler] Registering APIs
02:36:04-140013 INFO     Startup time: 8.88 { torch=1.31 gradio=0.79 libraries=2.77 extensions=1.98 face-restore=0.16
                         ui-extra-networks=0.12 ui-settings=0.10 ui-extensions=0.83 launch=0.16 api=0.34
                         app-started=0.11 }
Traceback (most recent call last):
  File "G:\SDNext\venv\Lib\site-packages\gradio\queueing.py", line 388, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\route_utils.py", line 219, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1435, in process_api
    inputs = self.preprocess_data(fn_index, inputs, state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1228, in preprocess_data
    self.validate_inputs(fn_index, inputs)
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1215, in validate_inputs
    raise ValueError(
ValueError: An event handler didn't receive enough input values (needed: 1, got: 0).
Check if the event handler calls a Javascript function, and make sure its return value is correct.
Wanted inputs:
    [slider]
Received inputs:
    []
Traceback (most recent call last):
  File "G:\SDNext\venv\Lib\site-packages\gradio\queueing.py", line 388, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\route_utils.py", line 219, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1437, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1083, in call_function
    assert block_fn.fn, f"function with index {fn_index} not defined."
AssertionError: function with index 761 not defined.
Traceback (most recent call last):
  File "G:\SDNext\venv\Lib\site-packages\gradio\queueing.py", line 388, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\route_utils.py", line 219, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1435, in process_api
    inputs = self.preprocess_data(fn_index, inputs, state)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1228, in preprocess_data
    self.validate_inputs(fn_index, inputs)
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1215, in validate_inputs
    raise ValueError(
ValueError: An event handler didn't receive enough input values (needed: 1, got: 0).
Check if the event handler calls a Javascript function, and make sure its return value is correct.
Wanted inputs:
    [slider]
Received inputs:
    []
Traceback (most recent call last):
  File "G:\SDNext\venv\Lib\site-packages\gradio\queueing.py", line 388, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\route_utils.py", line 219, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1437, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\SDNext\venv\Lib\site-packages\gradio\blocks.py", line 1083, in call_function
    assert block_fn.fn, f"function with index {fn_index} not defined."
AssertionError: function with index 761 not defined.

Additional information

Screenshot 2024-02-01 023919
Deniryer commented 5 months ago

Still getting some error & issues.

Screenshot 2024-02-06 224225 Screenshot 2024-02-06 224344
Deniryer commented 4 months ago

It have to be a issue with diffusers 26.0+. Checked generated checkpoints in InvokeAI. It refused to convert/unpacking/extracting them into diffusers form but it does work with original backend. Same goes for merging original checkpoint with fine tunned one.

Vlad's fork switched to diffusers backend end won't even load this checkpoint, merging it with anything doesn't solve it either.

I guess I'll have wait for a Diffusers 26.3 or 27 to fix it :/

Screenshot 2024-02-11 183547 Screenshot 2024-02-11 183610
github-actions[bot] commented 4 months ago

This issue is stale because it has been open for 14 days with no activity. Remove stale label or comment or this will be closed in 30 days