This commit is contained in:
lllyasviel 2024-02-04 22:21:38 -08:00
parent a8c43f7af0
commit a4d64adb32

View File

@ -289,6 +289,7 @@ class ControlNetForForgeOfficial(scripts.Script):
break
if preprocessor_output_is_image:
alignment_indices = [i % len(preprocessor_outputs) for i in range(p.batch_size)]
params.control_cond = []
params.control_cond_for_hr_fix = []
@ -297,14 +298,14 @@ class ControlNetForForgeOfficial(scripts.Script):
p.extra_result_images.append(external_code.visualize_inpaint_mask(control_cond))
params.control_cond.append(numpy_to_pytorch(control_cond).movedim(-1, 1))
params.control_cond = torch.cat(params.control_cond, dim=0)
params.control_cond = torch.cat(params.control_cond, dim=0)[alignment_indices].contiguous()
if has_high_res_fix:
for preprocessor_output in preprocessor_outputs:
control_cond_for_hr_fix = crop_and_resize_image(preprocessor_output, resize_mode, hr_y, hr_x)
p.extra_result_images.append(external_code.visualize_inpaint_mask(control_cond_for_hr_fix))
params.control_cond_for_hr_fix.append(numpy_to_pytorch(control_cond_for_hr_fix).movedim(-1, 1))
params.control_cond_for_hr_fix = torch.cat(params.control_cond_for_hr_fix, dim=0)
params.control_cond_for_hr_fix = torch.cat(params.control_cond_for_hr_fix, dim=0)[alignment_indices].contiguous()
else:
params.control_cond_for_hr_fix = params.control_cond
else: