mirror of
https://github.com/Bing-su/adetailer.git
synced 2026-04-30 19:21:33 +00:00
fix: continue when NansException raised
This commit is contained in:
@@ -542,23 +542,25 @@ class AfterDetailerScript(scripts.Script):
|
|||||||
p2.image_mask = masks[j]
|
p2.image_mask = masks[j]
|
||||||
self.i2i_prompts_replace(p2, ad_prompts, ad_negatives, j)
|
self.i2i_prompts_replace(p2, ad_prompts, ad_negatives, j)
|
||||||
|
|
||||||
if not re.match(r"^\s*\[SKIP\]\s*$", p2.prompt):
|
if re.match(r"^\s*\[SKIP\]\s*$", p2.prompt):
|
||||||
if args.ad_controlnet_model == "None":
|
continue
|
||||||
cn_restore_unet_hook(p2, self.cn_latest_network)
|
|
||||||
|
|
||||||
try:
|
p2.seed = seed + j
|
||||||
processed = process_images(p2)
|
p2.subseed = subseed + j
|
||||||
except NansException as e:
|
|
||||||
msg = f"[-] ADetailer: 'NansException' occurred with {ordinal(n + 1)} settings.\n{e}"
|
|
||||||
print(msg, file=sys.stderr)
|
|
||||||
return False
|
|
||||||
|
|
||||||
self.compare_prompt(p2, processed, n=n)
|
if args.ad_controlnet_model == "None":
|
||||||
p2 = copy(i2i)
|
cn_restore_unet_hook(p2, self.cn_latest_network)
|
||||||
p2.init_images = [processed.images[0]]
|
|
||||||
|
|
||||||
p2.seed = seed + j + 1
|
try:
|
||||||
p2.subseed = subseed + j + 1
|
processed = process_images(p2)
|
||||||
|
except NansException as e:
|
||||||
|
msg = f"[-] ADetailer: 'NansException' occurred with {ordinal(n + 1)} settings.\n{e}"
|
||||||
|
print(msg, file=sys.stderr)
|
||||||
|
continue
|
||||||
|
|
||||||
|
self.compare_prompt(p2, processed, n=n)
|
||||||
|
p2 = copy(i2i)
|
||||||
|
p2.init_images = [processed.images[0]]
|
||||||
|
|
||||||
if processed is not None:
|
if processed is not None:
|
||||||
pp.image = processed.images[0]
|
pp.image = processed.images[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user