Bing-su / adetailer

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

[Bug]: Adetailer doesnt work after the last update #212

Closed jiorgio closed 12 months ago

jiorgio commented 1 year ago

Describe the bug

Hi, I just updated Adetailer through the extension tab of A111 (i've also updated controlnet and sd web ui in the same time). And after that, i can't use adetailer. I tried in Txt2img and img2img and i have the same error : AttributeError: 'StableDiffusionProcessingTxt2Img' object has no attribute 'batch_index'

I tried to uninstall adetailer and reinstall it. I tried to restart the computer before and after rinstalling, but i still have the same problem. Could you help me please

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

venv "D:\IA\SUPERSD\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Commit hash: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8
Installing requirements for Web UI

Launching Web UI with arguments: --api
No module 'xformers'. Proceeding without it.
[-] ADetailer initialized. version: 23.7.6, num models: 9
2023-07-16 16:46:23,731 - ControlNet - INFO - ControlNet v1.1.232
ControlNet preprocessor location: D:\IA\SUPERSD\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-07-16 16:46:23,818 - ControlNet - INFO - ControlNet v1.1.232
Loading weights [980cb713af] from D:\IA\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\reliberate_v10.safetensors
Creating model from config: D:\IA\SUPERSD\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying cross attention optimization (Doggettx).
Textual inversion embeddings loaded(2): aishwaryarai-8-005-2800, jpkennedy
Model loaded in 4.1s (create model: 0.4s, apply weights to model: 0.6s, apply half(): 0.9s, move model to device: 0.9s, load textual inversion embeddings: 1.2s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Data shape for DDIM sampling is (1, 4, 75, 100), eta 0.0
Running DDIM Sampling with 50 timesteps
DDIM Sampler: 100%|████████████████████████████████████████████████████████████████████| 50/50 [02:50<00:00,  3.42s/it]
Error running postprocess_batch: D:\IA\SUPERSD\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py22s/it]
Traceback (most recent call last):
  File "D:\IA\SUPERSD\stable-diffusion-webui\modules\scripts.py", line 422, in postprocess_image
    script.postprocess_image(p, pp, *script_args)
  File "D:\IA\SUPERSD\stable-diffusion-webui\extensions\adetailer\adetailer\traceback.py", line 156, in wrapper
    raise error from None
AttributeError:
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                            System info                                                           │
│ ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓               │
│ ┃             ┃ Value                                                                            ┃               │
│ ┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩               │
│ │    Platform │ Windows-10-10.0.19044-SP0                                                        │               │
│ │      Python │ 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] │               │
│ │     Version │ ------                                                                           │               │
│ │      Commit │ ------                                                                           │               │
│ │ Commandline │ ['launch.py', '--api']                                                           │               │
│ └─────────────┴──────────────────────────────────────────────────────────────────────────────────┘               │
│                                                      Inputs                                                      │
│ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
│ ┃                 ┃ Value                                                                                      ┃ │
│ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │
│ │          prompt │ RAW photo, 1girl with caramel skin and black hair, lying in the bed, wavy      │ │
│ │                 │ hair, <lora:add_detail:1>, side view, looking at a laptop,     │ │
│ │                 │ nightgown                                                                                  │ │
│ │ negative_prompt │ (ugly:1.4), ugly hair, ((bad anatomy)), (((bad proportions))), ((extra limbs)), cloned     │ │
│ │                 │ face, (((disfigured))), out of frame, ugly, extra limbs, (bad anatomy), gross proportions, │ │
│ │                 │ (malformed limbs), ((missing arms)), ((missing legs)), (((extra arms))), (((extra legs))), │ │
│ │                 │ (mutated hands:1.2), (fused fingers:1.1), (too many fingers:1.3), (((long neck))),         │ │
│ │                 │ Photoshop, tiling, (poorly drawn hands:1.2), poorly drawn feet, poorly drawn face, out of  │ │
│ │                 │ frame, mutation, mutated, extra limbs, extra legs, extra arms, disfigured, deformed,       │ │
│ │                 │ cross-eye, body out of frame, bad art, bad anatomy, extra arms, ((lipstick)), caucasian,   │ │
│ │                 │ (3D render), ((3D character)), ugly, bad shape, baby face, extra arms, extra legs,         │ │
│ │                 │ disformed, too much light, extra laptop, too much exposure, canvas frame, ((disfigured)),  │ │
│ │                 │ ((bad art)), ((deformed)),((extra limbs)),((b&w)), weird colors, (((duplicate))),          │ │
│ │                 │ ((morbid)), ((mutilated)), , extra fingers, mutated hands, ((poorly drawn hands)),         │ │
│ │                 │ ((poorly drawn face)), (((mutation))), (((deformed))), ((ugly)), ((bad anatomy)), (((bad   │ │
│ │                 │ proportions))), ((extra limbs)), cloned face, (((disfigured))), out of frame, ugly, extra  │ │
│ │                 │ limbs, (bad anatomy), gross proportions, (malformed limbs), ((missing arms)), ((missing    │ │
│ │                 │ legs)), (((extra arms))), (((extra legs))), mutated hands, (fused fingers), (too many      │ │
│ │                 │ fingers), (((long neck))), Photoshop, tiling, poorly drawn hands, poorly drawn feet,       │ │
│ │                 │ poorly drawn face, out of frame, mutation, mutated, extra limbs, extra legs, extra arms,   │ │
│ │                 │ disfigured, deformed, cross-eye, body out of frame, bad art, bad anatomy, extra arms,      │ │
│ │                 │ ((lipstick)), (blurry:1.4), (blur:1.3), (afro:1.8), (blurry hair:1.5), NSFW        │ │
│ │          n_iter │ 2                                                                                          │ │
│ │      batch_size │ 1                                                                                          │ │
│ │           width │ 800                                                                                        │ │
│ │          height │ 600                                                                                        │ │
│ │    sampler_name │ DDIM                                                                                       │ │
│ │       enable_hr │ False                                                                                      │ │
│ │     hr_upscaler │ Latent                                                                                     │ │
│ │      checkpoint │ reliberate_v10.safetensors [980cb713af]                                                    │ │
│ │             vae │ Automatic                                                                                  │ │
│ │            unet │ ------                                                                                     │ │
│ └─────────────────┴────────────────────────────────────────────────────────────────────────────────────────────┘ │
│                 ADetailer                                                                                        │
│ ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓                                                                       │
│ ┃                     ┃ Value            ┃                                                                       │
│ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩                                                                       │
│ │             version │ 23.7.6           │                                                                       │
│ │            ad_model │ face_yolov8n.pt  │                                                                       │
│ │           ad_prompt │ <lora:nochy:1> │                                                                       │
│ │  ad_negative_prompt │                  │                                                                       │
│ │ ad_controlnet_model │ None             │                                                                       │
│ │              is_api │ False            │                                                                       │
│ └─────────────────────┴──────────────────┘                                                                       │
│ ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮             │
│ │ D:\IA\SUPERSD\stable-diffusion-webui\extensions\adetailer\adetailer\traceback.py:136 in wrapper  │             │
│ │                                                                                                  │             │
│ │   133 │   │   width = width - 4 if width > 4 else None                                           │             │
│ │   134 │   │   console = Console(file=string, force_terminal=force_terminal, width=width)         │             │
│ │   135 │   │   try:                                                                               │             │
│ │ ❱ 136 │   │   │   return func(*args, **kwargs)                                                   │             │
│ │   137 │   │   except Exception as e:                                                             │             │
│ │   138 │   │   │   tables = [                                                                     │             │
│ │   139 │   │   │   │   get_table(title, data)                                                     │             │
│ │                                                                                                  │             │
│ │ D:\IA\SUPERSD\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py:609 in           │             │
│ │ postprocess_image                                                                                │             │
│ │                                                                                                  │             │
│ │   606 │   │   init_image = copy(pp.image)                                                        │             │
│ │   607 │   │   arg_list = self.get_args(p, *args_)                                                │             │
│ │   608 │   │                                                                                      │             │
│ │ ❱ 609 │   │   if p.scripts is not None and self.need_call_postprocess(p):                        │             │
│ │   610 │   │   │   dummy = Processed(p, [], p.seed, "")                                           │             │
│ │   611 │   │   │   with preseve_prompts(p):                                                       │             │
│ │   612 │   │   │   │   p.scripts.postprocess(copy(p), dummy)                                      │             │
│ │                                                                                                  │             │
│ │ D:\IA\SUPERSD\stable-diffusion-webui\extensions\adetailer\scripts\!adetailer.py:500 in           │             │
│ │ need_call_postprocess                                                                            │             │
│ │                                                                                                  │             │
│ │   497 │                                                                                          │             │
│ │   498 │   @staticmethod                                                                          │             │
│ │   499 │   def need_call_postprocess(p) -> bool:                                                  │             │
│ │ ❱ 500 │   │   i = p.batch_index                                                                  │             │
│ │   501 │   │   return i == 0                                                                      │             │
│ │   502 │                                                                                          │             │
│ │   503 │   @rich_traceback                                                                        │             │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯             │
│ AttributeError: 'StableDiffusionProcessingTxt2Img' object has no attribute 'batch_index'                         │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Data shape for DDIM sampling is (1, 4, 75, 100), eta 0.0
Running DDIM Sampling with 50 timesteps
DDIM Sampler: 100%|████████████████████████████████████████████████████████████████████| 50/50 [05:57<00:00,  7.14s/it]

List of installed extensions

adetailer version : ee75bb8e (Sat Jul 15 17:20:38 2023) sd-webui-controlnet version : 07bed6cc (Sat Jul 8 20:54:01 2023)

aurelscha commented 1 year ago

same here, i revert to an older commit to make it works for the moment

Bing-su commented 1 year ago

Try updating sd-webui, batch_index was added 3 months ago...

endlessvn2604 commented 12 months ago

Same Issue here, got this error instantly after update ADetailer, I'm using latest sd-webui. The image is still generated, but not using ADetailer even enabled.

Error running postprocess_batch: M:\Stable\stable-diffusion-webui\extensions\adetailer\scripts!adetailer.py Traceback (most recent call last): File "M:\Stable\stable-diffusion-webui\modules\scripts.py", line 462, in postprocess_image script.postprocess_image(p, pp, *script_args) File "M:\Stable\stable-diffusion-webui\extensions\adetailer\adetailer\traceback.py", line 156, in wrapper raise error from None AttributeError: System info
Value
│ │ Platform │ Windows-10-10.0.22621-SP0 │ │ │ │ Python │ 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] │ │ │ │ Version │ ------ │ │ │ │ Commit │ ------ │ │ │ │ Commandline │ ['launch.py', '--opt-sdp-no-mem-attention', '--no-half-vae', '--xformers', '--disable-nan-check', '--medvram',] │

