Mikubill / sd-webui-controlnet

WebUI extension for ControlNet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: When batch count is more than 1 with control net enabled, i get aNansException: and generation fails

Andy91xx opened this issue · comments

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?

When batch count is above 1 with control net enabled i get a 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

when batch count is set at 1 the generation works as intended or while control net is disabled i can generation multiple generations as normal .

Steps to reproduce the problem

1 enable controlnet select settings etc
2 write prompts etc set batch count above 1 for example i usually select 5 and run generation
3 nan expection

What should have happened?

i should be able to set the batch count above 1 and generation desired number of generations with control net enabled

Commit where the problem happens

webui:
controlnet:

What browsers do you use to access the UI ?

No response

Command Line Arguments

--listen

List of enabled extensions

LDSR
Lora  
ScuNET  
SwinIR
canvas-zoom-and-pan  
extra-options-section  
hypertile
mobile
postprocessing-for-training
prompt-bracket-checker
soft-inpainting
a1111-sd-webui-tagcomplete
adetailer
openpose-editor
sd-civitai-browser-plus
sd-dynamic-prompts
sd-dynamic-thresholding
sd-ratio-lock
sd-webui-bg-mask
sd-webui-controlnet
sd-webui-prompt-history
sd-webui-regional-prompter
stable-diffusion-webui-rembg

Console logs

venv "C:\Users\andy9\Documents\sd.webui\webui\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.9.3
Commit hash: 1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0
Launching Web UI with arguments: --listen
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
[-] ADetailer initialized. version: 24.4.2, num models: 16
*** Error loading script: main.py
    Traceback (most recent call last):
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\scripts.py", line 508, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\script_loading.py", line 13, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "C:\Users\andy9\Documents\sd.webui\webui\extensions\openpose-editor\scripts\main.py", line 14, in <module>
        from basicsr.utils.download_util import load_file_from_url
    ModuleNotFoundError: No module named 'basicsr'

---
CivitAI Browser+: Aria2 RPC started
ControlNet preprocessor location: C:\Users\andy9\Documents\sd.webui\webui\extensions\sd-webui-controlnet\annotator\downloads
2024-05-14 22:38:35,669 - ControlNet - INFO - ControlNet v1.1.448
Loading weights [fb79f124fb] from C:\Users\andy9\Documents\sd.webui\webui\models\Stable-diffusion\galenaMixLegacy_reduxV30.safetensors
Creating model from config: C:\Users\andy9\Documents\sd.webui\webui\configs\v1-inference.yaml
2024-05-14 22:38:36,227 - ControlNet - INFO - ControlNet UI callback registered.
C:\Users\andy9\Documents\sd.webui\webui\venv\lib\site-packages\huggingface_hub\file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Running on local URL:  http://0.0.0.0:7860
Loading VAE weights specified in settings: C:\Users\andy9\Documents\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.ckpt
Applying attention optimization: Doggettx... done.
Model loaded in 1.9s (load weights from disk: 0.2s, create model: 0.6s, apply weights to model: 0.8s, load VAE: 0.1s).

