mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-03-14 01:40:05 +00:00
feat: same seed option
This commit is contained in:
@@ -618,6 +618,11 @@ class AfterDetailerScript(scripts.Script):
|
||||
return p.init_images[0]
|
||||
return pp.image
|
||||
|
||||
@staticmethod
|
||||
def get_each_tap_seed(seed: int, i: int):
|
||||
use_same_seed = shared.opts.data.get("ad_same_seed_for_each_tap", False)
|
||||
return seed if use_same_seed else seed + i
|
||||
|
||||
@rich_traceback
|
||||
def process(self, p, *args_):
|
||||
if getattr(p, "_ad_disabled", False):
|
||||
@@ -697,8 +702,8 @@ class AfterDetailerScript(scripts.Script):
|
||||
if re.match(r"^\s*\[SKIP\]\s*$", p2.prompt):
|
||||
continue
|
||||
|
||||
p2.seed = seed + j
|
||||
p2.subseed = subseed + j
|
||||
p2.seed = self.get_each_tap_seed(seed, j)
|
||||
p2.subseed = self.get_each_tap_seed(subseed, j)
|
||||
|
||||
try:
|
||||
processed = process_images(p2)
|
||||
@@ -831,6 +836,13 @@ def on_ui_settings():
|
||||
),
|
||||
)
|
||||
|
||||
shared.opts.add_option(
|
||||
"ad_same_seed_for_each_tap",
|
||||
shared.OptionInfo(
|
||||
False, "Use same seed for each tab in adetailer", section=section
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
# xyz_grid
|
||||
|
||||
|
||||
Reference in New Issue
Block a user