stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Matched style prompt removed when batch processing

Open drgrib opened this issue 11 months ago • 0 comments

Checklist

  • [ ] The issue exists after disabling all extensions
  • [ ] The issue exists on a clean installation of webui
  • [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • [X] The issue exists in the current version of the webui
  • [X] The issue has not been reported before recently
  • [ ] The issue has been reported before but has not been fixed yet

What happened?

I like to use ADetailer for faces but I think it is a waste when the rest of the image is bad. So I create batches of images and then filter out all the good ones to later be batch processed by ADetailer.

However, I have noticed something very odd about how the images are batch processed in Automatic1111 when I have used a saved style prompt to generate the image: even though I tell the batch process to use the Positive and Negative Prompt (whether img2img or the txt2img "Process PNG Metadata Info" script), IF the prompt was created using one of my saved styles, it seems like Automatic1111 strips the style prompts from the batch processed image.

So if the image was created with a saved style like:

a, b, c, {prompt}, e, f, g

Resulting in PNG metadata info that looks like, e.g,

a, b, c, 1, 2, 3, e, f, g

When the image gets batch processed, the batch processor only receives

1, 2, 3

Obviously, this can negate the purpose of trying to run ADetailer on the image if the style prompt contained important info. In my case it does, specifically a LoRA that should be used for the face.

Is there a way for me to stop Automatic1111 from doing this when I use a preset style? If not, is there at least a way to add before / after snippets to the positive prompts img2img receives for batch processing? I can already do that for the Process PNG Metadata Info script.

Steps to reproduce the problem

  1. Create an image using a saved style prompt
  2. Batch process the image in img2img using ADetailer
  3. The saved style prompt will be stripped from what ADetailer receives

This is even easier to see when the Process PNG Metadata Info script is used in step 2 because the image will completely change. But I know it isn't a directly supported script.

What should have happened?

The full metadata should be sent to ADetailer when batch processing.

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

sysinfo-2024-02-25-16-19.json

Console logs

100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:23<00:00,  1.21it/s]
Total progress: 436it [22:15,  2.16it/s]
0: 416x640 1 face, 10.0ms
Speed: 4.0ms preprocess, 10.0ms inference, 3.0ms postprocess per image at shape (1, 3, 416, 640)
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:20<00:00,  1.44it/s]
mediapipe: 1 detected.
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:21<00:00,  1.37it/s]
2024-02-25 08:12:24,296 - ControlNet - INFO - unit_separate = False, style_align = False
*** Error running process: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 718, in process
        script.process(p, *script_args)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1143, in process
        self.controlnet_hack(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1128, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 894, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 367, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 377, in build_control_model
        raise RuntimeError(f"You have not selected any ControlNet Model.")
    RuntimeError: You have not selected any ControlNet Model.

---
2024-02-25 08:12:25,588 - ControlNet - INFO - unit_separate = False, style_align = False
*** Error running process: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 718, in process
        script.process(p, *script_args)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1143, in process
        self.controlnet_hack(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1128, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 894, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 367, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 377, in build_control_model
        raise RuntimeError(f"You have not selected any ControlNet Model.")
    RuntimeError: You have not selected any ControlNet Model.

---
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:20<00:00,  1.43it/s]
Total progress: 465it [23:44,  2.24it/s]
0: 416x640 1 face, 11.0ms
Speed: 49.0ms preprocess, 11.0ms inference, 47.5ms postprocess per image at shape (1, 3, 416, 640)
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:23<00:00,  1.24it/s]
mediapipe: 1 detected.
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:21<00:00,  1.37it/s]
2024-02-25 08:13:56,980 - ControlNet - INFO - unit_separate = False, style_align = False
*** Error running process: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 718, in process
        script.process(p, *script_args)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1143, in process
        self.controlnet_hack(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1128, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 894, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 367, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 377, in build_control_model
        raise RuntimeError(f"You have not selected any ControlNet Model.")
    RuntimeError: You have not selected any ControlNet Model.

---
2024-02-25 08:13:58,165 - ControlNet - INFO - unit_separate = False, style_align = False
*** Error running process: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 718, in process
        script.process(p, *script_args)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1143, in process
        self.controlnet_hack(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1128, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 894, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 367, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 377, in build_control_model
        raise RuntimeError(f"You have not selected any ControlNet Model.")
    RuntimeError: You have not selected any ControlNet Model.

---
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:17<00:00,  1.67it/s]
Total progress: 494it [25:09,  4.13it/s]
0: 416x640 1 face, 10.0ms
Speed: 3.0ms preprocess, 10.0ms inference, 2.0ms postprocess per image at shape (1, 3, 416, 640)
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:19<00:00,  1.45it/s]
mediapipe: 1 detected.
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:21<00:00,  1.36it/s]
2024-02-25 08:15:36,397 - ControlNet - INFO - unit_separate = False, style_align = False
*** Error running process: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 718, in process
        script.process(p, *script_args)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1143, in process
        self.controlnet_hack(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1128, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 894, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 367, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 377, in build_control_model
        raise RuntimeError(f"You have not selected any ControlNet Model.")
    RuntimeError: You have not selected any ControlNet Model.

---
2024-02-25 08:15:37,689 - ControlNet - INFO - unit_separate = False, style_align = False
*** Error running process: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 718, in process
        script.process(p, *script_args)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1143, in process
        self.controlnet_hack(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1128, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 894, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 367, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 377, in build_control_model
        raise RuntimeError(f"You have not selected any ControlNet Model.")
    RuntimeError: You have not selected any ControlNet Model.

---
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:09<00:00,  3.18it/s]
Total progress: 523it [26:39,  4.26it/s]
0: 416x640 1 face, 11.0ms
Speed: 16.0ms preprocess, 11.0ms inference, 9.0ms postprocess per image at shape (1, 3, 416, 640)
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:20<00:00,  1.44it/s]
mediapipe: 1 detected.
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:21<00:00,  1.37it/s]
2024-02-25 08:17:14,395 - ControlNet - INFO - unit_separate = False, style_align = False
*** Error running process: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 718, in process
        script.process(p, *script_args)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1143, in process
        self.controlnet_hack(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1128, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 894, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 367, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 377, in build_control_model
        raise RuntimeError(f"You have not selected any ControlNet Model.")
    RuntimeError: You have not selected any ControlNet Model.

---
2024-02-25 08:17:15,511 - ControlNet - INFO - unit_separate = False, style_align = False
*** Error running process: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 718, in process
        script.process(p, *script_args)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1143, in process
        self.controlnet_hack(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1128, in controlnet_hack
        self.controlnet_main_entry(p)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 894, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 367, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "D:\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 377, in build_control_model
        raise RuntimeError(f"You have not selected any ControlNet Model.")
    RuntimeError: You have not selected any ControlNet Model.

---
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:14<00:00,  1.98it/s]
Total progress: 552it [28:22,  2.15it/s]
0: 416x640 1 face, 14.0ms
Speed: 3.0ms preprocess, 14.0ms inference, 3.0ms postprocess per image at shape (1, 3, 416, 640)
100%|██████████████████████████████████████████████████████████████████████████████████| 29/29 [00:20<00:00,  1.42it/s]
mediapipe: 1 detected.

Additional information

No response

drgrib avatar Feb 25 '24 16:02 drgrib