aboutsummaryrefslogtreecommitdiff
path: root/modules/api
diff options
context:
space:
mode:
authorVladimir Mandic <mandic00@live.com>2023-03-04 17:51:37 -0500
committerGitHub <noreply@github.com>2023-03-04 17:51:37 -0500
commitb012d70f15641d6b85c9257b83cec892e941609c (patch)
treecda1c34c954b685c19303d27791c4cd1511e64ae /modules/api
parentf8e219bad9f33cde94cd31fff3edd70946612541 (diff)
update using original defaults
Diffstat (limited to 'modules/api')
-rw-r--r--modules/api/api.py17
-rw-r--r--modules/api/models.py6
2 files changed, 15 insertions, 8 deletions
diff --git a/modules/api/api.py b/modules/api/api.py
index 7da9081b..a6bb439c 100644
--- a/modules/api/api.py
+++ b/modules/api/api.py
@@ -180,8 +180,8 @@ class Api:
populate = txt2imgreq.copy(update={ # Override __init__ params
"sampler_name": validate_sampler_name(txt2imgreq.sampler_name or txt2imgreq.sampler_index),
- "do_not_save_samples": True if not 'do_not_save_samples' in vars(txt2imgreq) else txt2imgreq.do_not_save_samples,
- "do_not_save_grid": True if not 'do_not_save_grid' in vars(txt2imgreq) else txt2imgreq.do_not_save_grid,
+ "do_not_save_samples": txt2imgreq.do_not_save,
+ "do_not_save_grid": txt2imgreq.do_not_save,
}
)
if populate.sampler_name:
@@ -190,8 +190,9 @@ class Api:
args = vars(populate)
args.pop('script_name', None)
- send_images = True if not 'do_not_send_images' in args else not args['do_not_send_images']
- args.pop('do_not_send_images', None)
+ send_images = True if not 'do_not_send' in args else not args['do_not_send']
+ args.pop('do_not_send', None)
+ args.pop('do_not_save', None)
with self.queue_lock:
p = StableDiffusionProcessingTxt2Img(sd_model=shared.sd_model, **args)
@@ -223,8 +224,8 @@ class Api:
populate = img2imgreq.copy(update={ # Override __init__ params
"sampler_name": validate_sampler_name(img2imgreq.sampler_name or img2imgreq.sampler_index),
- "do_not_save_samples": True if not 'do_not_save_samples' in img2imgreq else img2imgreq.do_not_save_samples,
- "do_not_save_grid": True if not 'do_not_save_grid' in img2imgreq else img2imgreq.do_not_save_grid,
+ "do_not_save_samples": img2imgreq.do_not_save,
+ "do_not_save_grid": img2imgreq.do_not_save,
"mask": mask
}
)
@@ -235,6 +236,10 @@ class Api:
args.pop('include_init_images', None) # this is meant to be done by "exclude": True in model, but it's for a reason that I cannot determine.
args.pop('script_name', None)
+ send_images = True if not 'do_not_send' in args else not args['do_not_send']
+ args.pop('do_not_send', None)
+ args.pop('do_not_save', None)
+
send_images = True if not 'do_not_send_images' in args else not args['do_not_send_images']
args.pop('do_not_send_images', None)
diff --git a/modules/api/models.py b/modules/api/models.py
index aa4ea5d5..2b66e1f0 100644
--- a/modules/api/models.py
+++ b/modules/api/models.py
@@ -104,7 +104,8 @@ StableDiffusionTxt2ImgProcessingAPI = PydanticModelGenerator(
{"key": "sampler_index", "type": str, "default": "Euler"},
{"key": "script_name", "type": str, "default": None},
{"key": "script_args", "type": list, "default": []},
- {"key": "do_not_send_images", "type": bool, "default": False}
+ {"key": "do_not_send", "type": bool, "default": False},
+ {"key": "do_not_save", "type": bool, "default": True}
]
).generate_model()
@@ -119,7 +120,8 @@ StableDiffusionImg2ImgProcessingAPI = PydanticModelGenerator(
{"key": "include_init_images", "type": bool, "default": False, "exclude" : True},
{"key": "script_name", "type": str, "default": None},
{"key": "script_args", "type": list, "default": []},
- {"key": "do_not_send_images", "type": bool, "default": False}
+ {"key": "do_not_send", "type": bool, "default": False},
+ {"key": "do_not_save", "type": bool, "default": True}
]
).generate_model()