To create a public link, set `share=True` in `launch()`.
Startup time: 16.0s (prepare environment: 2.4s, import torch: 3.0s, import gradio: 0.6s, setup paths: 0.7s, initialize shared: 0.2s, other imports: 0.4s, load scripts: 3.9s, create ui: 0.6s, gradio launch: 4.3s).
WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Users\andy9\Documents\sd.webui\webui\extensions\sd-dynamic-prompts\wildcards\clothesWildcards_v10\Knit_outfit\Knit_outfit.json has unsupported value for key modelId
WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Users\andy9\Documents\sd.webui\webui\extensions\sd-dynamic-prompts\wildcards\clothesWildcards_v10\Knit_outfit\Knit_outfit.json has unsupported value for key modelVersionId
WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Users\andy9\Documents\sd.webui\webui\extensions\sd-dynamic-prompts\wildcards\clothesWildcards_v10\Wedding dress\Wedding dress.json has unsupported value for key modelId
WARNING:dynamicprompts.wildcards.collection.structured:Wildcard file C:\Users\andy9\Documents\sd.webui\webui\extensions\sd-dynamic-prompts\wildcards\clothesWildcards_v10\Wedding dress\Wedding dress.json has unsupported value for key modelVersionId
INFO:sd_dynamic_prompts.dynamic_prompting:Prompt matrix will create 30 images in a total of 30 batches.
2024-05-14 22:39:12,374 - ControlNet - INFO - unit_separate = False, style_align = False
2024-05-14 22:39:12,540 - ControlNet - INFO - Loading model: control_v11p_sd15_openpose [cab727d4]
2024-05-14 22:39:12,850 - ControlNet - INFO - Loaded state_dict from [C:\Users\andy9\Documents\sd.webui\webui\extensions\sd-webui-controlnet\models\control_v11p_sd15_openpose.pth]
2024-05-14 22:39:12,851 - ControlNet - INFO - controlnet_default_config
2024-05-14 22:39:14,729 - ControlNet - INFO - ControlNet model control_v11p_sd15_openpose [cab727d4](ControlModelType.ControlNet) loaded.
2024-05-14 22:39:14,744 - ControlNet - INFO - Using preprocessor: none
2024-05-14 22:39:14,744 - ControlNet - INFO - preprocessor resolution = 512
2024-05-14 22:39:14,931 - ControlNet - INFO - ControlNet Hooked - Time = 2.559664249420166
100%|██████████████████████████████████████████████████████████████████████████████████| 40/40 [00:08<00:00,  4.57it/s]
tiled upscale: 100%|███████████████████████████████████████████████████████████████████| 15/15 [00:00<00:00, 36.85it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 15/15 [00:38<00:00,  2.57s/it]
Total progress:   3%|██▏                                                             | 55/1650 [00:49<58:58,  2.22s/it]
0: 448x640 1 face, 79.3ms
Speed: 2.0ms preprocess, 79.3ms inference, 13.0ms postprocess per image at shape (1, 3, 448, 640)
100%|██████████████████████████████████████████████████████████████████████████████████| 17/17 [00:03<00:00,  5.50it/s]
  0%|                                                                                           | 0/40 [00:00<?, ?it/s]
*** Error completing request
*** Arguments: ('task(vc4ouu9apgx2xf6)', <gradio.routes.Request object at 0x000001E0093AA230>, '(masterpiece, best quality, perfect hourglass figure, wide waist,(masterpiece, best quality,), busty, perfect face, flawless eyes, beautiful lips, full lips, sultry look, head tilt,  <lora:add_detail:-0.2>, perfect waist, cowboy shot, perfect hips, <lora:sanpaku-eyes-v2:0.8> , sanpaku, round pupils, wide smile, huge breasts, saggy breasts,((ombre orange hair)), two-tone hair, multicolored hair, <lora:Ombre Hair:0.7>, tlong hair, <lora:concave:0.8> , concave bangs, BREAK (blush:1.2), wearing  a ({pink:1.4|red:1.4|purple:1.4}, __200WildcardsNSFWAnd_sdWildcards/swimwear__, surreal fantasy stunning landscape background, in a pool of water, (((bare arms))), sleeveless, \n', '(worst quality:1.6, low quality:1.6), fat, ugly, lowres, blurry, FastNegativeV2, easynegative, cat ears, wrinkles, (earrings), (hands), watermark, signature, moles, (((rainbow hair))), detached sleeves, sleeves, holding, sheet, towel, clothes, ', [], 1, 1, 8, 512, 768, True, 0.4, 2, 'R-ESRGAN 4x+ Anime6B', 15, 0, 0, 'Use same checkpoint', 'Use same sampler', 'Use same scheduler', '', '', [], 0, 40, 'Euler a', 'Automatic', False, '', 0.8, -1, False, -1, 0, 0, 0, True, False, {'ad_model': 'face_yolov8n.pt', 'ad_model_classes': '', 'ad_prompt': '(masterpiece, best quality), perfect face, flawless eyes, pink eyes, beautiful lips, full lips, <lora:add_detail:-0.2>, <lora:sanpaku-eyes-v2:0.8> , sanpaku, round pupils, wide smile,<lora:concave:0.8> , concave bangs, head tilt,', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_k_largest': 0, '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_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_model_classes': '', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_k_largest': 0, '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_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, True, True, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 30, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', False, 7, 100, 'Constant', 0, 'Constant', 0, 4, True, 'MEAN', 'AD', 1, ControlNetUnit(is_ui=True, input_mode=<InputMode.SIMPLE: 'simple'>, batch_images='', output_dir='', loopback=False, enabled=False, module='none', model='control_v11p_sd15_openpose [cab727d4]', weight=1.0, image={'image': array([[[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        ...,
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]]], dtype=uint8), 'mask': array([[[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        ...,
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]]], dtype=uint8)}, resize_mode=<ResizeMode.INNER_FIT: 'Crop and Resize'>, low_vram=False, processor_res=512, threshold_a=0.5, threshold_b=0.5, guidance_start=0.0, guidance_end=0.45, pixel_perfect=True, control_mode=<ControlMode.BALANCED: 'Balanced'>, inpaint_crop_input_image=False, hr_option=<HiResFixOption.BOTH: 'Both'>, save_detected_map=True, advanced_weighting=None, effective_region_mask=None, pulid_mode=<PuLIDMode.FIDELITY: 'Fidelity'>, ipadapter_input=None, mask=None, batch_mask_dir=None, animatediff_batch=False, batch_modifiers=[], batch_image_files=[]), ControlNetUnit(is_ui=True, input_mode=<InputMode.SIMPLE: 'simple'>, batch_images='', output_dir='', loopback=False, enabled=False, module='openpose_full', model='control_v11p_sd15_openpose [cab727d4]', weight=1.0, image={'image': array([[[174, 199, 196],
***         [171, 204, 201],
***         [155, 191, 185],
***         ...,
***         [ 13,  18,  21],
***         [ 11,  18,  23],
***         [ 15,  24,  26]],
***
***        [[164, 199, 204],
***         [157, 201, 204],
***         [168, 208, 207],
***         ...,
***         [ 15,  18,  26],
***         [ 11,  21,  25],
***         [ 12,  21,  26]],
***
***        [[151, 194, 200],
***         [148, 195, 199],
***         [153, 197, 196],
***         ...,
***         [ 15,  20,  28],
***         [ 14,  21,  28],
***         [ 13,  21,  29]],
***
***        ...,
***
***        [[206, 203, 198],
***         [206, 204, 200],
***         [207, 206, 201],
***         ...,
***         [108, 109, 103],
***         [108, 108, 103],
***         [107, 107, 103]],
***
***        [[206, 203, 198],
***         [206, 205, 201],
***         [207, 206, 202],
***         ...,
***         [106, 106, 100],
***         [106, 104, 101],
***         [105, 106, 100]],
***
***        [[208, 205, 200],
***         [207, 206, 202],
***         [209, 205, 204],
***         ...,
***         [107, 107, 101],
***         [106, 105,  99],
***         [103, 101,  96]]], dtype=uint8), 'mask': array([[[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        ...,
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]],
***
***        [[0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0],
***         ...,
***         [0, 0, 0],
***         [0, 0, 0],
***         [0, 0, 0]]], dtype=uint8)}, resize_mode=<ResizeMode.INNER_FIT: 'Crop and Resize'>, low_vram=False, processor_res=512, threshold_a=0.5, threshold_b=0.5, guidance_start=0.0, guidance_end=1.0, pixel_perfect=True, control_mode=<ControlMode.BALANCED: 'Balanced'>, inpaint_crop_input_image=False, hr_option=<HiResFixOption.BOTH: 'Both'>, save_detected_map=True, advanced_weighting=None, effective_region_mask=None, pulid_mode=<PuLIDMode.FIDELITY: 'Fidelity'>, ipadapter_input=None, mask=None, batch_mask_dir=None, animatediff_batch=False, batch_modifiers=[], batch_image_files=[]), ControlNetUnit(is_ui=True, input_mode=<InputMode.SIMPLE: 'simple'>, batch_images='', output_dir='', loopback=False, enabled=False, module='none', model='None', weight=1.0, image=None, resize_mode=<ResizeMode.INNER_FIT: 'Crop and Resize'>, low_vram=False, processor_res=-1, threshold_a=-1.0, threshold_b=-1.0, guidance_start=0.0, guidance_end=1.0, pixel_perfect=False, control_mode=<ControlMode.BALANCED: 'Balanced'>, inpaint_crop_input_image=False, hr_option=<HiResFixOption.BOTH: 'Both'>, save_detected_map=True, advanced_weighting=None, effective_region_mask=None, pulid_mode=<PuLIDMode.FIDELITY: 'Fidelity'>, ipadapter_input=None, mask=None, batch_mask_dir=None, animatediff_batch=False, batch_modifiers=[], batch_image_files=[]), False, False, 'Matrix', 'Columns', 'Mask', 'Prompt', '1,1', '0.2', False, False, False, 'Attention', [False], '0', '0', '0.4', None, '0', '0', False, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False, None, None, False, None, None, False, None, None, False, 50, [], 30, '', 4, [], 1, '', '', '', '') {}
    Traceback (most recent call last):
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\txt2img.py", line 109, in txt2img
        processed = processing.process_images(p)
      File "C:\Users\andy9\Documents\sd.webui\webui\extensions\sd-webui-prompt-history\lib_history\image_process_hijacker.py", line 21, in process_images
        res = original_function(p)
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\processing.py", line 845, in process_images
        res = process_images_inner(p)
      File "C:\Users\andy9\Documents\sd.webui\webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 59, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\processing.py", line 981, 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\andy9\Documents\sd.webui\webui\extensions\sd-webui-controlnet\scripts\hook.py", line 463, in process_sample
        return process.sample_before_CN_hack(*args, **kwargs)
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\processing.py", line 1328, in sample
        samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\sd_samplers_kdiffusion.py", line 218, in sample
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\sd_samplers_common.py", line 272, in launch_sampling
        return func()
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\sd_samplers_kdiffusion.py", line 218, in <lambda>
        samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
      File "C:\Users\andy9\Documents\sd.webui\webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "C:\Users\andy9\Documents\sd.webui\webui\repositories\k-diffusion\k_diffusion\sampling.py", line 145, in sample_euler_ancestral
        denoised = model(x, sigmas[i] * s_in, **extra_args)
      File "C:\Users\andy9\Documents\sd.webui\webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
      File "C:\Users\andy9\Documents\sd.webui\webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
        return forward_call(*args, **kwargs)
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\sd_samplers_cfg_denoiser.py", line 269, in forward
        devices.test_for_nans(x_out, "unet")
      File "C:\Users\andy9\Documents\sd.webui\webui\modules\devices.py", line 255, 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.

---

Additional information

same problem exists on two seperate instances of SD

commented

Same issue here.
The Problem only occurs when Adetailer is enabled together with Controlnet.

So the error only occurs if:

in txt2img: Controlnet Enabled + Adetailer enabled + Batch count > 1
in img2img: Controlnet Enabled + Adetailer enabled + SD Upscale Script enabled