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, on all models but midas_v21_small #39

Open
jstanley14 opened this issue Jan 11, 2023 · 8 comments

Comments

@jstanley14
Copy link

Traceback (most recent call last):
File "G:\sd-new\modules\call_queue.py", line 45, in f
res = list(func(*args, **kwargs))
File "G:\sd-new\modules\call_queue.py", line 28, in f
res = func(*args, **kwargs)
File "G:\sd-new\modules\txt2img.py", line 49, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "G:\sd-new\modules\scripts.py", line 337, in run
processed = script.run(p, *script_args)
File "G:\sd-new\extensions\multi-subject-render\scripts\multirender.py", line 263, in run
foreground_image_mask = sdmg.calculate_depth_map_for_waifus(foreground_image)
File "G:\sd-new\extensions/multi-subject-render/scripts/simple_depthmap.py", line 187, in calculate_depth_map_for_waifus
del model
UnboundLocalError: local variable 'model' referenced before assignment

This happens consistently when using any model except for midas_v21_small. All the models download fine, but the error happens after the foreground images are generated. midas_v21_small works fine. I saw the other issue with the same error, but that seems unrelated as my internet connection has no bearing here.

@madhack2142
Copy link

any updates?

@nishichi
Copy link

same problem

@Kaharos94
Copy link

I had the same issue, fixed it by deleting the midas folder in stable diffusion and downloading the newest MiDaS https://github.com/isl-org/MiDaS here.

@jstanley14
Copy link
Author

I had the same issue, fixed it by deleting the midas folder in stable diffusion and downloading the newest MiDaS https://github.com/isl-org/MiDaS here.

Not really sure what you mean, did you just download the weights specifically or did you clone that whole repo and do something with that? What did your folder structure end up being in stable-diffusion/models/midas?

@Kaharos94
Copy link

Sorry if I wasn't clear. I deleted everything in \stable-diffusion-webui\repositories\midas and cloned the repo in there. Haven't redownloaded the models.

@Vengyr
Copy link

Vengyr commented Feb 19, 2023

Same issue, cloning https://github.com/isl-org/MiDaS either into \stable-diffusion-webui\repositories\ or \stable-diffusion-webui\repositories\midas\ does nothing for me.

@JoaCHIP
Copy link

JoaCHIP commented Feb 28, 2023

Cloning midas did nothing here either. The only model that works is "midas_v21_small". The other three models fail.

@uraniumcrystalsmaster
Copy link

uraniumcrystalsmaster commented Mar 15, 2023

Cloning midas did nothing here either. The only model that works is "midas_v21_small". The other three models fail.

None of the models work for me after cloning midas. None of my other models downloaded load except for the pruned 1.5 stable diffusion, so that might be why.

Edit: The midas model works, so my issues are the same as yours.

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

7 participants