fast-stable-diffusion icon indicating copy to clipboard operation
fast-stable-diffusion copied to clipboard

NameError: name 'os' is not defined

Open nlapenko opened this issue 1 year ago • 8 comments

Yesterday, I started the server after performing a fresh installation and setting everything up. I used it for an evening and closed it. However, this morning, I attempted to open the collab link but was unable to do so. I restarted the collab and selected "Start Stable-Diffusion," but encountered the following error: "NameError: name 'os' is not defined."

I believe this error may be due to a missing dependency or an issue with the code itself. I would appreciate any assistance you can provide in resolving this issue so that I can continue using the code. Снимок экрана 2023-03-03 в 01 34 54

nlapenko avatar Mar 02 '23 22:03 nlapenko

`--------------------------------------------------------------------------- NameError Traceback (most recent call last) in 16 17 with capture.capture_output() as cap: ---> 18 if not os.path.exists('/tools/node/bin/lt'): 19 get_ipython().system('npm install -g localtunnel') 20

NameError: name 'os' is not defined`

nlapenko avatar Mar 02 '23 22:03 nlapenko

Ok, it isn't apparent if you did this from what you wrote. That looks like the error you get when any of the above cells in colab has not been run. when you restart a colab after it has disconnected, you need to run every cell again. it's a fresh startup, you cannot just pause it.

I'm sorry if this was not what you were asking and it sounded patronizing but whenever I get that error, that is the only way.

Rb-diff avatar Mar 03 '23 02:03 Rb-diff

In other words, every time I need to use the stable diffusion interface, I need to restart all cells in the "fast_stable_diffusion_AUTOMATIC1111.ipynb" file. , not just the last one?

nlapenko avatar Mar 03 '23 07:03 nlapenko

@nlapenko Yes, because everytime you disconnect, the session is reset, so you need to bring back the session by running all the calls in order.

TheLastBen avatar Mar 03 '23 08:03 TheLastBen

Hi, I have a problem again. Sorry, I'm unlucky. After disconnecting the collab, started a new session from the first item. Everything was fine. But now I got an error on the last item: `No checkpoints found. When searching for checkpoints, looked at:

  • file /content/gdrive/MyDrive/sd/stable-diffusion-webui/model.ckpt
  • directory /content/gdrive/MyDrive/sd/stable-diffusion-webui/models/Stable-diffusion Can't run without a checkpoint. Find and place a .ckpt or .safetensors file into any of those locations. The program will exit. `

nlapenko avatar Mar 03 '23 15:03 nlapenko

check the box redownload original model? Screenshot 2023-03-03 163421

Rb-diff avatar Mar 03 '23 15:03 Rb-diff

I'm uploading the model via google disk with a link to it. Strangely enough, the problem solved itself after I restarted the last item 10 times in a row. Sorry for the inconvenience! Thanks.

nlapenko avatar Mar 03 '23 15:03 nlapenko

oh. here's a tip then. if you make any changes in your google drive. wait half a minute for it to take effecct and then press the little reload icon in the sidebar of the collab file structure. Google can be incredibly sluggish at updating and siometimes needs a little convincing.

Screenshot 2023-03-03 164350

Rb-diff avatar Mar 03 '23 15:03 Rb-diff