InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

[bug]: Server error: local variable 'path' referenced before assignment

Open adamkane opened this issue 3 years ago • 6 comments

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 avatar Dec 18 '22 03:12 adamkane

@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?

ebr avatar Dec 18 '22 05:12 ebr

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

Petri3D avatar Dec 22 '22 13:12 Petri3D

Same here... This error occurs many times to me. Screenshot_1

Windows 11 NVIDIA GeForce RTX 2060 SUPER (8GB)

BeF1990 avatar Dec 22 '22 19:12 BeF1990

Same problem, no one found why ?

Skinnox avatar Dec 22 '22 19:12 Skinnox

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?

ebr avatar Dec 30 '22 09:12 ebr

Same Problem, i just ran update.bat Anyway, where do i find the version number?

Brogrammierer avatar Dec 31 '22 11:12 Brogrammierer

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

mtlubins avatar Jan 08 '23 11:01 mtlubins

This is just a hunch, but have you checked the syntax of your prompt for missing parenthesis?

Petri3D avatar Jan 08 '23 12:01 Petri3D

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.

github-actions[bot] avatar Mar 14 '23 06:03 github-actions[bot]