Merge pull request #521 from Scholar01/mac

support for macOS.
This commit is contained in:
Vladimir Mandic
2023-04-26 15:55:04 -04:00
committed by GitHub
+15 -4
View File
@@ -320,12 +320,23 @@ 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": 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"),
"cuda_dtype": cuda_dtype,
"no_half": no_half,
"no_half_vae": no_half_vae,
"upcast_sampling": upcast_sampling,
"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 "),