Engineer-of-Stuff / stable-diffusion-paperspace

Jupyter notebooks for Paperspace.
The Unlicense
289 stars 110 forks source link

[Help/Troubleshoot] How to set no-half-vae on paperspace? Other commandline arguments? #72

Closed RabblerouserGT closed 1 year ago

RabblerouserGT commented 1 year ago

I'm getting the following error on just txt2img, running on Free-RTX4000 GPU on Paperspace.


Arguments: ('task(d3d3yf65nabqje4)', 'cat', '', [], 30, 15, False, False, 1, 1, 8, -1.0, -1.0, 0, 0, 0, False, 768, 768, False, 0.7, 2, 'Latent', 0, 0, 0, [], 0, False, False, 'positive', 'comma', 0, False, False, '', 1, '', 0, '', 0, '', True, False, False, False, 0) {}
Traceback (most recent call last):
  File "/storage/stable-diffusion/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/storage/stable-diffusion/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/storage/stable-diffusion/stable-diffusion-webui/modules/txt2img.py", line 56, in txt2img
    processed = process_images(p)
  File "/storage/stable-diffusion/stable-diffusion-webui/modules/processing.py", line 486, in process_images
    res = process_images_inner(p)
  File "/storage/stable-diffusion/stable-diffusion-webui/modules/processing.py", line 632, in process_images_inner
    devices.test_for_nans(x, "vae")
  File "/storage/stable-diffusion/stable-diffusion-webui/modules/devices.py", line 152, in test_for_nans
    raise NansException(message)
modules.devices.NansException: A tensor with all NaNs was produced in VAE. This could be because there's not enough precision to represent the picture. Try adding --no-half-vae commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.```

I'm.. HALF familiar with what to do with on Windows, edit the .bat's command args but I'm not sure what sort of stuff paperspace (or Colab) does. If they inject their own arguments or if I can just change the .bat (... or the .sh since I'm fairly sure I saw linux stuff while code was running).
Cyberes commented 1 year ago

It goes in the launch block on the line with python3 webui.py.

But NaN is a pretty severe error. I'd dig a little deeper and make sure there isn't anything else going on. Maybe try recreating your machine?

KTrier commented 1 year ago

I avoided this NansException by adding the following text to "Launch the WebUI". (Since this notebook launches webui.py, I assume that the commandline arguments in webui-user.sh are not loaded.)

COMMANDLINE_ARGS = "--disable-nan-check --lowram"

# Launch args go below:
!python webui.py {x_arg} {dd_arg} {mvram_arg} {pickled} {port} {auth} {theme} {queue} {COMMANDLINE_ARGS}