mirror of
https://github.com/denismhz/flake.git
synced 2025-11-09 16:16:23 +01:00
invokeai: add NixOS option for model precision
This commit is contained in:
parent
6bfc491e80
commit
11ab758490
|
|
@ -56,6 +56,12 @@ in
|
||||||
|
|
||||||
nsfwChecker = mkEnableOption "the NSFW Checker";
|
nsfwChecker = mkEnableOption "the NSFW Checker";
|
||||||
|
|
||||||
|
precision = mkOption {
|
||||||
|
description = "Set model precision.";
|
||||||
|
default = "auto";
|
||||||
|
type = types.enum [ "auto" "float32" "autocast" "float16" ];
|
||||||
|
};
|
||||||
|
|
||||||
extraArgs = mkOption {
|
extraArgs = mkOption {
|
||||||
description = "Extra command line arguments.";
|
description = "Extra command line arguments.";
|
||||||
default = [];
|
default = [];
|
||||||
|
|
@ -74,6 +80,7 @@ in
|
||||||
"--root_dir" cfg.dataDir
|
"--root_dir" cfg.dataDir
|
||||||
"--max_loaded_models" cfg.maxLoadedModels
|
"--max_loaded_models" cfg.maxLoadedModels
|
||||||
(yesno cfg.nsfwChecker "nsfw_checker")
|
(yesno cfg.nsfwChecker "nsfw_checker")
|
||||||
|
"--precision" cfg.precision
|
||||||
] ++ cfg.extraArgs;
|
] ++ cfg.extraArgs;
|
||||||
initialModelsPath = "${cfg.package}/${cfg.package.pythonModule.sitePackages}/invokeai/configs/INITIAL_MODELS.yaml";
|
initialModelsPath = "${cfg.package}/${cfg.package.pythonModule.sitePackages}/invokeai/configs/INITIAL_MODELS.yaml";
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue