Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnboundLocalError: local variable 'model' referenced before assignment error when internet is turned off? #14

Open
wakariah opened this issue Nov 26, 2022 · 6 comments

Comments

@wakariah
Copy link

wakariah commented Nov 26, 2022

When I have no internet I get this error. UnboundLocalError: local variable 'model' referenced before assignment

Any easy way to fix this? I also know nothing about coding so maybe this is obvious

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users#\stable-diffusion-webui\modules\ui.py", line 185, in f
res = list(func(*args, **kwargs))
File "C:\Users#\stable-diffusion-webui\webui.py", line 57, in f
res = func(*args, **kwargs)
File "C:\Users#\stable-diffusion-webui\modules\txt2img.py", line 46, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "C:\Users#\stable-diffusion-webui\modules\scripts.py", line 317, in run
processed = script.run(p, *script_args)
File "C:\Users#\stable-diffusion-webui\extensions\multi-subject-render\scripts\multirender.py", line 244, in run
foreground_image_mask = sdmg.calculate_depth_map_for_waifus(foreground_image)
File "C:\Users#\stable-diffusion-webui\extensions/multi-subject-render/scripts/simple_depthmap.py", line 130, in calculate_depth_map_for_waifus
del model
UnboundLocalError: local variable 'model' referenced before assignment

this is what ive got

@wakariah wakariah changed the title Doesn't work when internet is turned off? UnboundLocalError: local variable 'model' referenced before assignment error when internet is turned off? Nov 26, 2022
@Extraltodeus
Copy link
Owner

Did you update the script? I had that error while I was developping it.

@wakariah
Copy link
Author

wakariah commented Nov 26, 2022

I did update it just now and I'm still getting it. but weirdly I only get the error if my internet is off yeah its so weird bc otherwise it's working very well but I know nothing even remotely about coding, I also disabled my other extensions so its not an interaction from what I can tell

@Extraltodeus
Copy link
Owner

This might be related to the midas repository. The error comes from the module that interacts with it. I am not sure to be able to solve it right away.

@wakariah
Copy link
Author

wakariah commented Nov 26, 2022

interesting, I was messing with the depth2image extension earlier with no problem, such a weird error. hope it isnt too hard to fix, good luck! let me know if you know any workarounds! thanks so much for the reply

@Extraltodeus
Copy link
Owner

somebody has found a fix to it lol
https://fr.reddit.com/r/StableDiffusion/comments/z4muxu/my_depth2mask_extension_is_ready_works_with_15/ixsggnr/?context=3

  1. in blocks.py def _make_pretrained_efficientnet_lite3, add source='local', after "tf_efficientnet_lite3",

  2. in webui folder create folders \rwightman\gen-efficientnet-pytorch and copy the repo from .cache\ torch\ hub\

I'll implement it as soon as I get back to it

@jstanley14
Copy link

I just updated this project and I am getting this error whenever I use any model except for midas_v21_small. I am connected to the internet fine and all the models download fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants