Skip to content

[Bug]:Forge Neo + Torch 2.8 = ADetailer crashes #823

@SCcorpion52

Description

@SCcorpion52

Describe the bug

Hi,

ADetailer crashes when used with Torch 2.8.

Environment:

  • Stable Diffusion WebUI: Forge Neo
  • ADetailer version: 25.3.0
  • Torch: 2.8.0+cu128
  • OS: Windows 11
  • GPU: RTX 4070 (12GB)

Error:
AttributeError: module 'torch' has no attribute 'hash_tensor'

Explanation:
Forge Neo forces a very recent Torch upgrade (2.8).
ADetailer is not compatible with Torch 2.8 yet, which causes it to crash during postprocess_image.

ADetailer works correctly when using older Torch versions.

Thanks.

Steps to reproduce

No response

Screenshots

No response

Console logs, from start to end.

Total progress: 100%|██████████| 45/45 [00:14<00:00,  3.10it/s]s]
[Unload] Trying to free 4056.00 MB for cuda:0 with 1 models keep loaded ... Done.
100%|██████████| 45/45 [00:13<00:00,  3.34it/s]
[Unload] Trying to free 4428.52 MB for cuda:0 with 1 models keep loaded ... Done.

0: 384x640 1 face, 5.6ms
Speed: 15.5ms preprocess, 5.6ms inference, 0.9ms postprocess per image at shape (1, 3, 384, 640)
[Unload] Trying to free 3706.05 MB for cuda:0 with 1 models keep loaded ... Done.
*** Error running postprocess_image: H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI Forge - Neo\extensions\adetailer\scripts\!adetailer.py
    Traceback (most recent call last):
      File "H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI Forge - Neo\modules\scripts.py", line 941, in postprocess_image
        script.postprocess_image(p, pp, *script_args)
      File "H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI Forge - Neo\extensions\adetailer\aaaaaa\traceback.py", line 173, in wrapper
        raise error from None
    AttributeError: 
    ┌─────────────────────────────────────────────────────────────────────────┐
    │                               System info                               │
    │ ┌─────────────┬───────────────────────────────────────────────────────┐ │
    │ │             │ Value                                                 │ │
    │ ├─────────────┼───────────────────────────────────────────────────────┤ │
    │ │    Platform │ Windows-10-10.0.26100-SP0                             │ │
    │ │      Python │ 3.11.13 (main, Jul 23 2025, 00:29:09) [MSC v.1944 64  │ │
    │ │             │ bit (AMD64)]                                          │ │
    │ │     Version │ Unknown (too old or vladmandic)                       │ │
    │ │      Commit │ Unknown                                               │ │
    │ │ Commandline │ ['H:\\Newfolder_9\\Newfolder_3\\Data\\Packages\\Stab… │ │
    │ │             │ Diffusion WebUI Forge - Neo\\launch.py',              │ │
    │ │             │ '--pin-shared-memory', '--cuda-malloc',               │ │
    │ │             │ '--cuda-stream', '--skip-python-version-check',       │ │
    │ │             │ '--gradio-allowed-path',                              │ │
    │ │             │ 'H:\\Newfolder_9\\Newfolder_3\\Data\\Images']         │ │
    │ │   Libraries │ {'torch': '2.8.0+cu128', 'torchvision':               │ │
    │ │             │ '0.23.0+cu128', 'ultralytics': '8.3.242',             │ │
    │ │             │ 'mediapipe': '0.10.14'}                               │ │
    │ └─────────────┴───────────────────────────────────────────────────────┘ │
    │                              Inputs                                     │
    │ ┌─────────────────┬─────────────────────────────────────────────┐       │
    │ │                 │ Value                                       │       │
    │ ├─────────────────┼─────────────────────────────────────────────┤       │
    │ │m          prompt │                                             │       │
    │ │ negative_prompt │                                             │       │
    │ │          n_iter │ 1                                           │       │
    │ │      batch_size │ 1                                           │       │
    │ │           width │ 1280                                        │       │
    │ │          height │ 720                                         │       │
    │ │    sampler_name │ DPM++ 2M SDE                                │       │
    │ │       enable_hr │ False                                       │       │
    │ │     hr_upscaler │ 4x-UltraSharp                               │       │
    │ │      checkpoint │ sd\divingIllustriousFlat_v50VAE.safetensors │       │
    │ │             vae │ Automatic                                   │       │
    │ │            unet │ Automatic                                   │       │
    │ └─────────────────┴─────────────────────────────────────────────┘       │
    │                 ADetailer                                               │
    │ ┌─────────────────────┬─────────────────┐                               │
    │ │                     │ Value           │                               │
    │ ├─────────────────────┼─────────────────┤                               │
    │ │             version │ 25.3.0          │                               │
    │ │            ad_model │ face_yolov8s.pt │                               │
    │ │           ad_prompt │                 │                               │
    │ │  ad_negative_prompt │                 │                               │
    │ │ ad_controlnet_model │ None            │                               │
    │ │              is_api │ False           │                               │
    │ └─────────────────────┴─────────────────┘                               │
    │ ┌───────────────── Traceback (most recent call last) ─────────────────┐ │
    │ │ H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI     │ │
    │ │ Forge - Neo\extensions\adetailer\aaaaaa\traceback.py:153 in wrapper │ │
    │ │                                                                     │ │
    │ │   152 │   │   try:                                                  │ │
    │ │ > 153 │   │   │   return func(*args, **kwargs)                      │ │
    │ │   154 │   │   except Exception as e:                                │ │
    │ │                                                                     │ │
    │ │ H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI     │ │
    │ │ Forge - Neo\extensions\adetailer\scripts\!adetailer.py:916 in       │ │
    │ │ postprocess_image                                                   │ │
    │ │                                                                     │ │
    │ │    915 │   │   │   │   │   continue                                 │ │
    │ │ >  916 │   │   │   │   is_processed |= self._postprocess_image_inne │ │
    │ │    917                                                              │ │
    │ │                                                                     │ │
    │ │ H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI     │ │
    │ │ Forge - Neo\extensions\adetailer\scripts\!adetailer.py:873 in       │ │
    │ │ _postprocess_image_inner                                            │ │
    │ │                                                                     │ │
    │ │    872 │   │   │   try:                                             │ │
    │ │ >  873 │   │   │   │   processed = process_images(p2)               │ │
    │ │    874 │   │   │   except NansException as e:                       │ │
    │ │                                                                     │ │
    │ │ H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI     │ │
    │ │ Forge - Neo\modules\processing.py:834 in process_images             │ │
    │ │                                                                     │ │
    │ │    833 │   │   with profiling.Profiler():                           │ │
    │ │ >  834 │   │   │   res = process_images_inner(p)                    │ │
    │ │    835                                                              │ │
    │ │                                                                     │ │
    │ │ H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI     │ │
    │ │ Forge - Neo\modules\processing.py:964 in process_images_inner       │ │
    │ │                                                                     │ │
    │ │    963 │   │   │                                                    │ │
    │ │ >  964 │   │   │   p.setup_conds()                                  │ │
    │ │    965                                                              │ │
    │ │                                                                     │ │
    │ │ H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI     │ │
    │ │ Forge - Neo\modules\processing.py:491 in setup_conds                │ │
    │ │                                                                     │ │
    │ │    490 │   │   else:                                                │ │
    │ │ >  491 │   │   │   self.uc = self.get_conds_with_caching(prompt_par │ │
    │ │    492                                                              │ │
    │ │                                                                     │ │
    │ │ H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI     │ │
    │ │ Forge - Neo\modules\processing.py:449 in get_conds_with_caching     │ │
    │ │                                                                     │ │
    │ │    448 │   │                                                        │ │
    │ │ >  449 │   │   cached_params = self.cached_params(required_prompts, │ │
    │ │    450                                                              │ │
    │ │                                                                     │ │
    │ │ H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI     │ │
    │ │ Forge - Neo\modules\processing.py:427 in cached_params              │ │
    │ │                                                                     │ │
    │ │    426 │   │   │   opts.emphasis,                                   │ │
    │ │ >  427 │   │   │   torch.hash_tensor(self.init_latent).item() if is │ │
    │ │    428 │   │   )                                                    │ │
    │ │                                                                     │ │
    │ m│ H:\Newfolder_9\Newfolder_3\Data\Packages\Stable Diffusion WebUI     │ │
    │ │ Forge - Neo\venv\Lib\site-packages\torch\__init__.py:2745 in        │ │
    │ │ __getattr__                                                         │ │
    │ │                                                                     │ │
    │ │   2744 │   │                                                        │ │
    │ │ > 2745 │   │   raise AttributeError(f"module '{__name__}' has no at │ │
    │ │   2746                                                              │ │
    │ └─────────────────────────────────────────────────────────────────────┘ │
    │ AttributeError: module 'torch' has no attribute 'hash_tensor'           │
    └─────────────────────────────────────────────────────────────────────────┘

List of installed extensions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions