fix: wrong index issue 2

This commit is contained in:
Bingsu
2023-07-07 10:23:56 +09:00
parent b97005a812
commit 2689ba7169

View File

@@ -482,13 +482,14 @@ class AfterDetailerScript(scripts.Script):
)
def need_call_process(self, p) -> bool:
i = p._ad_idx_batch
i = p._ad_idx
bs = p.batch_size
return i == bs - 1
return i % bs == bs - 1
def need_call_postprocess(self, p) -> bool:
i = p._ad_idx_batch
return i == 0
i = p._ad_idx
bs = p.batch_size
return i % bs == 0
@rich_traceback
def process(self, p, *args_):
@@ -500,8 +501,6 @@ class AfterDetailerScript(scripts.Script):
extra_params = self.extra_params(arg_list)
p.extra_generation_params.update(extra_params)
p._ad_idx_batch = -1
def _postprocess_image(self, p, pp, args: ADetailerArgs, *, n: int = 0) -> bool:
"""
Returns
@@ -597,7 +596,6 @@ class AfterDetailerScript(scripts.Script):
return
p._ad_idx = getattr(p, "_ad_idx", -1) + 1
p._ad_idx_batch = getattr(p, "_ad_idx_batch", -1) + 1
init_image = copy(pp.image)
arg_list = self.get_args(p, *args_)