Bing-su / adetailer

Auto detecting, masking and inpainting with detection model.
GNU Affero General Public License v3.0
4.15k stars 317 forks source link

[Bug]: "A tensor with all NaNs was produced in Unet" when using adetailer and batchcount higher than 1 #178

Closed Gouden89 closed 1 year ago

Gouden89 commented 1 year ago

Describe the bug

So before I could do higher batchcounts but since a couple days I get this error. Without adetailer enabled it does work, but with it generates 1 picture and then it bugs out.

The entire console log, including python version information, webui version, commit hash, commandline arguments and error traces.

Already up to date.
venv "F:\Stable Dif\Automatic1111\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.4.0
Commit hash: 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8
Installing requirements

Checking roop requirements
Install insightface==0.7.3
Installing sd-webui-roop requirement: insightface==0.7.3
Install onnx==1.14.0
Installing sd-webui-roop requirement: onnx==1.14.0
Install onnxruntime==1.15.0
Installing sd-webui-roop requirement: onnxruntime==1.15.0
Install opencv-python==4.7.0.72
Installing sd-webui-roop requirement: opencv-python==4.7.0.72

Installing requirements for Unprompted - natural language processing: pattern@git+https://github.com/NicolasBizzozzero/pattern
Installing requirements for Unprompted - [img2pez]: sentence-transformers
Installing requirements for Unprompted - [pix2pix_zero]: salesforce-lavis
Installing requirements for Unprompted - [zoom_enhance]: color-matcher

Launching Web UI with arguments: --xformers --api --autolaunch
=================================================================================
You are running xformers 0.0.17.
The program is tested to work with xformers 0.0.20.
To reinstall the desired version, run with commandline flag --reinstall-xformers.

Use --skip-version-check commandline argument to disable this check.
=================================================================================
Additional Network extension not installed, Only hijack built-in lora
LoCon Extension hijack built-in lora successfully
[-] ADetailer initialized. version: 23.6.4, num models: 12
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
2023-07-01 12:25:07,759 - ControlNet - INFO - ControlNet v1.1.227
ControlNet preprocessor location: F:\Stable Dif\Automatic1111\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-07-01 12:25:07,822 - ControlNet - INFO - ControlNet v1.1.227
2023-07-01 12:25:08,200 - roop - INFO - roop v0.0.2
2023-07-01 12:25:08,200 - roop - INFO - roop v0.0.2
(SETUP) Loading Unprompted v9.4.0 by Therefore Games
(SETUP) Initializing Unprompted object...
(SETUP) Loading configuration files...
(SETUP) Logging enabled for the following message types: RESULT,WARNING,ERROR
Loading weights [59dfb5842f] from F:\Stable Dif\Automatic1111\stable-diffusion-webui\models\Stable-diffusion\0.5(majicmixRealistic_v6) + 0.5(revAnimated_v122).safetensors
Creating model from config: F:\Stable Dif\Automatic1111\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 9.5s (import torch: 1.3s, import gradio: 0.9s, import ldm: 0.3s, other imports: 0.7s, setup codeformer: 0.2s, load scripts: 2.8s, create ui: 2.8s, gradio launch: 0.3s).
Loading VAE weights specified in settings: F:\Stable Dif\Automatic1111\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: xformers... done.
Textual inversion embeddings loaded(20): alivik01-7250, Asian-Less, Asian-Less-Neg, Asian-Less-Toon, bad-artist, bad-artist-anime, bad-hands-5, bad_prompt, bad_prompt_version2, BadDream, badhandv4, BadNegAnatomyV1-neg, charturnerv2, easynegative, FastNegativeEmbedding, leaseydoux_ti, ng_deepnegative_v1_75t, thelab-ada, UnrealisticDream, verybadimagenegative_v1.1-6400
Textual inversion embeddings skipped(5): CGI_Animation, midjourney, nfixer, VikingPunk, vray-render
Model loaded in 9.1s (load weights from disk: 1.5s, create model: 0.6s, apply weights to model: 2.1s, apply half(): 3.3s, load VAE: 0.5s, move model to device: 0.6s, calculate empty prompt: 0.4s).
preload_extensions_git_metadata for 32 extensions took 6.92s
                                  locon load lora method
locon load lora method0:00, ?it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:09<00:00,  3.28it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 25/25 [00:40<00:00,  1.62s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 55/55 [00:57<00:00,  1.66s/it]
0: 384x640 1 face, 74.7ms
Speed: 2.0ms preprocess, 74.7ms inference, 2.5ms postprocess per image at shape (1, 3, 640, 640)
2023-07-01 12:26:57,179 - ControlNet - INFO - Loading model: control_v11p_sd15_inpaint [ebff9138]
2023-07-01 12:26:59,250 - ControlNet - INFO - Loaded state_dict from [F:\Stable Dif\Automatic1111\stable-diffusion-webui\extensions\sd-webui-controlnet\models\control_v11p_sd15_inpaint.pth]
2023-07-01 12:26:59,250 - ControlNet - INFO - Loading config: F:\Stable Dif\Automatic1111\stable-diffusion-webui\extensions\sd-webui-controlnet\models\control_v11p_sd15_inpaint.yaml
2023-07-01 12:27:01,557 - ControlNet - INFO - ControlNet model control_v11p_sd15_inpaint [ebff9138] loaded.
2023-07-01 12:27:01,673 - ControlNet - INFO - Loading preprocessor: inpaint
2023-07-01 12:27:01,675 - ControlNet - INFO - preprocessor resolution = 512
100%|██████████████████████████████████████████████████████████████████████████████████| 13/13 [00:04<00:00,  2.73it/s]

0: 384x640 (no detections), 7.5ms
Speed: 0.0ms preprocess, 7.5ms inference, 1.0ms postprocess per image at shape (1, 3, 640, 640)
[-] ADetailer: nothing detected on image 1 with 2nd settings.
Total progress: 100%|██████████████████████████████████████████████████████████████████| 55/55 [01:14<00:00,  1.35s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 55/55 [01:14<00:00,  1.66s/it]locon load lora method                                                                           | 0/65 [00:00<?, ?it/s]
locon load lora method
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:08<00:00,  3.65it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 25/25 [00:40<00:00,  1.62s/it]
Total progress:  20%|█████████████                                                    | 55/275 [00:49<06:05,  1.66s/it]
0: 384x640 1 face, 6.6ms
Speed: 0.5ms preprocess, 6.6ms inference, 2.0ms postprocess per image at shape (1, 3, 640, 640)
2023-07-01 12:28:10,438 - ControlNet - INFO - Loading model from cache: control_v11p_sd15_inpaint [ebff9138]
2023-07-01 12:28:10,503 - ControlNet - INFO - Loading preprocessor: inpaint
2023-07-01 12:28:10,503 - ControlNet - INFO - preprocessor resolution = 512
100%|██████████████████████████████████████████████████████████████████████████████████| 13/13 [00:04<00:00,  2.72it/s]

0: 384x640 1 hand, 14.5ms
Speed: 1.0ms preprocess, 14.5ms inference, 2.5ms postprocess per image at shape (1, 3, 640, 640)
  0%|                                                                                           | 0/13 [00:00<?, ?it/s]
*** Error running postprocess_image: F:\Stable Dif\Automatic1111\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py
    Traceback (most recent call last):
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\scripts.py", line 514, in postprocess_image
        script.postprocess_image(p, pp, *script_args)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py", line 560, in postprocess_image
        is_processed |= self._postprocess_image(p, pp, args, n=n)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py", line 530, in _postprocess_image
        processed = process_images(p2)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\processing.py", line 620, in process_images
        res = process_images_inner(p)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\processing.py", line 739, in process_images_inner
        samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\processing.py", line 1316, in sample
        samples = self.sampler.sample_img2img(self, self.init_latent, x, conditioning, unconditional_conditioning, image_conditioning=self.image_conditioning)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 409, in sample_img2img
        samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 278, in launch_sampling
        return func()
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 409, in <lambda>
        samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\sampling.py", line 518, in sample_dpmpp_2s_ancestral
        denoised = model(x, sigmas[i] * s_in, **extra_args)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
        return forward_call(*args, **kwargs)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 190, in forward
        devices.test_for_nans(x_out, "unet")
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\devices.py", line 158, in test_for_nans
        raise NansException(message)
    modules.devices.NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.

---
  0%|                                                                                           | 0/30 [00:00<?, ?it/s]
*** Error completing request
*** Arguments: ('task(73h22u8zbinjh51)', 'best quality, masterpiece, (photorealistic:2), 1girl, black and red skinsuit, full body shot, looking at viewer, close up, forest in background, red and blue lights, detailed background, long black hair, grey eyes, flirting<lora:add_detail:1> <lora:takahashirin_lora:0.6>, <lyco:GoodHands-beta2:1.0> nice hands, perfect hands,', 'Negative prompt: nsfw, ng_deepnegative_v1_75t, badhandv4, (worst quality:2), (low quality:2), (normal quality:2), low resolution, watermark, monochrome, nipples, nipple slip, ((large breast))', [], 30, 15, False, False, 5, 1, 5, -1.0, -1.0, 0, 0, 0, False, 512, 904, True, 0.5, 2, 'Latent (bicubic antialiased)', 25, 0, 0, 0, '', '', [], 0, True, {'ad_confidence': 0.8, 'ad_model': 'face_yolov8n_v2.pt', 'ad_inpaint_only_masked_padding': 0, 'ad_controlnet_model': 'control_v11p_sd15_inpaint [ebff9138]', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1}, {'ad_model': 'hand_yolov8n.pt', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1}, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 1536, 96, True, True, True, False, False, '', 0, False, 7, 100, 'Constant', 0, 'Constant', 0, 4, False, False, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, None, 'Refresh models', <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x0000028AC741D570>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x0000028AAACA4A90>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x0000028AC7402740>, 'NONE:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\nALL:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\nINS:1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0\nIND:1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0\nINALL:1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0\nMIDD:1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0\nOUTD:1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0\nOUTS:1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1\nOUTALL:1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1\nALL0.5:0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5', True, 0, 'values', '0,0.25,0.5,0.75,1', 'Block ID', 'IN05-OUT05', 'none', '', '0.5,1', 'BASE,IN00,IN01,IN02,IN03,IN04,IN05,IN06,IN07,IN08,IN09,IN10,IN11,M00,OUT00,OUT01,OUT02,OUT03,OUT04,OUT05,OUT06,OUT07,OUT08,OUT09,OUT10,OUT11', 1.0, 'black', '20', False, 'ATTNDEEPON:IN05-OUT05:attn:1\n\nATTNDEEPOFF:IN05-OUT05:attn:0\n\nPROJDEEPOFF:IN05-OUT05:proj:0\n\nXYZ:::1', False, False, False, 'Matrix', 'Horizontal', 'Mask', 'Prompt', '1,1', '0.2', False, False, False, 'Attention', False, '0', '0', '0.4', None, None, False, '0', 'F:\\Stable Dif\\Automatic1111\\stable-diffusion-webui\\models\\roop\\inswapper_128.onnx', 'CodeFormer', 1, '', 1, 1, False, True, True, -1.0, True, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, None, None, False, None, None, False, 50) {}
    Traceback (most recent call last):
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\call_queue.py", line 55, in f
        res = list(func(*args, **kwargs))
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\call_queue.py", line 35, in f
        res = func(*args, **kwargs)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\txt2img.py", line 57, in txt2img
        processed = processing.process_images(p)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\processing.py", line 620, in process_images
        res = process_images_inner(p)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\processing.py", line 739, in process_images_inner
        samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\processing.py", line 992, in sample
        samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 439, in sample
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 278, in launch_sampling
        return func()
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 439, in <lambda>
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\sampling.py", line 518, in sample_dpmpp_2s_ancestral
        denoised = model(x, sigmas[i] * s_in, **extra_args)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
        return forward_call(*args, **kwargs)
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 190, in forward
        devices.test_for_nans(x_out, "unet")
      File "F:\Stable Dif\Automatic1111\stable-diffusion-webui\modules\devices.py", line 158, in test_for_nans
        raise NansException(message)
    modules.devices.NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.

---

List of installed extensions

No response

Bing-su commented 1 year ago

Thank you for the report. As far as I can tell, the NansException is related to the model, lora, vae, embedding, and has nothing to do with the extensions. I've seen some of them throw a NansException, just on inpainting.

I can see in your prompt that you have a lot of highly weighted things like <lora:add_detail:1>, <lyco:GoodHands-beta2:1.0>. One of the tips from the Korean community is to keep the sum of the weights of all your LORAs within 1.5. This will help to prevent NansException.

Or, you can put prompts like "best quality, masterpiece" in ad_prompt to prevent inpaint from using loras.

Gouden89 commented 1 year ago

tried with a different model and a simple prompt "a girl sitting in a chair", no loras or anything and get the same error. Works fine without adetailer enabled and with it bugs out after the first generation

Bing-su commented 1 year ago

Check out this: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6923

There are so many things involved in this issue that it's actually hard for us. sorry.

ramyma commented 1 year ago

I created a PR for A1111 that fixes a similar problem with the Controlnet extension. https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/11569

You can give it a try and see if it solves the issue.

Also, make sure that persistent cond cache is unchecked under Settings -> Optimizations

Bing-su commented 1 year ago

@ramyma Thank you. I think it could help me troubleshoot.

Neverdusk commented 1 year ago

I'm also having this same issue. My only LoRa is at a weight of 0.5, but generation fails whenever I go for batch counts more than 1.

Neverdusk commented 1 year ago

I can also confirm that everything works fine so long as ControlNet isn't used with ADetailer. Using tiled or inpaint causes the error with multiple batches - though I haven't tested with other ControlNet models.

Bing-su commented 1 year ago

@Neverdusk Thanks for the report, but can you post the terminal logs as well?

Neverdusk commented 1 year ago

@Neverdusk Thanks for the report, but can you post the terminal logs as well?

Sure - should I post them straight into here or is there a better way to hand them over? In case I can avoid bloating the thread with a long log.

As one more point (I'm still testing different idea) - I just figured out that the error CAN be avoided, even if ControlNet is enabled - if the FIRST ADetailer does not use it. I managed to run generation with a batch size of 2, with the first ADetailer (person8n-seg) not having any ControlNet but the second ADetailer (face8n) using Inpaint Global Harmonious, and it worked perfectly.

However, in a previous test, adding ControlNet to the first ADetailer but not the second still caused the issue. So it's fine if ControlNet is used at the end of a batch / between batches, so long as it isn't used mid-batch.

Bing-su commented 1 year ago

I can edit your comment, so just post it here. Except if you're viewing on a mobile device, it's fine.

Neverdusk commented 1 year ago

Here's a fresh log. I created the same two images (batch size 2) repeatedly with ADetailer enabled. On the first run, neither used ControlNet. On the second run, the second ADetailer used ControlNet. On the third run, both used ControlNet, and generation failed:

logs ```sh venv "C:\Users\silve\Documents\AI Art\__SDUX\venv\Scripts\Python.exe" Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: v1.4.0-272-gb5de227b Commit hash: b5de227b5389e877c61fd9079b590470d455c2cc Installing requirements Requirement already satisfied: send2trash~=1.8 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (1.8.2) Requirement already satisfied: dynamicprompts[attentiongrabber,magicprompt]~=0.27.0 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (0.27.0) Requirement already satisfied: jinja2~=3.1 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.1.2) Requirement already satisfied: pyparsing~=3.0 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.0.9) Requirement already satisfied: transformers[torch]~=4.19 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (4.25.1) Requirement already satisfied: MarkupSafe>=2.0 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from jinja2~=3.1->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2.1.2) Requirement already satisfied: filelock in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.12.0) Requirement already satisfied: huggingface-hub<1.0,>=0.10.0 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (0.15.1) Requirement already satisfied: numpy>=1.17 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (1.23.5) Requirement already satisfied: packaging>=20.0 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (23.1) Requirement already satisfied: pyyaml>=5.1 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (6.0) Requirement already satisfied: regex!=2019.12.17 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2023.5.5) Requirement already satisfied: requests in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2.31.0) Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (0.13.3) Requirement already satisfied: tqdm>=4.27 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (4.65.0) Requirement already satisfied: torch!=1.12.0,>=1.7 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2.0.1+cu118) Requirement already satisfied: fsspec in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from huggingface-hub<1.0,>=0.10.0->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2023.5.0) Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from huggingface-hub<1.0,>=0.10.0->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (4.6.2) Requirement already satisfied: sympy in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from torch!=1.12.0,>=1.7->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (1.12) Requirement already satisfied: networkx in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from torch!=1.12.0,>=1.7->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.1) Requirement already satisfied: colorama in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from tqdm>=4.27->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (0.4.6) Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from requests->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.1.0) Requirement already satisfied: idna<4,>=2.5 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from requests->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (3.4) Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from requests->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (1.26.16) Requirement already satisfied: certifi>=2017.4.17 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from requests->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (2023.5.7) Requirement already satisfied: mpmath>=0.19 in c:\users\silve\documents\ai art\__sdux\venv\lib\site-packages (from sympy->torch!=1.12.0,>=1.7->transformers[torch]~=4.19->dynamicprompts[attentiongrabber,magicprompt]~=0.27.0) (1.3.0) sd-dynamic-prompts installer: running 'C:\Users\silve\Documents\AI Art\__SDUX\venv\Scripts\python.exe' -m pip install 'send2trash~=1.8' 'dynamicprompts[attentiongrabber,magicprompt]~=0.27.0' Launching Web UI with arguments: --xformers --no-half-vae --api --autolaunch Civitai Helper: Get Custom Model Folder Civitai Helper: Load setting from: C:\Users\silve\Documents\AI Art\__SDUX\extensions\Stable-Diffusion-Webui-Civitai-Helper\setting.json Civitai Helper: No setting file, use default [-] ADetailer initialized. version: 23.7.1, num models: 8 2023-07-04 09:40:30,902 - ControlNet - INFO - ControlNet v1.1.228 ControlNet preprocessor location: C:\Users\silve\Documents\AI Art\__SDUX\extensions\sd-webui-controlnet\annotator\downloads 2023-07-04 09:40:31,145 - ControlNet - INFO - ControlNet v1.1.228 Loading weights [794b07eb91] from C:\Users\silve\Documents\AI Art\__SDUX\models\Stable-diffusion\__Anime\_Custom\Roxanne.safetensors Creating model from config: C:\Users\silve\Documents\AI Art\__SDUX\configs\v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Loading VAE weights specified in settings: C:\Users\silve\Documents\AI Art\__SDUX\models\VAE\ClearVAE2.3.safetensors Applying attention optimization: xformers... done. Textual inversion embeddings loaded(21): Age-NotOld-Negative, Age-NotYoung-Negative, Age-Old, Age-Older, Age-Oldest, Age-Young, Age-Younger, Age-Youngest, AsyncNegative6, bad-artist, bad-artist-anime, bad-hands-5, CharTurner, CharTurner2, EasyNegative, Gender-Boyish, Gender-DeFeminize-Negative, Gender-DeMasculate-Negative, Gender-Masculine, PlanIt, VeryBadNegative1.3 Model loaded in 18.3s (load weights from disk: 4.0s, create model: 0.6s, apply weights to model: 8.6s, apply half(): 2.9s, load VAE: 0.8s, move model to device: 1.1s, calculate empty prompt: 0.2s). Running on local URL: http://127.0.0.1:7860 To create a public link, set `share=True` in `launch()`. Startup time: 34.0s (import torch: 3.3s, import gradio: 2.4s, import ldm: 0.9s, other imports: 1.5s, setup codeformer: 0.1s, list SD models: 0.2s, load scripts: 5.4s, initialize extra networks: 0.1s, scripts before_ui_callback: 1.7s, create ui: 17.7s, gradio launch: 0.5s, add APIs: 0.2s). preload_extensions_git_metadata for 23 extensions took 2.92s *** Error running before_process: C:\Users\silve\Documents\AI Art\__SDUX\extensions-builtin\extra-options-section\scripts\extra_options_section.py Traceback (most recent call last): File "C:\Users\silve\Documents\AI Art\__SDUX\modules\scripts.py", line 467, in before_process script.before_process(p, *script_args) File "C:\Users\silve\Documents\AI Art\__SDUX\extensions-builtin\extra-options-section\scripts\extra_options_section.py", line 40, in before_process for name, value in zip(self.setting_names, args): TypeError: 'NoneType' object is not iterable --- LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:06<00:00, 3.14it/s] 100%|██████████████████████████████████████████████████████████████████████████████████| 10/10 [00:06<00:00, 1.46it/s] Total progress: 50%|█████████████████████████████████ | 30/60 [00:57<00:22, 1.35it/s] 0: 640x640 1 person, 54.6ms Speed: 14.1ms preprocess, 54.6ms inference, 32.5ms postprocess per image at shape (1, 3, 640, 640) LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:02<00:00, 3.55it/s] 0: 640x640 1 face, 9.0ms Speed: 3.0ms preprocess, 9.0ms inference, 1.0ms postprocess per image at shape (1, 3, 640, 640) LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:02<00:00, 3.54it/s] LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00, 3.80it/s] 100%|██████████████████████████████████████████████████████████████████████████████████| 10/10 [00:06<00:00, 1.45it/s] Total progress: 100%|██████████████████████████████████████████████████████████████████| 60/60 [01:29<00:00, 1.31it/s] 0: 640x640 1 person, 10.4ms Speed: 3.0ms preprocess, 10.4ms inference, 2.0ms postprocess per image at shape (1, 3, 640, 640) LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:02<00:00, 3.51it/s] 0: 640x640 1 face, 8.6ms Speed: 3.0ms preprocess, 8.6ms inference, 4.0ms postprocess per image at shape (1, 3, 640, 640) LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:02<00:00, 3.62it/s] Total progress: 100%|██████████████████████████████████████████████████████████████████| 60/60 [01:39<00:00, 1.67s/it] *** Error running before_process: C:\Users\silve\Documents\AI Art\__SDUX\extensions-builtin\extra-options-section\scripts\extra_options_section.py Traceback (most recent call last): File "C:\Users\silve\Documents\AI Art\__SDUX\modules\scripts.py", line 467, in before_process script.before_process(p, *script_args) File "C:\Users\silve\Documents\AI Art\__SDUX\extensions-builtin\extra-options-section\scripts\extra_options_section.py", line 40, in before_process for name, value in zip(self.setting_names, args): TypeError: 'NoneType' object is not iterable --- LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00, 3.97it/s] 100%|██████████████████████████████████████████████████████████████████████████████████| 10/10 [00:06<00:00, 1.51it/s] Total progress: 50%|█████████████████████████████████ | 30/60 [00:16<00:21, 1.38it/s] 0: 640x640 1 person, 10.8ms Speed: 3.6ms preprocess, 10.8ms inference, 2.0ms postprocess per image at shape (1, 3, 640, 640) LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:02<00:00, 3.76it/s] 0: 640x640 1 face, 7.6ms Speed: 3.0ms preprocess, 7.6ms inference, 2.1ms postprocess per image at shape (1, 3, 640, 640) 2023-07-04 09:43:31,461 - ControlNet - INFO - Loading model: control_v11p_sd15_inpaint [ebff9138] 2023-07-04 09:43:32,506 - ControlNet - INFO - Loaded state_dict from [C:\Users\silve\Documents\AI Art\__SDUX\models\ControlNet\control_v11p_sd15_inpaint.pth] 2023-07-04 09:43:32,507 - ControlNet - INFO - Loading config: C:\Users\silve\Documents\AI Art\__SDUX\models\ControlNet\control_v11p_sd15_inpaint.yaml 2023-07-04 09:43:35,105 - ControlNet - INFO - ControlNet model control_v11p_sd15_inpaint [ebff9138] loaded. 2023-07-04 09:43:35,237 - ControlNet - INFO - Loading preprocessor: inpaint 2023-07-04 09:43:35,237 - ControlNet - INFO - preprocessor resolution = 640 LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:03<00:00, 2.72it/s] LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00, 3.96it/s] 100%|██████████████████████████████████████████████████████████████████████████████████| 10/10 [00:06<00:00, 1.50it/s] Total progress: 100%|██████████████████████████████████████████████████████████████████| 60/60 [00:47<00:00, 1.37it/s] 0: 640x640 1 person, 10.0ms Speed: 3.5ms preprocess, 10.0ms inference, 2.0ms postprocess per image at shape (1, 3, 640, 640) LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:02<00:00, 3.75it/s] 0: 640x640 1 face, 9.0ms Speed: 3.0ms preprocess, 9.0ms inference, 2.0ms postprocess per image at shape (1, 3, 640, 640) 2023-07-04 09:44:02,583 - ControlNet - INFO - Loading model from cache: control_v11p_sd15_inpaint [ebff9138] 2023-07-04 09:44:02,622 - ControlNet - INFO - Loading preprocessor: inpaint 2023-07-04 09:44:02,622 - ControlNet - INFO - preprocessor resolution = 640 LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:03<00:00, 2.80it/s] Total progress: 100%|██████████████████████████████████████████████████████████████████| 60/60 [00:58<00:00, 1.02it/s] *** Error running before_process: C:\Users\silve\Documents\AI Art\__SDUX\extensions-builtin\extra-options-section\scripts\extra_options_section.py Traceback (most recent call last): File "C:\Users\silve\Documents\AI Art\__SDUX\modules\scripts.py", line 467, in before_process script.before_process(p, *script_args) File "C:\Users\silve\Documents\AI Art\__SDUX\extensions-builtin\extra-options-section\scripts\extra_options_section.py", line 40, in before_process for name, value in zip(self.setting_names, args): TypeError: 'NoneType' object is not iterable --- LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:05<00:00, 3.99it/s] 100%|██████████████████████████████████████████████████████████████████████████████████| 10/10 [00:06<00:00, 1.50it/s] Total progress: 50%|█████████████████████████████████ | 30/60 [00:17<00:22, 1.35it/s] 0: 640x640 1 person, 10.0ms Speed: 4.3ms preprocess, 10.0ms inference, 2.2ms postprocess per image at shape (1, 3, 640, 640) 2023-07-04 09:44:38,073 - ControlNet - INFO - Loading model from cache: control_v11p_sd15_inpaint [ebff9138] 2023-07-04 09:44:38,105 - ControlNet - INFO - Loading preprocessor: inpaint 2023-07-04 09:44:38,105 - ControlNet - INFO - preprocessor resolution = 640 LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:03<00:00, 2.72it/s] 0: 640x640 1 face, 9.0ms Speed: 3.0ms preprocess, 9.0ms inference, 2.0ms postprocess per image at shape (1, 3, 640, 640) 2023-07-04 09:44:44,518 - ControlNet - INFO - Loading model from cache: control_v11p_sd15_inpaint [ebff9138] 2023-07-04 09:44:44,560 - ControlNet - INFO - Loading preprocessor: inpaint 2023-07-04 09:44:44,560 - ControlNet - INFO - preprocessor resolution = 640 LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 100%|████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:03<00:00, 2.73it/s] LoRA Block weight (lora): NeverStyleV2A: 0.5 x [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ['NeverStyleV2A'] [[1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1.0, 1.0, 1, 1, 1, 1.0, 1, 1, 1, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]] [''] 5%|████▏ | 1/20 [00:00<00:18, 1.02it/s] *** Error completing request███████████████████████████ | 31/60 [00:32<02:25, 5.02s/it] *** Arguments: ('task(a7llrbrdlceht9n)', '((masterpiece, best quality)), original, absurdres, ((sfw)), ,\ncreative, interesting, detailed, intricate, colorful,\n((1girl, solo, __Character/characterAgeF2__)),\n((eyes, __Character/characterEyes__)),\n((hair, __Character/characterHair__)),\n((clothes, __Character/characterClothing__)),\n((background, __Concept/conceptTheme__)),\n((colors, __Concept/conceptColor__))', '(worst quality, low quality), letterboxed, text, letter, logo, signed, signature,\nEasyNegative, VeryBadNegative1.3,AsyncNegative6,\n(((nsfw, nude, huge breasts, gigantic breasts, cleavage, bare legs, partially nude, undressed, underwear, revealing clothes, skimpy clothes)))', [], 20, 16, False, False, 2, 1, 10, 2905209456.0, -1.0, 0, 0, 0, False, 640, 640, True, 0.5, 1.2, '4x_foolhardy_Remacri', 10, 0, 0, 18, '', '', [], 0, True, {'ad_model': 'person_yolov8n-seg.pt', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'control_v11p_sd15_inpaint [ebff9138]', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': }, {'ad_model': 'face_yolov8n.pt', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'control_v11p_sd15_inpaint [ebff9138]', 'ad_controlnet_module': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': }, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 2048, 128, True, True, True, False, True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', , , False, '', 0.5, True, False, '', 'Lerp', False, 'NONE:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\nALL:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\nINS:1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0\nIND:1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0\nINALL:1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0\nMIDD:1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0\nOUTD:1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0\nOUTS:1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1\nOUTALL:1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1\nALL0.5:0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5\n\nNBASE:0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\nNIN01:1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\nNIN02:1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1\nNIN04:1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1\nNIN05:1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1\nNIN07:1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1\nNIN08:1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1\nNMID:0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1\nNOUT03:1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1\nNOUT04:1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1\nNOUT05:1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1\nNOUT06:1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1\nNOUT07:1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1\nNOUT08:1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1\nNOUT09:1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1\nNOUT10:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1\nNOUT11:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0\nNINS:0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1\nNIND:1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1\nNINALL:0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1\nNMIDD:1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1\nNOUTD:1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1\nNOUTS:1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0\nBASENINALL:1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1', True, 0, 'values', '0,0.25,0.5,0.75,1', 'Block ID', 'IN05-OUT05', 'none', '', '0.5,1', 'BASE,IN00,IN01,IN02,IN03,IN04,IN05,IN06,IN07,IN08,IN09,IN10,IN11,M00,OUT00,OUT01,OUT02,OUT03,OUT04,OUT05,OUT06,OUT07,OUT08,OUT09,OUT10,OUT11', 1.0, 'black', '20', False, 'ATTNDEEPON:IN05-OUT05:attn:1\n\nATTNDEEPOFF:IN05-OUT05:attn:0\n\nPROJDEEPOFF:IN05-OUT05:proj:0\n\nXYZ:::1', False, False, False, 0, 1, 1, 0, 0, 0, 0, False, 'Default', False, False, False, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, None, None, False, 50) {} Traceback (most recent call last): File "C:\Users\silve\Documents\AI Art\__SDUX\modules\call_queue.py", line 55, in f res = list(func(*args, **kwargs)) File "C:\Users\silve\Documents\AI Art\__SDUX\modules\call_queue.py", line 35, in f res = func(*args, **kwargs) File "C:\Users\silve\Documents\AI Art\__SDUX\modules\txt2img.py", line 57, in txt2img processed = processing.process_images(p) File "C:\Users\silve\Documents\AI Art\__SDUX\modules\processing.py", line 620, in process_images res = process_images_inner(p) File "C:\Users\silve\Documents\AI Art\__SDUX\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs) File "C:\Users\silve\Documents\AI Art\__SDUX\modules\processing.py", line 739, in process_images_inner samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts) File "C:\Users\silve\Documents\AI Art\__SDUX\modules\processing.py", line 992, in sample samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x)) File "C:\Users\silve\Documents\AI Art\__SDUX\modules\sd_samplers_kdiffusion.py", line 439, in sample samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={ File "C:\Users\silve\Documents\AI Art\__SDUX\modules\sd_samplers_kdiffusion.py", line 278, in launch_sampling return func() File "C:\Users\silve\Documents\AI Art\__SDUX\modules\sd_samplers_kdiffusion.py", line 439, in samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={ File "C:\Users\silve\Documents\AI Art\__SDUX\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "C:\Users\silve\Documents\AI Art\__SDUX\repositories\k-diffusion\k_diffusion\sampling.py", line 594, in sample_dpmpp_2m denoised = model(x, sigmas[i] * s_in, **extra_args) File "C:\Users\silve\Documents\AI Art\__SDUX\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\silve\Documents\AI Art\__SDUX\modules\sd_samplers_kdiffusion.py", line 190, in forward devices.test_for_nans(x_out, "unet") File "C:\Users\silve\Documents\AI Art\__SDUX\modules\devices.py", line 158, in test_for_nans raise NansException(message) modules.devices.NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check. --- ```
k52252467 commented 1 year ago

The latest version of WEBUI, there will be this problem when using controlnet in I2I, please help to solve it, I can only use Face Editor to replace this plug-in

tachyon-beep commented 1 year ago

I've noticed this same problem with batch sizes greater than 1. When I run the exact same batches with adetailer turned off, they come out ok.