stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: extra networks lora errors / upscale doesn't work after sending image from inpainting

Open randomuser11956 opened this issue 2 years ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

Whenever i try to use a lora from the extra networks tab i get to this error

Also the webui now feels very slow and sluggish to use

Error completing request Arguments: ('task(hz3bvatp1g7sr2z)', 'mech robot, robot, android, lora:不是青花瓷第三代-但是机甲:1', '', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, [], 0, False, 7, 100, 'Constant', 0, 'Constant', 0, 4, False, False, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, None, 'Refresh models', <scripts.external_code.ControlNetUnit object at 0x000001F666A92140>, <scripts.external_code.ControlNetUnit object at 0x000001F666A91570>, <scripts.external_code.ControlNetUnit object at 0x000001F666A91420>, False, False, 'positive', 'comma', 0, False, False, '', 1, '', 0, '', 0, '', True, False, False, False, 0, None, False, None, False, None, False, 50) {} Traceback (most recent call last): File "E:\Stable Diffusion\stable-diffusion-webui\modules\call_queue.py", line 56, in f res = list(func(*args, **kwargs)) File "E:\Stable Diffusion\stable-diffusion-webui\modules\call_queue.py", line 37, in f res = func(*args, **kwargs) File "E:\Stable Diffusion\stable-diffusion-webui\modules\txt2img.py", line 56, in txt2img processed = process_images(p) File "E:\Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 486, in process_images res = process_images_inner(p) File "E:\Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 625, in process_images_inner uc = get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, p.steps, cached_uc) File "E:\Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 570, in get_conds_with_caching cache[1] = function(shared.sd_model, required_prompts, steps) File "E:\Stable Diffusion\stable-diffusion-webui\modules\prompt_parser.py", line 140, in get_learned_conditioning conds = model.get_learned_conditioning(texts) File "E:\Stable Diffusion\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 669, in get_learned_conditioning c = self.cond_stage_model(c) File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "E:\Stable Diffusion\stable-diffusion-webui\modules\sd_hijack_clip.py", line 229, in forward z = self.process_tokens(tokens, multipliers) File "E:\Stable Diffusion\stable-diffusion-webui\modules\sd_hijack_clip.py", line 254, in process_tokens z = self.encode_with_transformers(tokens) File "E:\Stable Diffusion\stable-diffusion-webui\modules\sd_hijack_clip.py", line 302, in encode_with_transformers outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=-opts.CLIP_stop_at_last_layers) File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 811, in forward return self.text_model( File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 721, in forward encoder_outputs = self.encoder( File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 650, in forward layer_outputs = encoder_layer( File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 379, in forward hidden_states, attn_weights = self.self_attn( File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 268, in forward query_states = self.q_proj(hidden_states) * self.scale File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "E:\Stable Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts......\extensions-builtin/Lora\lora.py", line 304, in lora_Linear_forward lora_apply_weights(self) File "E:\Stable Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts......\extensions-builtin/Lora\lora.py", line 272, in lora_apply_weights self.weight += lora_calc_updown(lora, module, self.weight) File "E:\Stable Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts......\extensions-builtin/Lora\lora.py", line 226, in lora_calc_updown down = module.down.weight.to(target.device, dtype=target.dtype) AttributeError: 'function' object has no attribute 'weight'

Also sometimes when i try to upscale i get this error (i only tried once today) yesterday everything was fine

Traceback (most recent call last): File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict output = await app.get_blocks().process_api( File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1075, in process_api result = await self.call_function( File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 884, in call_function prediction = await anyio.to_thread.run_sync( File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "E:\Stable Diffusion\stable-diffusion-webui\modules\generation_parameters_copypaste.py", line 70, in image_from_url_text if filedata.startswith("data:image/png;base64,"): AttributeError: 'NoneType' object has no attribute 'startswith'

Also sometimes the extranetworks tab can't be closed and it remains open on my gui

Yesterday everything worked, except i couldn't close the extranetworks tab

Commit hash: 4c1ad743e3baf1246db0711aa0107debf036a12b

side note: loras from additional networks for kohya ss work

Steps to reproduce the problem

  1. Go to extra networks tab

  2. Press lora

  3. Generate image

  4. Error

  5. From inpaint send image to extras

  6. Upscale

  7. Error

What should have happened?

The extranetworks tab should close when i click on the extranetworks image The loras from extranetworks tab should work when i input them into the prompt Upscaling images from inpaint send to extras should work

Commit where the problem happens

4c1ad743e3baf1246db0711aa0107debf036a12b

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--xformers --no-half-vae --ckpt-dir G:\sd\models --vae-dir G:\sd\VAE --esrgan-models-path G:\sd\esrgan --lora-dir G:\sd\lora

List of extensions

Stable-Diffusion-Webui-Civitai-Helper a1111-sd-webui-locon sd-dynamic-thresholding sd-webui-additional-networks sd-webui-controlnet

Console logs

E:\Stable Diffusion\stable-diffusion-webui>git pull
Already up to date.
venv "E:\Stable Diffusion\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: 4c1ad743e3baf1246db0711aa0107debf036a12b
Installing requirements for Web UI

Launching Web UI with arguments: --xformers --no-half-vae --ckpt-dir G:\sd\models --vae-dir G:\sd\VAE --esrgan-models-path G:\sd\esrgan --lora-dir G:\sd\lora
Civitai Helper: Get Custom Model Folder
Civitai Helper: Load setting from: E:\Stable Diffusion\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\setting.json
Civitai Helper: No setting file, use default
Additional Network extension not installed, Only hijack built-in lora
LoCon Extension hijack built-in lora successfully
[AddNet] Updating model hashes...
100%|███████████████████████████████████████████████████████████████████████████████| 84/84 [00:00<00:00, 16796.41it/s]
[AddNet] Updating model hashes...
100%|███████████████████████████████████████████████████████████████████████████████| 84/84 [00:00<00:00, 20992.76it/s]
Loading weights [c35782bad8] from G:\sd\models\realisticVisionV13_v13.safetensors
Creating model from config: E:\Stable Diffusion\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: G:\sd\VAE\vae-ft-mse-840000-ema-pruned.ckpt
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(5): bad-artist, bad_prompt, bad_prompt_version2, EasyNegative, ng_deepnegative_v1_75t
Textual inversion embeddings skipped(3): nartfixer, nfixer, nrealfixer
Model loaded in 26.0s (load weights from disk: 2.6s, create model: 0.4s, apply weights to model: 18.7s, apply half(): 0.5s, load VAE: 2.6s, move model to device: 0.6s, load textual inversion embeddings: 0.6s).
Running on local URL:  http://127.0.0.1:7860
Error completing request
Arguments: ('task(hz3bvatp1g7sr2z)', 'mech robot, robot, android,  <lora:不是青花瓷第三代-但是机甲:1>', '', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, [], 0, False, 7, 100, 'Constant', 0, 'Constant', 0, 4, False, False, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, 'LoRA', 'None', 1, 1, None, 'Refresh models', <scripts.external_code.ControlNetUnit object at 0x000001F666A92140>, <scripts.external_code.ControlNetUnit object at 0x000001F666A91570>, <scripts.external_code.ControlNetUnit object at 0x000001F666A91420>, False, False, 'positive', 'comma', 0, False, False, '', 1, '', 0, '', 0, '', True, False, False, False, 0, None, False, None, False, None, False, 50) {}
Traceback (most recent call last):
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\txt2img.py", line 56, in txt2img
    processed = process_images(p)
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 486, in process_images
    res = process_images_inner(p)
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 625, in process_images_inner
    uc = get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, p.steps, cached_uc)
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 570, in get_conds_with_caching
    cache[1] = function(shared.sd_model, required_prompts, steps)
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\prompt_parser.py", line 140, in get_learned_conditioning
    conds = model.get_learned_conditioning(texts)
  File "E:\Stable Diffusion\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 669, in get_learned_conditioning
    c = self.cond_stage_model(c)
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\sd_hijack_clip.py", line 229, in forward
    z = self.process_tokens(tokens, multipliers)
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\sd_hijack_clip.py", line 254, in process_tokens
    z = self.encode_with_transformers(tokens)
  File "E:\Stable Diffusion\stable-diffusion-webui\modules\sd_hijack_clip.py", line 302, in encode_with_transformers
    outputs = self.wrapped.transformer(input_ids=tokens, output_hidden_states=-opts.CLIP_stop_at_last_layers)
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 811, in forward
    return self.text_model(
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 721, in forward
    encoder_outputs = self.encoder(
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 650, in forward
    layer_outputs = encoder_layer(
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 379, in forward
    hidden_states, attn_weights = self.self_attn(
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\modeling_clip.py", line 268, in forward
    query_states = self.q_proj(hidden_states) * self.scale
  File "E:\Stable Diffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "E:\Stable Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\..\..\..\extensions-builtin/Lora\lora.py", line 304, in lora_Linear_forward
    lora_apply_weights(self)
  File "E:\Stable Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\..\..\..\extensions-builtin/Lora\lora.py", line 272, in lora_apply_weights
    self.weight += lora_calc_updown(lora, module, self.weight)
  File "E:\Stable Diffusion\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\..\..\..\extensions-builtin/Lora\lora.py", line 226, in lora_calc_updown
    down = module.down.weight.to(target.device, dtype=target.dtype)
AttributeError: 'function' object has no attribute 'weight'

Additional information

No response

randomuser11956 avatar Mar 26 '23 11:03 randomuser11956

slavikfoxy avatar Mar 26 '23 12:03 slavikfoxy

Ran to similar problem after the update.

Skydolphin112 avatar Mar 26 '23 13:03 Skydolphin112

Ran to similar problem after the update.

i think it's best for now to run an older commit version, saves you a ton of problems and headaches

randomuser11956 avatar Mar 26 '23 13:03 randomuser11956

Ran to similar problem after the update.

i think it's best for now to run an older commit version, saves you a ton of problems and headaches

Yeah, i Just rolled back to previous version work like magic >_<

Skydolphin112 avatar Mar 26 '23 16:03 Skydolphin112

The errors you're getting are related to the locon extension, not the webui.

Either way, the webui has now completely refactored extra networks since this issue was opened. Closing as stale.

catboxanon avatar Aug 11 '23 16:08 catboxanon