diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-08-23 21:38:53 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-08-23 21:38:53 +0000 |
commit | 81087207bc62026a3e6941553bf98f2da8c799d0 (patch) | |
tree | b2d35723fff482a407986b80e1818c5b444a3c93 /webui.py | |
parent | 7fd0f3166111c552a2ed4ee1d221583ff5cc1124 (diff) | |
download | stable-diffusion-webui-gfx803-81087207bc62026a3e6941553bf98f2da8c799d0.tar.gz stable-diffusion-webui-gfx803-81087207bc62026a3e6941553bf98f2da8c799d0.tar.bz2 stable-diffusion-webui-gfx803-81087207bc62026a3e6941553bf98f2da8c799d0.zip |
--no-half commandline option to disable .half()
Diffstat (limited to 'webui.py')
-rw-r--r-- | webui.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -46,6 +46,7 @@ parser.add_argument("--ckpt", type=str, default="models/ldm/stable-diffusion-v1/ parser.add_argument("--precision", type=str, help="evaluate at this precision", choices=["full", "autocast"], default="autocast")
parser.add_argument("--gfpgan-dir", type=str, help="GFPGAN directory", default='./GFPGAN')
parser.add_argument("--no-verify-input", action='store_true', help="do not verify input to check if it's too long")
+parser.add_argument("--no-half", action='store_true', help="do not switch the model to 16-bit floats")
opt = parser.parse_args()
GFPGAN_dir = opt.gfpgan_dir
@@ -144,7 +145,7 @@ config = OmegaConf.load("configs/stable-diffusion/v1-inference.yaml") model = load_model_from_config(config, "models/ldm/stable-diffusion-v1/model.ckpt")
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
-model = model.half().to(device)
+model = (model if opt.no_half else model.half()).to(device)
def image_grid(imgs, batch_size, round_down=False):
|