add asyncio handler

This commit is contained in:
Vladimir Mandic
2023-04-26 16:08:56 -04:00
parent e83708284a
commit def7a02d82
2 changed files with 25 additions and 18 deletions
+6 -17
View File
@@ -1,8 +1,8 @@
import datetime
import json
import os
import sys
import time
import json
import datetime
import gradio as gr
import tqdm
@@ -321,23 +321,12 @@ options_templates.update(options_section(('saving-paths', "Image Paths"), {
"outdir_save": OptionInfo("outputs/save", "Directory for saving images using the Save button", component_args=hide_dirs),
}))
cuda_dtype = OptionInfo("FP16", "Device precision type", gr.Radio, lambda: {"choices": ["FP32", "FP16", "BF16"]})
no_half = OptionInfo(False, "Use full precision for model (--no-half)")
no_half_vae = OptionInfo(False, "Use full precision for VAE (--no-half-vae)")
upcast_sampling = OptionInfo(False,
"Enable upcast sampling. Usually produces similar results to --no-half with better performance while using less memory")
# support for macOS.
if sys.platform == "darwin":
cuda_dtype.default = "FP32"
upcast_sampling.default = True
options_templates.update(options_section(('cuda', "CUDA Settings"), {
"precision": OptionInfo("Autocast", "Precision type", gr.Radio, lambda: {"choices": ["Autocast", "Full"]}),
"cuda_dtype": cuda_dtype,
"no_half": no_half,
"no_half_vae": no_half_vae,
"upcast_sampling": upcast_sampling,
"cuda_dtype": OptionInfo("FP32" if sys.platform == "darwin" else "FP16", "Device precision type", gr.Radio, lambda: {"choices": ["FP32", "FP16", "BF16"]}),
"no_half": OptionInfo(False, "Use full precision for model (--no-half)"),
"no_half_vae": OptionInfo(False, "Use full precision for VAE (--no-half-vae)"),
"upcast_sampling": OptionInfo(True if sys.platform == "darwin" else False, "Enable upcast sampling. Usually produces similar results to --no-half with better performance while using less memory"),
"disable_nan_check": OptionInfo(True, "Do not check if produced images/latent spaces have NaN values"),
"rollback_vae": OptionInfo(False, "Attempt to roll back VAE when produced NaN values, requires NaN check (experimental)"),
"opt_channelslast": OptionInfo(False, "Use channels last as torch memory format "),