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

[Bug]: UnboundLocalError: local variable 'extra_network_data' referenced before assignment

Open jonathanrbarney 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?

Using X/Y/Z with multiple checkpoint names on Y axis.

Variable is referenced in the context outside which it is defined

Steps to reproduce the problem

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8/modules/processing.py#L713

What should have happened?

The variable should only be referenced in the context in which it is defined.

Commit where the problem happens

0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8

What platforms do you use to access the UI ?

No response

What browsers do you use to access the UI ?

No response

Command Line Arguments

Does not matter.

List of extensions

Does not matter.

Console logs

Does not matter.

Additional information

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8/modules/processing.py#L713

jonathanrbarney avatar Feb 21 '23 08:02 jonathanrbarney

I think I got this error with controlnet when the resolution was something like 584 instead of 512. I think it may have been the same issue of not using a multiple of 64 for controlnet resolution? Not sure.

Edit: Disregard this I suppose, I can't reproduce it so I can't verify the claim.

CraigFedynich avatar Feb 28 '23 06:02 CraigFedynich

Same problem here, since I updated today, I am getting the same problem randomly every like 10th render.

same revision

My webui-user.bat @echo off

set PYTHON="C:\Users\t_reichmann\AppData\Local\Programs\Python\Python310\python.exe" set GIT= set VENV_DIR= set COMMANDLINE_ARGS=--medvram --skip-python-version-check --xformers set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.6,max_split_size_mb:128 git pull call webui.bat

tomasreichmann avatar Feb 28 '23 13:02 tomasreichmann

saw that error when the batch_size field was missing in the api call to sdapi/v1/txt2img. adding batch_size in the request fixed for my case.

thihamin avatar Mar 08 '23 07:03 thihamin

As a very quick and dirty hack (and since it's just the deactivation) I modified [stable-diffusion-webui/modules/processing.py] as follows:

    if not p.disable_extra_networks:
        extra_networks.deactivate(p, extra_network_data)

->

    if not p.disable_extra_networks:
        try: extra_networks.deactivate(p, extra_network_data)
        except UnboundLocalError: extra_networks.deactivate(p, [])  # GD

gdudek avatar Mar 19 '23 16:03 gdudek

Was resolved months ago in https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/f098e726d3e63aae8a6276ce83c55ac905c4379c.

catboxanon avatar Aug 11 '23 14:08 catboxanon