lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.2k stars 805 forks source link

AssertionError: BNB bad weight without parent layer! BNB bad weight without parent layer! #1197

Closed elen07zz closed 1 month ago

elen07zz commented 2 months ago

Using the latest commit 2f0555f7dc3f2d06b3a3cc238a4fa2b72e11e28d I get this error when I use a Lora. Using either of these two modelsl: flux1-dev-bnb-nf4-v2 and flux-dev-Q8_0.ggguf

Patching LoRAs:   0%|                                                                          | 0/304 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "D:\stable-diffusion-webui-forge\modules_forge\main_thread.py", line 30, in work
    self.result = self.func(*self.args, **self.kwargs)
  File "D:\stable-diffusion-webui-forge\modules\txt2img.py", line 110, in txt2img_function
    processed = processing.process_images(p)
  File "D:\stable-diffusion-webui-forge\modules\processing.py", line 809, in process_images
    res = process_images_inner(p)
  File "D:\stable-diffusion-webui-forge\modules\processing.py", line 952, in process_images_inner
    samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
  File "D:\stable-diffusion-webui-forge\modules\processing.py", line 1323, in sample
    samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
  File "D:\stable-diffusion-webui-forge\modules\sd_samplers_kdiffusion.py", line 194, in sample
    sampling_prepare(self.model_wrap.inner_model.forge_objects.unet, x=x)
  File "D:\stable-diffusion-webui-forge\backend\sampling\sampling_function.py", line 356, in sampling_prepare
    memory_management.load_models_gpu(
  File "D:\stable-diffusion-webui-forge\backend\memory_management.py", line 575, in load_models_gpu
    loaded_model.model_load(model_gpu_memory_when_using_cpu_swap)
  File "D:\stable-diffusion-webui-forge\backend\memory_management.py", line 384, in model_load
    raise e
  File "D:\stable-diffusion-webui-forge\backend\memory_management.py", line 380, in model_load
    self.real_model = self.model.forge_patch_model(patch_model_to)
  File "D:\stable-diffusion-webui-forge\backend\patcher\base.py", line 228, in forge_patch_model
    self.lora_loader.refresh(target_device=target_device, offload_device=self.offload_device)
  File "D:\stable-diffusion-webui-forge\backend\patcher\lora.py", line 320, in refresh
    assert weight.module is not None, 'BNB bad weight without parent layer!'
AssertionError: BNB bad weight without parent layer!
BNB bad weight without parent layer!
al3dv2 commented 2 months ago

Same

HelloWarcraft commented 2 months ago

same here.

neurocore1 commented 2 months ago

same

Greywolf665 commented 2 months ago

same - also, when I get a lora to load it doesn't change the image anymore. Yesterday it worked fine, but I updated Forge today - guess something broke. The swap location seems to make a difference too, although I can't see a clear pattern yet.

haqthat commented 2 months ago

I had to revert two commits back to get it going again.

git checkout 394da01959ae09acca361dc2be0e559ca26829d4

HelloWarcraft commented 2 months ago

I tried git checkout command, swith to the repo of several hours ago:

git clone https://github.com/lllyasviel/stable-diffusion-webui-forge
cd ~/stable-diffusion-webui-forge
git checkout 6e6e5c21622a02f6978b0ed21e4a9557c8b49913 # commit at "do some profile on 3090", avoid "AssertionError: BNB bad weight"

Then the "Patching LoRAs" process goes fine:

[Memory Management] Estimated Remaining GPU Memory: 7657.46 MB
Patching LoRAs: 100%|███████████████████████████| 76/76 [00:06<00:00, 10.89it/s]
LoRA patching has taken 6.98 seconds
rbrtwtrs commented 2 months ago

Same

E2GO commented 2 months ago

Same

Tom-Neverwinter commented 2 months ago

I had to revert two commits back to get it going again.

git checkout 394da01959ae09acca361dc2be0e559ca26829d4

made a alternative run.bat so people can hop back to that specific version https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/1216

Temp solution: change run.bat file then change to commit: 394da01959ae09acca361dc2be0e559ca26829d4

Pandacorexy commented 2 months ago

same problem

AdamNizol commented 2 months ago

new update seems to have fixed it

rbrtwtrs commented 2 months ago

Can confirm. All better now.