mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-18 01:30:02 +00:00
Update accel_sdxl_gen_img.py
This commit is contained in:
@@ -2487,7 +2487,7 @@ def main(args):
|
||||
logger.info(f"prompt {prompt_index+1}/{len(prompt_list)}: {prompt}")
|
||||
|
||||
for parg in prompt_args[1:]:
|
||||
if distributed_state.is_main_process:
|
||||
|
||||
try:
|
||||
m = re.match(r"w (\d+)", parg, re.IGNORECASE)
|
||||
if m:
|
||||
@@ -2827,12 +2827,11 @@ def main(args):
|
||||
if len(batch_data) > 0 and batch_data[-1].ext != b1.ext: # バッチ分割必要?
|
||||
logger.info(f"When does this run?\n Loaded {len(batch_data)} prompts for {distributed_state.num_processes} devices.")
|
||||
logger.info(f"Collected {len(batch_data)} prompts for {distributed_state.num_processes} devices.")
|
||||
logger.info(f"{batch_data}")
|
||||
batch_data_split = [] #[batch_data[i:i+3] for i in range(0, len(my_list), 3)]
|
||||
batch_index = []
|
||||
for i in range(len(batch_data)):
|
||||
if distributed_state.is_main_process:
|
||||
logger.info(f"Prompt {i+1}: {batch_data[i].base.prompt}\n{batch_data[i]}")
|
||||
logger.info(f"Prompt {i+1}: {batch_data[i].base.prompt}")
|
||||
batch_index.append(batch_data[i])
|
||||
if (i+1) % args.batch_size == 0:
|
||||
batch_data_split.append(batch_index.copy())
|
||||
@@ -2857,7 +2856,7 @@ def main(args):
|
||||
test_batch_data_split = []
|
||||
test_batch_index = []
|
||||
for i in range(len(batch_data)):
|
||||
logger.info(f"Prompt {i+1}: {batch_data[i].base.prompt}\n{batch_data[i]}")
|
||||
logger.info(f"Prompt {i+1}: {batch_data[i].base.prompt}}")
|
||||
batch_index.append(batch_data[i])
|
||||
test_batch_index.append(batch_data[i])
|
||||
if (i+1) % args.batch_size == 0:
|
||||
@@ -2891,7 +2890,7 @@ def main(args):
|
||||
batch_index = []
|
||||
if distributed_state.is_main_process:
|
||||
for i in range(len(batch_data)):
|
||||
logger.info(f"Prompt {i+1}: {batch_data[i].base.prompt}\n{batch_data[i]}")
|
||||
logger.info(f"Prompt {i+1}: {batch_data[i].base.prompt}")
|
||||
batch_index.append(batch_data[i])
|
||||
if (i+1) % args.batch_size == 0:
|
||||
batch_data_split.append(batch_index.copy())
|
||||
@@ -2900,7 +2899,7 @@ def main(args):
|
||||
with torch.no_grad():
|
||||
with distributed_state.split_between_processes(batch_data_split) as batch_list:
|
||||
logger.info(f"Loading batch of {len(batch_list[0])} prompts onto device {distributed_state.device}:")
|
||||
logger.info(f"batch_list: {batch_list}")
|
||||
logger.info(f"batch_list:")
|
||||
for i in range(len(batch_list[0])):
|
||||
logger.info(f"Prompt {i+1}: {batch_list[0][i].base.prompt}")
|
||||
prev_image = process_batch(batch_list[0], highres_fix)[0]
|
||||
|
||||
Reference in New Issue
Block a user