Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The option "Crop input image based on A1111 mask" is missing when uploading Independent control image in the img2img mode #3071

Open
1 task done
jkyndir opened this issue Dec 5, 2024 · 1 comment

Comments

@jkyndir
Copy link

jkyndir commented Dec 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

What happened?

As the title says, when I upload independent control image in the img2img mode, there is no checkbox for "Crop input image based on A1111 mask".
image

By default, all uploaded images would be cropped, but this will result in this: IPAdapter with face_id_plus fails with Exception: Insightface: No face found in image.

So I need this checkbox to disable "Crop input image based on A1111 mask", so that the face in the uploaded image will not be cropped out.

Steps to reproduce the problem

  1. In img2img, use Face ADetailer's ControlNet passthrough feature to deploy the control net.
  2. In control net, use IPAdapter with face_id_plus and upload a face reference image.
  3. Runs into error, Exception: Insightface: No face found in image.

What should have happened?

There should be an option to not crop the input image, just like there is one in the inpaint mode.
image

Commit where the problem happens

webui: 82a973c
controlnet: 56cec5b

What browsers do you use to access the UI ?

No response

Command Line Arguments

--autolaunch --xformers --update-check --update-all-extensions

List of enabled extensions

image

Console logs

2024-12-05 21:25:21,028 - ControlNet - INFO - unit_separate = False, style_align = False
2024-12-05 21:25:21,028 - ControlNet - INFO - Loading model from cache: ip-adapter-faceid-plusv2_sd15 [6e14fc1a]
2024-12-05 21:25:21,452 - ControlNet - INFO - Using preprocessor: ip-adapter_face_id_plus
2024-12-05 21:25:21,452 - ControlNet - INFO - preprocessor resolution = 512
*** Error running process: D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\modules\scripts.py", line 832, in process
        script.process(p, *script_args)
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1228, in process
        self.controlnet_hack(p)
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1213, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 941, in controlnet_main_entry
        controls, hr_controls, additional_maps = get_control(
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 290, in get_control
        controls, hr_controls = list(zip(*[preprocess_input_image(img) for img in optional_tqdm(input_images)]))
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 290, in <listcomp>
        controls, hr_controls = list(zip(*[preprocess_input_image(img) for img in optional_tqdm(input_images)]))
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 242, in preprocess_input_image
        result = preprocessor.cached_call(
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\supported_preprocessor.py", line 198, in cached_call
        result = self._cached_call(input_image, *args, **kwargs)
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 82, in decorated_func
        return cached_func(*args, **kwargs)
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 66, in cached_func
        return func(*args, **kwargs)
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\supported_preprocessor.py", line 211, in _cached_call
        return self(*args, **kwargs)
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\legacy_preprocessors.py", line 105, in __call__
        result, is_image = self.call_function(
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\processor.py", line 768, in face_id_plus
        face_embed, _ = g_insight_face_model.run_model(img)
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\processor.py", line 699, in run_model
        face = InsightFaceModel.pick_largest_face(faces)
      File "D:\dev\jkyndir\AI\AI_Images\Stable_Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\processor.py", line 656, in pick_largest_face
        raise Exception("Insightface: No face found in image.")
    Exception: Insightface: No face found in image.

Additional information

No response

@jkyndir
Copy link
Author

jkyndir commented Dec 5, 2024

Never mind, sometimes the Insightface would be able to pick up face again in the img2img mode.
Really strange. I'll keep monitoring this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant