[bug]: Server error: local variable 'path' referenced before assignment
Is there an existing issue for this?
- [X] I have searched the existing issues
OS
Windows
GPU
cuda
VRAM
No response
What happened?
2022-12-17T17:45:41-1000:
Server error: local variable 'path' referenced before assignment
2022-12-17T17:45:49-1000:
Image generation requested: {"prompt":"a kid and a wolf playing in the snow, illustrated digital art, concept art, bright, sunlight, winter, digital painting, art by John Sweeney and Laura H. Rubin and Android Jones, featured on artstatlon, award winning","iterations":5,"steps":50,"cfg_scale":7.5,"threshold":0,"perlin":0,"height":512,"width":512,"sampler_name":"k_lms","seed":2489623596,"progress_images":false,"progress_latents":true,"save_intermediates":5,"generation_mode":"unifiedCanvas","init_mask":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPm...","fit":false,"strength":0.73,"invert_mask":false,"bounding_box":{"x":64,"y":384,"width":128,"height":128},"init_img":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPm...","inpaint_width":512,"inpaint_height":512,"seam_size":96,"seam_blur":16,"seam_strength":0.7,"seam_steps":10,"tile_size":32,"infill_method":"patchmatch","force_outpaint":false,"variation_amount":0}
2022-12-17T17:45:52-1000:
Server error: local variable 'path' referenced before assignment
2022-12-17T17:45:55-1000:
Image generation requested: {"prompt":"a kid and a wolf playing in the snow, illustrated digital art, concept art, bright, sunlight, winter, digital painting, art by John Sweeney and Laura H. Rubin and Android Jones, featured on artstatlon, award winning","iterations":5,"steps":50,"cfg_scale":7.5,"threshold":0,"perlin":0,"height":512,"width":512,"sampler_name":"k_lms","seed":2489623596,"progress_images":false,"progress_latents":true,"save_intermediates":5,"generation_mode":"unifiedCanvas","init_mask":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPm...","fit":false,"strength":0.73,"invert_mask":false,"bounding_box":{"x":64,"y":384,"width":128,"height":128},"init_img":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPm...","inpaint_width":512,"inpaint_height":512,"seam_size":96,"seam_blur":16,"seam_strength":0.7,"seam_steps":10,"tile_size":32,"infill_method":"patchmatch","force_outpaint":false,"variation_amount":0}
2022-12-17T17:45:58-1000:
Server error: local variable 'path' referenced before assignment
Screenshots
No response
Additional context
No response
Contact Details
No response
@AdamKane thank you for reporting the bug, sorry you're running into this. Does the image still get generated? When did you install InvokeAI, and did you customize any paths during installation?
I have the same problem. The image generation stops at this.
Generating: 40%|████████████████████████████▍ | 4/10 [01:17<01:56, 19.40s/it] local variable 'path' referenced before assignment
Traceback (most recent call last): File "d:\invokeai.venv\lib\site-packages\backend\invoke_ai_web_server.py", line 1125, in generate_images self.generate.prompt2image( File "d:\invokeai.venv\lib\site-packages\ldm\generate.py", line 492, in prompt2image results = generator.generate( File "d:\invokeai.venv\lib\site-packages\ldm\invoke\generator\base.py", line 101, in generate image = self.safety_check(image) File "d:\invokeai.venv\lib\site-packages\ldm\invoke\generator\base.py", line 294, in safety_check return self.blur(image) File "d:\invokeai.venv\lib\site-packages\ldm\invoke\generator\base.py", line 301, in blur caution = self.get_caution_img() File "d:\invokeai.venv\lib\site-packages\ldm\invoke\generator\base.py", line 318, in get_caution_img if not path: UnboundLocalError: local variable 'path' referenced before assignment
Same here... This error occurs many times to me.

Windows 11 NVIDIA GeForce RTX 2060 SUPER (8GB)
Same problem, no one found why ?
This seems to be related to the NSFW checker. Which release are you running - could you please try upgrading to 2.2.5 and see if this is still happening?
Same Problem, i just ran update.bat Anyway, where do i find the version number?
same here
Traceback (most recent call last):
File "C:\Users\mtlub\invokeai\.venv\lib\site-packages\backend\invoke_ai_web_server.py", line 1125, in generate_images
self.generate.prompt2image(
File "C:\Users\mtlub\invokeai\.venv\lib\site-packages\ldm\generate.py", line 492, in prompt2image
results = generator.generate(
File "C:\Users\mtlub\invokeai\.venv\lib\site-packages\ldm\invoke\generator\base.py", line 101, in generate
image = self.safety_check(image)
File "C:\Users\mtlub\invokeai\.venv\lib\site-packages\ldm\invoke\generator\base.py", line 294, in safety_check
return self.blur(image)
File "C:\Users\mtlub\invokeai\.venv\lib\site-packages\ldm\invoke\generator\base.py", line 301, in blur
caution = self.get_caution_img()
File "C:\Users\mtlub\invokeai\.venv\lib\site-packages\ldm\invoke\generator\base.py", line 318, in get_caution_img
if not path:
UnboundLocalError: local variable 'path' referenced before assignment
fresh recent release install
This is just a hunch, but have you checked the syntax of your prompt for missing parenthesis?
There has been no activity in this issue for 14 days. If this issue is still being experienced, please reply with an updated confirmation that the issue is still being experienced with the latest release.