hako-mikan / sd-webui-supermerger

model merge extention for stable diffusion web ui
GNU Affero General Public License v3.0
735 stars 109 forks source link

Extract from two LoRAs always reproduces first LoRA #345

Closed belladoreai closed 6 months ago

belladoreai commented 7 months ago

It seems that no matter what settings I use, the result from "extract from two LoRAs" ends up being just LoraB as it is. I don't understand why this happens. I'm guessing I have some setting incorrectly somewhere? Can someone provide an example of how to use this feature properly?

Here's an example of how I'm trying to use it (I have tried many settings, result always same):

Shouldn't these settings produce the most dissimilar features from loraC? But even with these settings the end result is just loraB.

hako-mikan commented 6 months ago

Thanks reporting, fixed.

belladoreai commented 6 months ago

Looks like something broke with the latest update (or possibly an earlier update; I was not on the latest version before updating). When I click the supermerger tab, click the LoRA tab, and then click "update list", I get the following error:

Traceback (most recent call last):
  File "C:\...\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\...\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "C:\...\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\...\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\...\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\...\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\...\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\...\stable-diffusion-webui\extensions\sd-webui-supermerger\scripts\mergers\pluslora.py", line 197, in updateloras
    selectable = toselect(ldict)
  File "C:\...\stable-diffusion-webui\extensions\sd-webui-supermerger\scripts\mergers\pluslora.py", line 180, in toselect
    dim, ltype, sdver = vals
ValueError: not enough values to unpack (expected 3, got 0)
hako-mikan commented 6 months ago

@belladoreai Fixed.

belladoreai commented 6 months ago

Now when I click the update button, I no longer get an error, but the list of LoRAs renders as an empty list (even though there are a bunch of LoRAs).

loras-on-disk

hako-mikan commented 6 months ago

When launched, does it display a list of LoRAs on disk for which dims have not been calculated?

belladoreai commented 6 months ago

When launched, does it display a list of LoRAs on disk for which dims have not been calculated?

Yes.

hako-mikan commented 6 months ago

Thanks, fixed.

belladoreai commented 6 months ago

Now the update button seems to work, but it no longer lists the dims (or whatever information was previously listed) after each LoRA. The list now only shows the name for each LoRA. Not sure if this is intended or not. I don't see any errors.

hako-mikan commented 6 months ago

Does the calculate button not work?

belladoreai commented 6 months ago

Does the calculate button not work?

Ah, that works. Thanks! I think previously the update button was doing that work, not sure.

belladoreai commented 6 months ago

I made some test merges and I can confirm that I'm now at least seeing different results with different parameters. So I believe it's now working, although the results are a little bit funny, but maybe that's just because I don't fully understand how these merges work and what the results are supposed to look like.

Thanks for the fixes.