We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1b9faaa + de64146 commit c250d2aCopy full SHA for c250d2a
modules/processing.py
@@ -501,6 +501,9 @@ def infotext(iteration=0, position_in_batch=0):
501
if len(prompts) == 0:
502
break
503
504
+ if p.scripts is not None:
505
+ p.scripts.process_one(p, n)
506
+
507
with devices.autocast():
508
uc = prompt_parser.get_learned_conditioning(shared.sd_model, len(prompts) * [p.negative_prompt], p.steps)
509
c = prompt_parser.get_multicond_learned_conditioning(shared.sd_model, prompts, p.steps)
modules/scripts.py
@@ -73,6 +73,13 @@ def process(self, p, *args):
73
74
pass
75
76
+ def process_one(self, p, n, *args):
77
+ """
78
+ Same as process(), but called for every iteration
79
80
81
+ pass
82
83
def postprocess(self, p, processed, *args):
84
"""
85
This function is called after processing ends for AlwaysVisible scripts.
@@ -296,6 +303,15 @@ def process(self, p):
296
303
print(f"Error running process: {script.filename}", file=sys.stderr)
297
304
print(traceback.format_exc(), file=sys.stderr)
298
305
306
+ def process_one(self, p, n):
307
+ for script in self.alwayson_scripts:
308
+ try:
309
+ script_args = p.script_args[script.args_from:script.args_to]
310
+ script.process_one(p, n, *script_args)
311
+ except Exception:
312
+ print(f"Error running process_one: {script.filename}", file=sys.stderr)
313
+ print(traceback.format_exc(), file=sys.stderr)
314
299
315
def postprocess(self, p, processed):
300
316
for script in self.alwayson_scripts:
301
317
try:
0 commit comments