Extraltodeus / multi-subject-render

Generate multiple complex subjects all at once!
368 stars 26 forks source link

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

Open wakariah opened 1 year ago

wakariah commented 1 year ago

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

Extraltodeus commented 1 year ago

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

wakariah commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.