FxyDreamer commented 12 months ago

exactly the same issue as the op, got this error after update ADetailer, I'm using latest sd-webui. The image is still generated, but not using ADetailer even enabled.

kirin161 commented 12 months ago

Same issue here. sd-webUI is the latest version. The extension was working as of July 14, 2023. Same as @FxyDreamer, image is generated but not using ADetailer.

kirin161 commented 12 months ago

same here, i revert to an older commit to make it works for the moment

@aurelscha which version/commit did you revert to?

jiorgio commented 12 months ago

Try updating sd-webui, batch_index was added 3 months ago...

if fixed it lol. Silly me. Thank you for all.

TaanSpot commented 12 months ago

Just adding onto the list, I am seeing this same error as well. My logs are identical to what everyone else is posting.

jiorgio commented 12 months ago

My stableduffusion wasn't up to date. When i updated, it fixed the issue.

Envoyé de mon Galaxy S9+ Orange Envoyé à partir de Outlook pour Androidhttps://aka.ms/AAb9ysg


From: TaanSpot @.> Sent: Tuesday, July 18, 2023 1:42:08 AM To: Bing-su/adetailer @.> Cc: jiorgio @.>; Author @.> Subject: Re: [Bing-su/adetailer] [Bug]: Adetailer doesnt work after the last update (Issue #212)

Just adding onto the list, I am seeing this same error as well. My logs are identical to what everyone else is posting.

— Reply to this email directly, view it on GitHubhttps://github.com/Bing-su/adetailer/issues/212#issuecomment-1639520489, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGTQZ4HQMAUTJKHZH3T4QXTXQYO3BANCNFSM6AAAAAA2MFIN5I. You are receiving this because you authored the thread.Message ID: @.***>

FxyDreamer commented 12 months ago

Sorry, I don't quite understand, if I'm using a google colab notebook, what should I update?

Synchanx commented 12 months ago

same error, adetiler wont work, im very sad about that

attributeError: ╭──────────────────────────────────────────────────────────────────────────╮ │ System info │ │ ┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │ │ ┃ ┃ Value ┃ │ │ ┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ │ │ Platform │ Linux-5.15.109+-x86_64-with-glibc2.31 │ │ │ │ Python │ 3.10.12 (main, Jun 7 2023, 12:45:35) [GCC 9.4.0] │ │ │ │ Version │ ------ │ │ │ │ Commit │ ------ │ │ │ │ Commandline │ ['launch.py', '--listen', '--xformers', │ │ │ │ │ '--enable-insecure-extension-access', '--theme', │ │ │ │ │ 'dark', '--gradio-queue', '--multiple', '--api'] │ │ │ └─────────────┴────────────────────────────────────────────────────────┘ │ │ Inputs │ │ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │ │ ┃ ┃ Value ┃ │ │ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ │ │ prompt │ masterpiece, sexy girl, │ │ │ │ negative_prompt │ │ │ │ │ n_iter │ 1 │ │ │ │ batch_size │ 1 │ │ │ │ width │ 512 │ │ │ │ height │ 512 │ │ │ │ sampler_name │ Euler a │ │ │ │ enable_hr │ False │ │ │ │ hr_upscaler │ Latent │ │ │ │ checkpoint │ revAnimated_v11.safetensors │ │ │ │ vae │ Automatic │ │ │ │ unet │ ------ │ │ │ └─────────────────┴──────────────────────────────┘ │ │ ADetailer │ │ ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓ │ │ ┃ ┃ Value ┃ │ │ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩ │ │ │ version │ 23.7.6 │ │ │ │ ad_model │ face_yolov8n.pt │ │ │ │ ad_prompt │ perfect face │ │ │ │ ad_negative_prompt │ │ │ │ │ ad_controlnet_model │ None │ │ │ │ is_api │ False │ │ │ └─────────────────────┴─────────────────┘ │ │ ╭───────────────── Traceback (most recent call last) ──────────────────╮ │ │ │ /content/stable-diffusion-webui/extensions/adetailer/adetailer/trace │ │ │ │ back.py:136 in wrapper │ │ │ │ │ │ │ │ 133 │ │ width = width - 4 if width > 4 else None │ │ │ │ 134 │ │ console = Console(file=string, force_terminal=force_te │ │ │ │ 135 │ │ try: │ │ │ │ ❱ 136 │ │ │ return func(*args, *kwargs) │ │ │ │ 137 │ │ except Exception as e: │ │ │ │ 138 │ │ │ tables = [ │ │ │ │ 139 │ │ │ │ get_table(title, data) │ │ │ │ │ │ │ │ /content/stable-diffusion-webui/extensions/adetailer/scripts/!adetai │ │ │ │ ler.py:609 in postprocess_image │ │ │ │ │ │ │ │ 606 │ │ init_image = copy(pp.image) │ │ │ │ 607 │ │ arg_list = self.get_args(p, args_) │ │ │ │ 608 │ │ │ │ │ │ ❱ 609 │ │ if p.scripts is not None and self.need_call_postproces │ │ │ │ 610 │ │ │ dummy = Processed(p, [], p.seed, "") │ │ │ │ 611 │ │ │ with preseve_prompts(p): │ │ │ │ 612 │ │ │ │ p.scripts.postprocess(copy(p), dummy) │ │ │ │ │ │ │ │ /content/stable-diffusion-webui/extensions/adetailer/scripts/!adetai │ │ │ │ ler.py:500 in need_call_postprocess │ │ │ │ │ │ │ │ 497 │ │ │ │ │ 498 │ @staticmethod │ │ │ │ 499 │ def need_call_postprocess(p) -> bool: │ │ │ │ ❱ 500 │ │ i = p.batch_index │ │ │ │ 501 │ │ return i == 0 │ │ │ │ 502 │ │ │ │ │ 503 │ @rich_traceback │ │ │ ╰──────────────────────────────────────────────────────────────────────╯ │ │ AttributeError: 'StableDiffusionProcessingTxt2Img' object has no │ │ attribute 'batch_index' │ ╰──────────────────────────────────────────────────────────────────────────╯

kirin161 commented 12 months ago

Sorry, I don't quite understand, if I'm using a google colab notebook, what should I update?

If you are using the notebook from https://github.com/camenduru/stable-diffusion-webui-colab, the sd-webui can be a few versions behind (see the last line of the screenshot). The stable notebook is still using the webui from March.

What I don't quite get is why it worked last week with the old sd-webui....so weird.

image
Bing-su commented 12 months ago

I fixed it, but I recommend you update your webui as well.

theWitchR commented 12 months ago

@Bing-su I'm still getting assertion error on LastBen's fast stable diffusion collab notebook. LastBen is saying they updated the pre-packaged deps. But still no for me.

roy19931217 commented 1 month ago

I have update my webui, but still have same problem.