Skip to content

Commit

Permalink
Merge pull request AUTOMATIC1111#383 from rulyone/controlnet_batch
Browse files Browse the repository at this point in the history
Controlnet batch support
  • Loading branch information
Mikubill authored Feb 27, 2023
2 parents 3752046 + 70d4e34 commit 8ca06ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,11 @@ def process(self, p, is_img2img=False, *args):
networks.append(model_net)
self.model_cache[model] = model_net

if input_image is not None:
is_api = getattr(p, 'control_net_api_access', False)
is_img2img_batch_tab = not is_api and is_img2img and img2img_tab_tracker.submit_img2img_tab == 'img2img_batch_tab'
if is_img2img_batch_tab and hasattr(p, "image_control") and p.image_control is not None:
input_image = HWC3(np.asarray(p.image_control))
elif input_image is not None:
input_image = HWC3(np.asarray(input_image))
elif image is not None:
input_image = HWC3(image['image'])
Expand Down

0 comments on commit 8ca06ba

Please sign in to comment.