Bing-su / adetailer

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

[Bug]: Error running postprocess_image #697

Open bluelovers opened 2 weeks ago

bluelovers commented 2 weeks ago

Describe the bug

*** Error running postprocess_image: D:\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 912, in postprocess_image
        script.postprocess_image(p, pp, *script_args)
      File "D:\stable-diffusion-webui\extensions\adetailer\aaaaaa\traceback.py", line 173, in wrapper
        raise error from None
    RuntimeError:
    ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │                                                   System info                                                    │
    │ ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
    │ ┃             ┃ Value                                                                                          ┃ │
    │ ┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │
    │ │    Platform │ Windows-10-10.0.22631-SP0                                                                      │ │
    │ │      Python │ 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]             │ │
    │ │     Version │ v1.9.4-269-g16f48993                                                                           │ │
    │ │      Commit │ 16f48993e07bf16c7c2a281124cbf4a68eae323b                                                       │ │
    │ │ Commandline │ ['launch.py', '--listen', '--api', '--enable-insecure-extension-access', '--styles-file',      │ │
    │ │             │ 'D:/sd-data/.data/styles.csv', '--port', '17860', '--xformers', '--gradio-allowed-path',       │ │
    │ │             │ 'D:/sd-data/outputs']                                                                          │ │
    │ │   Libraries │ {'torch': '2.1.2+cu121', 'torchvision': '0.16.2+cu121', 'ultralytics': '8.2.28', 'mediapipe':  │ │
    │ │             │ '0.10.14'}                                                                                     │ │
    │ └─────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┘ │
    │                                                      Inputs                                                      │
    │ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
    │ ┃                 ┃ Value                                                                                      ┃ │
    │ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │
    │ │          prompt │ (otherworldly), highly insanely detailed, masterpiece, top quality, best quality, highres, │ │
    │ │                 │ 4k, 8k, RAW photo, (very aesthetic, beautiful and aesthetic), #, (xiangsu, xiang su, 8bit, │ │
    │ │                 │ 16bit, pixel, pixelart, pixel art:1.4), ,                                                  │ │
    │ │                 │ #, upper body,                                                                             │ │
    │ │                 │ #, face focus,                                                                             │ │
    │ │                 │ #, portrait,                                                                               │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/dataset/char-view__,                                                   │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/cosplay-char/*/*/prompts__,                                            │ │
    │ │                 │ #, ((Ancient Egypt theme, ancient egyptian theme)),                                        │ │
    │ │                 │ #, ancient egyptian symbol, ancient egyptian hieroglyphic,                                 │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ __lazy-wildcards/cosplay-char/golden_boy/terayama_reiko/prompts__,                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ <lora:ANIME_ReikoTerayama_aiwaifu-10:1>,                                                   │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/prompts/showcase__,                                                    │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, (completely nude, nude, topless:1.3), skirt,                                            │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ (1girl:1.3),                                                                               │ │
    │ │                 │ #, eyes focus,                                                                             │ │
    │ │                 │ #, solo focus,                                                                             │ │
    │ │                 │ #, asian, korean,                                                                          │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/costume/clothes__,                                                     │ │
    │ │                 │ #, __lazy-wildcards/subject/costume/sfw-civitai/prompts__,                                 │ │
    │ │                 │ #, __lazy-wildcards/subject/costume-*/*/prompts__,                                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/subject/costume-elem/costume-breasts/prompts__,                        │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, {1-2$$__lazy-wildcards/dataset/costume-weapon__},                                       │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, jav_milf,                                                                               │ │
    │ │                 │ #, Tower13_Gizelle,                                                                        │ │
    │ │                 │ #, Tower13_Desiree,                                                                        │ │
    │ │                 │ #, a beautiful elvish girl,                                                                │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, (dark_skin, tan_skin, tanned skin, dark skin, dark-skinned, black-skinned, bronze skin, │ │
    │ │                 │ bronzed skin:1.1),                                                                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/prompts/hair__,                                                        │ │
    │ │                 │ #, (__lazy-wildcards/char/haircolor__),                                                    │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/subject/*/*/prompts__,                                                 │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, a colorful background, (Abstract colored background),                                   │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/dataset/background-color__,                                            │ │
    │ │                 │ #, __lazy-wildcards/background/color-multi__,                                              │ │
    │ │                 │ #, __lazy-wildcards/background/color-transparent__,                                        │ │
    │ │                 │ __lazy-wildcards/dataset/background__,                                                     │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/dataset/style__,                                                       │ │
    │ │                 │ #, __lazy-wildcards/subject/moment/random/prompts__, __BoChars*/female/*__, (fantasy       │ │
    │ │                 │ world)                                                                                     │ │
    │ │ negative_prompt │ EasyNegative, (normal quality, low quality, worst quality:1.4), jpeg artifacts, (username, │ │
    │ │                 │ watermark, signature, time signature, timestamp, artist name, artist signature, artist     │ │
    │ │                 │ logo, twitter username, patreon username, copyright name, copyright notice, copyright      │ │
    │ │                 │ abbreviation, copyright signature, copyright, web address, address, date, datetime),       │ │
    │ │                 │ (loli, child, infant, baby:1.3), (bad anatomy, extra digits, extra_fingers, wrong finger,  │ │
    │ │                 │ inaccurate limb, bad hand, bad fingers), (African American, African:1.6), (tits, nipple,   │ │
    │ │                 │ nipples:1.6), (pubic hair:1.6), multiple views, multiple frame                             │ │
    │ │          n_iter │ 3                                                                                          │ │
    │ │      batch_size │ 1                                                                                          │ │
    │ │           width │ 512                                                                                        │ │
    │ │          height │ 768                                                                                        │ │
    │ │    sampler_name │ DPM++ 2M                                                                                   │ │
    │ │       enable_hr │ False                                                                                      │ │
    │ │     hr_upscaler │ Latent                                                                                     │ │
    │ │      checkpoint │ 05.AnimePastel\meinacetusorionmix_v10.safetensors [0a880e98ab]                             │ │
    │ │             vae │ kl-f8-anime2.ckpt                                                                          │ │
    │ │            unet │ Automatic                                                                                  │ │
    │ └─────────────────┴────────────────────────────────────────────────────────────────────────────────────────────┘ │
    │                                                    ADetailer                                                     │
    │ ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
    │ ┃                     ┃ Value                                                                                  ┃ │
    │ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │
    │ │             version │ 24.9.0-dev.0                                                                           │ │
    │ │            ad_model │ hand_yolov8n.pt                                                                        │ │
    │ │           ad_prompt │ (perfect face, beautiful face, perfect lips, perfect mouth, perfect detailed leg,      │ │
    │ │                     │ beautiful detailed leg, perfect accurate limb, perfect beautiful breasts, perfect      │ │
    │ │                     │ body, perfect anatomy), (perfect hands, perfect hand anatomy, perfect finger,          │ │
    │ │                     │ beautiful finger, perfect hands, good hands:1.2), beautiful and aesthetic, [PROMPT]    │ │
    │ │  ad_negative_prompt │                                                                                        │ │
    │ │ ad_controlnet_model │ Passthrough                                                                            │ │
    │ │              is_api │ True                                                                                   │ │
    │ └─────────────────────┴────────────────────────────────────────────────────────────────────────────────────────┘ │
    │ ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮             │
    │ │ D:\stable-diffusion-webui\extensions\adetailer\aaaaaa\traceback.py:153 in wrapper                │             │
    │ │                                                                                                  │             │
    │ │   152 │   │   try:                                                                               │             │
    │ │ ❱ 153 │   │   │   return func(*args, **kwargs)                                                   │             │
    │ │   154 │   │   except Exception as e:                                                             │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py:908 in postprocess_image    │             │
    │ │                                                                                                  │             │
    │ │    907 │   │   │   │   │   continue                                                              │             │
    │ │ ❱  908 │   │   │   │   is_processed |= self._postprocess_image_inner(p, pp, args, n=n)           │             │
    │ │    909                                                                                           │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py:865 in                      │             │
    │ │ _postprocess_image_inner                                                                         │             │
    │ │                                                                                                  │             │
    │ │    864 │   │   │   try:                                                                          │             │
    │ │ ❱  865 │   │   │   │   processed = process_images(p2)                                            │             │
    │ │    866 │   │   │   except NansException as e:                                                    │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\modules\processing.py:849 in process_images                            │             │
    │ │                                                                                                  │             │
    │ │    848 │   │   with profiling.Profiler():                                                        │             │
    │ │ ❱  849 │   │   │   res = process_images_inner(p)                                                 │             │
    │ │    850                                                                                           │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\modules\processing.py:923 in process_images_inner                      │             │
    │ │                                                                                                  │             │
    │ │    922 │   │   with devices.autocast():                                                          │             │
    │ │ ❱  923 │   │   │   p.init(p.all_prompts, p.all_seeds, p.all_subseeds)                            │             │
    │ │    924                                                                                           │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\modules\processing.py:1724 in init                                     │             │
    │ │                                                                                                  │             │
    │ │   1723 │   │   else:                                                                             │             │
    │ │ ❱ 1724 │   │   │   raise RuntimeError(f"bad number of images passed: {len(imgs)}; expecting {se  │             │
    │ │   1725                                                                                           │             │
    │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯             │
    │ RuntimeError: bad number of images passed: 3; expecting 1 or less                                                │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

---
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  6.50it/s]
[sd-webui-pnginfo-injection] postprocess p.extra_generation_params: 34 {
  "model": "0a880e98ab",
  "lora:ANIME_ReikoTerayama_aiwaifu-10": "23d9bec344",
  "wildcards:lazy_wildcards": "EE2C671AA8",
  "wildcards:C0rn_Fl4k3s": "E5C633CC29",
  "embed:EasyNegative": "c74b4e810b",
  "vae": "df3c506e51"
}
[sd-webui-pnginfo-injection] {
  "setup": 1,
  "before_process": 1,
  "process": 1,
  "process_batch": 2,
  "postprocess_batch": 2,
  "postprocess_batch_list": 2,
  "postprocess": 2,
  "postprocess_image": 1,
  "postprocess_maskoverlay": 1,
  "before_image_saved": 1
}

