Repository: stable-diffusion-webui
Issue: [Bug]: The sudden "math domain error" is displayed, and the image cannot be created.
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

I tried to create an image by turning on the computer today, but the corresponding "math domain error" is displayed, and the image is not generated at all.

### Steps to reproduce the problem

intermittent
The frequency is very high, and it is the same when reinstalled.
It is 99% reproduced in a model converted to bf16.

### What should have happened?

No images are created. You must create it.

### Sysinfo

@echo off

git pull

set PYTHON=
set GIT=
set VENV_DIR=
set CUDA_VISIBLE_DEVICES=0
set COMMANDLINE_ARGS= --opt-split-attention --autolaunch --update-all-extensions --no-half-vae --enable-insecure-extension-access --xformers --xformers-flash-attention --opt-channelslast --use-cpu adetailer --lowvram


call webui.bat

### What browsers do you use to access the UI ?

Microsoft Edge

### Console logs

```Shell
Reusing loaded model 1. Nuri\blazingDrive_V12g.safetensors [623d0528ad] to load A\N.safetensors [74afb00aef]
Loading weights [74afb00aef] from O:\AI\SynologyDrive\stable-diffusion-webui\models\Stable-diffusion\0. A\N.safetensors
Loading VAE weights specified in settings: O:\AI\SynologyDrive\stable-diffusion-webui\models\VAE\zVae_v20.safetensors
Applying attention optimization: xformers... done.
Weights loaded in 5.4s (send model to cpu: 0.3s, load weights from disk: 0.6s, apply weights to model: 3.8s, load VAE: 0.6s).
*** Error completing request
*** Arguments: ('task(7dqcsu2zcdm7zn9)', 
[], 70, 'DPM++ 3M SDE Exponential', 1, 1, 29.5, 768, 512, True, 0.43, 2, '4x-UltraMix_Balanced', 25, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x0000027EE9AF3F70>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, 0.07, True, False, {'ad_model': 'hand_yolov8s.pt', '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 Karras', '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': 'deepfashion2_yolov8s-seg.pt', '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 Karras', '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_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 Karras', '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, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', True, 7, 97, 'Half Cosine Up', 3, 'Power Up', 7, 11, True, 'MEAN', 'AD', 0.9, <scripts.animatediff_ui.AnimateDiffProcess object at 0x0000027F08827910>, True, 'Use same checkpoint', 'Use same vae', 0.3, 0.1, 'None', 'None', False, 0.15, 3, 0.4, 4, 'bicubic', 0.45, 2, True, False, True, False, False, False, 'Use same checkpoint', 'Use same vae', 'txt2img-1pass', 'None', '', '', 'Use same sampler', 'BMAB fast', 20, 7, 0.75, 0.5, 0, 1, False, False, None, '', '', 'Use same sampler', 20, 7, 0.75, 4, 0.35, False, 50, 200, 0.5, False, True, 'stretching', 'center', 'None', 0.85, 0.75, False, 'Use same checkpoint', True, '', '', 'Use same sampler', 'BMAB fast', 20, 7, 0.75, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, None, False, 1, False, '', True, False, False, True, True, 4, 2, 0.1, 1, 1, 0, 0.4, 7, True, False, False, 'Center', 1, '', '', '', '', '', '', '', '', '', '', False, 512, 512, 7, 20, 4, 'Use same sampler', 'Only masked', 32, 'BMAB Face(Normal)', 0.4, 4, 0.3, False, 0.26, True, True, False, 'subframe', '', '', 0.4, 7, True, 2, 0.3, 0.1, 'Whole picture', 32, '', False, False, False, 0.4, 0, 1, False, 'Intermediate', 0.85, 0.4, 10, False, True, 'None', 1.5, 'None', 'Defult', 'None', UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), False, True, 3, 4, 0.15, 0.3, 'bicubic', 0.5, 2, True, False, 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, '', 0, '', [], 0, '', [], 0, '', [], False, False, False, True, 0, False, None, None, False, None, None, False, None, None, False, 50, [], 30, '', 4, [], 1, '', '', '', '') {}
    Traceback (most recent call last):
      File "O:\AI\SynologyDrive\stable-diffusion-webui\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "O:\AI\SynologyDrive\stable-diffusion-webui\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "O:\AI\SynologyDrive\stable-diffusion-webui\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
      File "O:\AI\SynologyDrive\stable-diffusion-webui\modules\processing.py", line 732, in process_images
        res = process_images_inner(p)
      File "O:\AI\SynologyDrive\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 "O:\AI\SynologyDrive\stable-diffusion-webui\modules\processing.py", line 867, 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 "O:\AI\SynologyDrive\stable-diffusion-webui\extensions\sd-webui-bmab\sd_bmab\sd_override\txt2img.py", line 38, in sample
        samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
      File "O:\AI\SynologyDrive\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 198, in sample
        sigmas = self.get_sigmas(p, steps)
      File "O:\AI\SynologyDrive\stable-diffusion-webui\modules\sd_samplers_kdiffusion.py", line 132, in get_sigmas
        sigmas = k_diffusion.sampling.get_sigmas_exponential(n=steps, sigma_min=m_sigma_min, sigma_max=m_sigma_max, device=shared.device)
      File "O:\AI\SynologyDrive\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\sampling.py", line 28, in get_sigmas_exponential
        sigmas = torch.linspace(math.log(sigma_max), math.log(sigma_min), n, device=device).exp()
    ValueError: math domain error

---
```


### Additional information

_No response_