@@ -73,9 +73,15 @@ def process(self, p, *args):
73
73
74
74
pass
75
75
76
- def process_one (self , p , n , * args ):
76
+ def process_batch (self , p , * args , ** kwargs ):
77
77
"""
78
- Same as process(), but called for every iteration
78
+ Same as process(), but called for every batch.
79
+
80
+ **kwargs will have those items:
81
+ - batch_number - index of current batch, from 0 to number of batches-1
82
+ - prompts - list of prompts for current batch; you can change contents of this list but changing the number of entries will likely break things
83
+ - seeds - list of seeds for current batch
84
+ - subseeds - list of subseeds for current batch
79
85
"""
80
86
81
87
pass
@@ -303,13 +309,13 @@ def process(self, p):
303
309
print (f"Error running process: { script .filename } " , file = sys .stderr )
304
310
print (traceback .format_exc (), file = sys .stderr )
305
311
306
- def process_one (self , p , n ):
312
+ def process_batch (self , p , ** kwargs ):
307
313
for script in self .alwayson_scripts :
308
314
try :
309
315
script_args = p .script_args [script .args_from :script .args_to ]
310
- script .process_one (p , n , * script_args )
316
+ script .process_batch (p , * script_args , ** kwargs )
311
317
except Exception :
312
- print (f"Error running process_one : { script .filename } " , file = sys .stderr )
318
+ print (f"Error running process_batch : { script .filename } " , file = sys .stderr )
313
319
print (traceback .format_exc (), file = sys .stderr )
314
320
315
321
def postprocess (self , p , processed ):
0 commit comments