0: 640x448 2 hands, 4.1ms
Speed: 2.0ms preprocess, 4.1ms inference, 0.0ms postprocess per image at shape (1, 3, 640, 448)
tiled upscale: 100%|█████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00,  4.83it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 10/10 [00:01<00:00,  5.92it/s]
[-] ADetailer: applied 1st ad_prompt: '(otherworldly), highly insanely detailed, masterpiece, top quality, best quality,
highres, 4k, 8k, RAW photo, (very aesthetic, beautiful and aesthetic), (perfect face, beautiful face, perfect lips,
perfect mouth, perfect detailed leg, beautiful detailed leg, perfect accurate limb, perfect beautiful breasts, perfect
body, perfect anatomy), (perfect hands, perfect hand anatomy, perfect finger, beautiful finger, perfect hands, good
hands:1.2), beautiful and aesthetic, (otherworldly), highly insanely detailed, masterpiece, top quality, best quality,
highres, 4k, 8k, RAW photo, (very aesthetic, beautiful and aesthetic),  \nterayama reiko,ReikoTerayama_aiwaifu,black
hair,makeup,lipstick,brown eyes,east asian architecture,highway background,motor vehicle,red motorcycle, \n
\n<lora:ANIME_ReikoTerayama_aiwaifu-10:1>, \n \n(1girl:1.3), \n \nsandy blonde background,dark gray background,(dripping
colors background,psychedelic color background,tie-dye color background),, (fantasy world)'
tiled upscale: 100%|█████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00,  4.96it/s]
tiled upscale: 100%|█████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00,  4.98it/s]
tiled upscale: 100%|█████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00,  4.93it/s]
*** Error running postprocess_image: D:\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\scripts.py", line 912, in postprocess_image
        script.postprocess_image(p, pp, *script_args)
      File "D:\stable-diffusion-webui\extensions\adetailer\aaaaaa\traceback.py", line 173, in wrapper
        raise error from None
    RuntimeError:
    ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │                                                   System info                                                    │
    │ ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
    │ ┃             ┃ Value                                                                                          ┃ │
    │ ┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │
    │ │    Platform │ Windows-10-10.0.22631-SP0                                                                      │ │
    │ │      Python │ 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]             │ │
    │ │     Version │ v1.9.4-269-g16f48993                                                                           │ │
    │ │      Commit │ 16f48993e07bf16c7c2a281124cbf4a68eae323b                                                       │ │
    │ │ Commandline │ ['launch.py', '--listen', '--api', '--enable-insecure-extension-access', '--styles-file',      │ │
    │ │             │ 'D:/sd-data/.data/styles.csv', '--port', '17860', '--xformers', '--gradio-allowed-path',       │ │
    │ │             │ 'D:/sd-data/outputs']                                                                          │ │
    │ │   Libraries │ {'torch': '2.1.2+cu121', 'torchvision': '0.16.2+cu121', 'ultralytics': '8.2.28', 'mediapipe':  │ │
    │ │             │ '0.10.14'}                                                                                     │ │
    │ └─────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┘ │
    │                                                      Inputs                                                      │
    │ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
    │ ┃                 ┃ Value                                                                                      ┃ │
    │ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │
    │ │          prompt │ (otherworldly), highly insanely detailed, masterpiece, top quality, best quality, highres, │ │
    │ │                 │ 4k, 8k, RAW photo, (very aesthetic, beautiful and aesthetic), #, (xiangsu, xiang su, 8bit, │ │
    │ │                 │ 16bit, pixel, pixelart, pixel art:1.4), ,                                                  │ │
    │ │                 │ #, upper body,                                                                             │ │
    │ │                 │ #, face focus,                                                                             │ │
    │ │                 │ #, portrait,                                                                               │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/dataset/char-view__,                                                   │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/cosplay-char/*/*/prompts__,                                            │ │
    │ │                 │ #, ((Ancient Egypt theme, ancient egyptian theme)),                                        │ │
    │ │                 │ #, ancient egyptian symbol, ancient egyptian hieroglyphic,                                 │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ __lazy-wildcards/cosplay-char/golden_boy/terayama_reiko/prompts__,                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ <lora:ANIME_ReikoTerayama_aiwaifu-10:1>,                                                   │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/prompts/showcase__,                                                    │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, (completely nude, nude, topless:1.3), skirt,                                            │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ (1girl:1.3),                                                                               │ │
    │ │                 │ #, eyes focus,                                                                             │ │
    │ │                 │ #, solo focus,                                                                             │ │
    │ │                 │ #, asian, korean,                                                                          │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/costume/clothes__,                                                     │ │
    │ │                 │ #, __lazy-wildcards/subject/costume/sfw-civitai/prompts__,                                 │ │
    │ │                 │ #, __lazy-wildcards/subject/costume-*/*/prompts__,                                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/subject/costume-elem/costume-breasts/prompts__,                        │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, {1-2$$__lazy-wildcards/dataset/costume-weapon__},                                       │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, jav_milf,                                                                               │ │
    │ │                 │ #, Tower13_Gizelle,                                                                        │ │
    │ │                 │ #, Tower13_Desiree,                                                                        │ │
    │ │                 │ #, a beautiful elvish girl,                                                                │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, (dark_skin, tan_skin, tanned skin, dark skin, dark-skinned, black-skinned, bronze skin, │ │
    │ │                 │ bronzed skin:1.1),                                                                         │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/prompts/hair__,                                                        │ │
    │ │                 │ #, (__lazy-wildcards/char/haircolor__),                                                    │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/subject/*/*/prompts__,                                                 │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, a colorful background, (Abstract colored background),                                   │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/dataset/background-color__,                                            │ │
    │ │                 │ #, __lazy-wildcards/background/color-multi__,                                              │ │
    │ │                 │ #, __lazy-wildcards/background/color-transparent__,                                        │ │
    │ │                 │ __lazy-wildcards/dataset/background__,                                                     │ │
    │ │                 │ #,                                                                                         │ │
    │ │                 │ #, __lazy-wildcards/dataset/style__,                                                       │ │
    │ │                 │ #, __lazy-wildcards/subject/moment/random/prompts__, __BoChars*/female/*__, (fantasy       │ │
    │ │                 │ world)                                                                                     │ │
    │ │ negative_prompt │ EasyNegative, (normal quality, low quality, worst quality:1.4), jpeg artifacts, (username, │ │
    │ │                 │ watermark, signature, time signature, timestamp, artist name, artist signature, artist     │ │
    │ │                 │ logo, twitter username, patreon username, copyright name, copyright notice, copyright      │ │
    │ │                 │ abbreviation, copyright signature, copyright, web address, address, date, datetime),       │ │
    │ │                 │ (loli, child, infant, baby:1.3), (bad anatomy, extra digits, extra_fingers, wrong finger,  │ │
    │ │                 │ inaccurate limb, bad hand, bad fingers), (African American, African:1.6), (tits, nipple,   │ │
    │ │                 │ nipples:1.6), (pubic hair:1.6), multiple views, multiple frame                             │ │
    │ │          n_iter │ 3                                                                                          │ │
    │ │      batch_size │ 1                                                                                          │ │
    │ │           width │ 512                                                                                        │ │
    │ │          height │ 768                                                                                        │ │
    │ │    sampler_name │ DPM++ 2M                                                                                   │ │
    │ │       enable_hr │ False                                                                                      │ │
    │ │     hr_upscaler │ Latent                                                                                     │ │
    │ │      checkpoint │ 05.AnimePastel\meinacetusorionmix_v10.safetensors [0a880e98ab]                             │ │
    │ │             vae │ kl-f8-anime2.ckpt                                                                          │ │
    │ │            unet │ Automatic                                                                                  │ │
    │ └─────────────────┴────────────────────────────────────────────────────────────────────────────────────────────┘ │
    │                                                    ADetailer                                                     │
    │ ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
    │ ┃                     ┃ Value                                                                                  ┃ │
    │ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │
    │ │             version │ 24.9.0-dev.0                                                                           │ │
    │ │            ad_model │ hand_yolov8n.pt                                                                        │ │
    │ │           ad_prompt │ (perfect face, beautiful face, perfect lips, perfect mouth, perfect detailed leg,      │ │
    │ │                     │ beautiful detailed leg, perfect accurate limb, perfect beautiful breasts, perfect      │ │
    │ │                     │ body, perfect anatomy), (perfect hands, perfect hand anatomy, perfect finger,          │ │
    │ │                     │ beautiful finger, perfect hands, good hands:1.2), beautiful and aesthetic, [PROMPT]    │ │
    │ │  ad_negative_prompt │                                                                                        │ │
    │ │ ad_controlnet_model │ Passthrough                                                                            │ │
    │ │              is_api │ True                                                                                   │ │
    │ └─────────────────────┴────────────────────────────────────────────────────────────────────────────────────────┘ │
    │ ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮             │
    │ │ D:\stable-diffusion-webui\extensions\adetailer\aaaaaa\traceback.py:153 in wrapper                │             │
    │ │                                                                                                  │             │
    │ │   152 │   │   try:                                                                               │             │
    │ │ ❱ 153 │   │   │   return func(*args, **kwargs)                                                   │             │
    │ │   154 │   │   except Exception as e:                                                             │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py:908 in postprocess_image    │             │
    │ │                                                                                                  │             │
    │ │    907 │   │   │   │   │   continue                                                              │             │
    │ │ ❱  908 │   │   │   │   is_processed |= self._postprocess_image_inner(p, pp, args, n=n)           │             │
    │ │    909                                                                                           │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py:865 in                      │             │
    │ │ _postprocess_image_inner                                                                         │             │
    │ │                                                                                                  │             │
    │ │    864 │   │   │   try:                                                                          │             │
    │ │ ❱  865 │   │   │   │   processed = process_images(p2)                                            │             │
    │ │    866 │   │   │   except NansException as e:                                                    │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\modules\processing.py:849 in process_images                            │             │
    │ │                                                                                                  │             │
    │ │    848 │   │   with profiling.Profiler():                                                        │             │
    │ │ ❱  849 │   │   │   res = process_images_inner(p)                                                 │             │
    │ │    850                                                                                           │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\modules\processing.py:923 in process_images_inner                      │             │
    │ │                                                                                                  │             │
    │ │    922 │   │   with devices.autocast():                                                          │             │
    │ │ ❱  923 │   │   │   p.init(p.all_prompts, p.all_seeds, p.all_subseeds)                            │             │
    │ │    924                                                                                           │             │
    │ │                                                                                                  │             │
    │ │ D:\stable-diffusion-webui\modules\processing.py:1724 in init                                     │             │
    │ │                                                                                                  │             │
    │ │   1723 │   │   else:                                                                             │             │
    │ │ ❱ 1724 │   │   │   raise RuntimeError(f"bad number of images passed: {len(imgs)}; expecting {se  │             │
    │ │   1725                                                                                           │             │
    │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯             │
    │ RuntimeError: bad number of images passed: 3; expecting 1 or less                                                │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

---

Steps to reproduce

.

Screenshots

image

Console logs, from start to end.

.

List of installed extensions

No response

dosubot[bot] commented 2 weeks ago

I found a similar issue that might be relevant to your problem: Got this error: RuntimeError: Inference tensors do not track version counter [1].

To resolve the "RuntimeError: bad number of images passed: 3; expecting 1 or less" error when running postprocess_image in ADetailer, ensure that the init_images parameter in the StableDiffusionProcessingImg2Img instance is correctly set to a single image. The error suggests that multiple images are being passed where only one is expected.

Here is a snippet to ensure init_images is correctly set:

def _postprocess_image_inner(self, p, pp, args: ADetailerArgs, *, n: int = 0) -> bool:
    if state.interrupted or state.skipped:
        return False

    i = get_i(p)

    # Ensure pp.image is a single image
    pp.image = ensure_pil_image(pp.image, "RGB")

    i2i = self.get_i2i_p(p, args, pp.image)
    seed, subseed = self.get_seed(p)
    ad_prompts, ad_negatives = self.get_prompt(p, args)

    is_mediapipe = args.is_mediapipe()
    kwargs = {}
    if is_mediapipe:
        predictor = mediapipe_predict
        ad_model = args.ad_model
    else:
        predictor = ultralytics_predict
        ad_model = self.get_ad_model(args.ad_model)
        kwargs["device"] = self.ultralytics_device
        kwargs["classes"] = args.ad_model_classes

    with change_torch_load():
        pred = predictor(ad_model, pp.image, args.ad_confidence, **kwargs)

    if pred.preview is None:
        print(f"[-] ADetailer: nothing detected on image {i + 1} with {ordinal(n + 1)} settings.")
        return False

    masks = self.pred_preprocessing(p, pred, args)
    shared.state.assign_current_image(pred.preview)

    self.save_image(
        p,
        pred.preview,
        condition="ad_save_previews",
        suffix="-ad-preview" + suffix(n, "-"),
    )

    steps = len(masks)
    processed = None
    state.job_count += steps

    if is_mediapipe:
        print(f"mediapipe: {steps} detected.")

    p2 = copy(i2i)
    for j in range(steps):
        p2.image_mask = masks[j]
        p2.init_images[0] = ensure_pil_image(p2.init_images[0], "RGB")
        self.i2i_prompts_replace(p2, ad_prompts, ad_negatives, j)

        if re.match(r"^\s*\[SKIP\]\s*$", p2.prompt):
            continue

        p2.seed = self.get_each_tab_seed(seed, j)
        p2.subseed = self.get_each_tab_seed(subseed, j)

        p2.cached_c = [None, None]
        p2.cached_uc = [None, None]
        try:
            processed = process_images(p2)
        except NansException as e:
            msg = f"[-] ADetailer: 'NansException' occurred with {ordinal(n + 1)} settings.\n{e}"
            print(msg, file=sys.stderr)
            continue
        finally:
            p2.close()
        self.compare_prompt(p.extra_generation_params, processed, n=n)
        p2 = copy(i2i)
        p2.init_images = [processed.images[0]]

    if processed is not None:
        pp.image = processed.images[0]
        return True

    return False

Ensure that pp.image and p2.init_images are always single images and not lists of images. This should resolve the "bad number of images passed" error [2].

To continue talking to Dosu, mention @dosu.

Bing-su commented 2 weeks ago

thanks