diff options
author | brkirch <brkirch@users.noreply.github.com> | 2023-01-25 04:51:45 +0000 |
---|---|---|
committer | brkirch <brkirch@users.noreply.github.com> | 2023-01-25 06:13:02 +0000 |
commit | 84d9ce30cb427759547bc7876ed80ab91787d175 (patch) | |
tree | a87ca1a7094ca9b7af4e573a211b1dcf8146af67 /modules/shared.py | |
parent | 48a15821de768fea76e66f26df83df3fddf18f4b (diff) | |
download | stable-diffusion-webui-gfx803-84d9ce30cb427759547bc7876ed80ab91787d175.tar.gz stable-diffusion-webui-gfx803-84d9ce30cb427759547bc7876ed80ab91787d175.tar.bz2 stable-diffusion-webui-gfx803-84d9ce30cb427759547bc7876ed80ab91787d175.zip |
Add option for float32 sampling with float16 UNet
This also handles type casting so that ROCm and MPS torch devices work correctly without --no-half. One cast is required for deepbooru in deepbooru_model.py, some explicit casting is required for img2img and inpainting. depth_model can't be converted to float16 or it won't work correctly on some systems (it's known to have issues on MPS) so in sd_models.py model.depth_model is removed for model.half().
Diffstat (limited to 'modules/shared.py')
-rw-r--r-- | modules/shared.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/shared.py b/modules/shared.py index 5f713bee..4ce1209b 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -45,6 +45,7 @@ parser.add_argument("--lowram", action='store_true', help="load stable diffusion parser.add_argument("--always-batch-cond-uncond", action='store_true', help="disables cond/uncond batching that is enabled to save memory with --medvram or --lowvram")
parser.add_argument("--unload-gfpgan", action='store_true', help="does not do anything.")
parser.add_argument("--precision", type=str, help="evaluate at this precision", choices=["full", "autocast"], default="autocast")
+parser.add_argument("--upcast-sampling", action='store_true', help="upcast sampling. No effect with --no-half. Usually produces similar results to --no-half with better performance while using less memory.")
parser.add_argument("--share", action='store_true', help="use share=True for gradio and make the UI accessible through their site")
parser.add_argument("--ngrok", type=str, help="ngrok authtoken, alternative to gradio --share", default=None)
parser.add_argument("--ngrok-region", type=str, help="The region in which ngrok should start.", default="us")
|