mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-05-01 03:31:21 +00:00
feat: add ad_save_images_dir (#689)
* feat: add `ad-save-images` https://github.com/Bing-su/adetailer/issues/688 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * feat: only enable `ad_save_images_dir` when not empty https://github.com/Bing-su/adetailer/pull/689#issuecomment-2300057990 * fix: F401 `pathlib.PurePath` imported but unused https://results.pre-commit.ci/run/github/632823919/1724229072.nxpHBQU4QvaIJ8IOFayT1Q --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -566,9 +566,14 @@ class AfterDetailerScript(scripts.Script):
|
|||||||
seed, _ = self.get_seed(p)
|
seed, _ = self.get_seed(p)
|
||||||
|
|
||||||
if opts.data.get(condition, False):
|
if opts.data.get(condition, False):
|
||||||
|
ad_save_images_dir = opts.data.get("ad_save_images_dir", None)
|
||||||
|
|
||||||
|
if not bool(ad_save_images_dir and ad_save_images_dir.strip()):
|
||||||
|
ad_save_images_dir = p.outpath_samples
|
||||||
|
|
||||||
images.save_image(
|
images.save_image(
|
||||||
image=image,
|
image=image,
|
||||||
path=p.outpath_samples,
|
path=ad_save_images_dir,
|
||||||
basename="",
|
basename="",
|
||||||
seed=seed,
|
seed=seed,
|
||||||
prompt=save_prompt,
|
prompt=save_prompt,
|
||||||
@@ -973,6 +978,16 @@ def on_ui_settings():
|
|||||||
.needs_reload_ui(),
|
.needs_reload_ui(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
shared.opts.add_option(
|
||||||
|
"ad_save_images_dir",
|
||||||
|
shared.OptionInfo(
|
||||||
|
default="",
|
||||||
|
label="Output directory for adetailer images",
|
||||||
|
component=gr.Textbox,
|
||||||
|
section=section,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
shared.opts.add_option(
|
shared.opts.add_option(
|
||||||
"ad_save_previews",
|
"ad_save_previews",
|
||||||
shared.OptionInfo(False, "Save mask previews", section=section),
|
shared.OptionInfo(False, "Save mask previews", section=section),
|
||||||
|
|||||||
Reference in New Issue
Block a user