vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.71k stars 425 forks source link

[Issue]: TypeError: 'NoneType' object is not callable (Major Breakdown) #2092

Closed StableInfo closed 1 year ago

StableInfo commented 1 year ago

Issue Description

Hello, I can't run sd.next at all today, No restarting will fix it, no going back to default settings would fix it, no deactivating of extensions I installed yesterday is fixing this.

So when I start sd.next, there is not error message, then if I press "generate" with ANY settng/parameter/prompt possible I get this major breakdown (see logs),

Finally I decided I might want to go bring back DEFAULT Settings in the "User Interface Defaults", I restarted the app and tried to apply ANY word in the positive prompt, and I got the same errors (see logs below) even with fresh settings (everything default).

here is an image of everything at "default": image

What's happening here? I am not able to work.

Version Platform Description

app: SD.next updated: 2023-08-22 hash: 6a4d4ea5

Relevant log output

9:29:32-821892 ERROR    Exception: 'NoneType' object is not callable
09:29:32-824384 ERROR    Arguments: args=('task(iseha7o9l44wudm)', 'a', '', [], 20, None, None, True, False, False, 1,
                         1, 6, 6, 0.7, 1, -1.0, -1.0, 0, 0, 0, 512, 512, False, 0.3, 2, 'None', 20, 0, 0, 0.8, '', '',
                         [], 0, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, False, 10,
                         1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2,
                         -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2,
                         '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0,
                         False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '',
                         'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False,
                         0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 3072, 192, True, True, True,
                         False, False, 7, 100, 'Constant', 0, 'Constant', 0, 4, True, 'MEAN', 'AD', 1,
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x0000023F2F00EE30>,
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x0000023EF61A4070>,
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x0000023EF61A4730>,
                         <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x0000023F2F0614B0>,
                         False, {'ad_model': 'face_yolov8n.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_sampler': False, 'ad_sampler': 'UniPC',
                         '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': 'inpaint_global_harmonious', '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_sampler': False, 'ad_sampler': 'UniPC',
                         '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': 'inpaint_global_harmonious', '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', '', False, 0, 16, 8, 'mm_sd_v15.ckpt', None, '',
                         None, True, False, False, False, False, False, 0, 0, '0', 0, False, True, 0, 'Portrait of a
                         [gender]', 'blurry', 20, ['UniPC'], '', 0, 'None', 1, 1, '', False, False, False, 1, 0,
                         'Portrait of a [gender]', 'blurry', 20, ['UniPC'], '', 0, None, '', None, True, False, False,
                         False, False, False, 0, 0, '1', 0, False, True, 0, 'Portrait of a [gender]', 'blurry', 20,
                         ['UniPC'], '', 0, 'None', 1, 1, '', False, False, False, 1, 0, 'Portrait of a [gender]',
                         'blurry', 20, ['UniPC'], '', 0, None, '', None, True, False, False, False, False, False, 0, 0,
                         '2', 0, False, True, 0, 'Portrait of a [gender]', 'blurry', 20, ['UniPC'], '', 0, 'None', 1,
                         1, '', False, False, False, 1, 0, 'Portrait of a [gender]', 'blurry', 20, ['UniPC'], '', 0,
                         'CodeFormer', 1, 1, 'None', 1, 1, ['After Upscaling/Before Restore Face'], 0, 'Portrait of a
                         [gender]', 'blurry', 20, ['UniPC'], '', 0, False, False, 'positive', 'comma', 0, False, False,
                         '', 0, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False, None, None, False,
                         None, None, False, None, None, False, None, None, False, 50, 'Long prompt to short prompt', 0,
                         8, 1000, 0, '0.1', '0.1', '1', '1', None, None, None, None, None) kwargs={}
09:29:33-007915 ERROR    gradio call: TypeError
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ D:\vladNEXTGEN\automatic\modules\call_queue.py:34 in f                                                              │
│                                                                                                                     │
│    33 │   │   │   try:                                                                                              │
│ >  34 │   │   │   │   res = func(*args, **kwargs)                                                                   │
│    35 │   │   │   │   progress.record_results(id_task, res)                                                         │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\modules\txt2img.py:65 in txt2img                                                           │
│                                                                                                                     │
│   64 │   if processed is None:                                                                                      │
│ > 65 │   │   processed = processing.process_images(p)                                                               │
│   66 │   p.close()                                                                                                  │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\modules\processing.py:565 in process_images                                                │
│                                                                                                                     │
│    564 │   │   else:                                                                                                │
│ >  565 │   │   │   res = process_images_inner(p)                                                                    │
│    566 │   finally:                                                                                                 │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\extensions-builtin\sd-webui-controlnet\scripts\batch_hijack.py:42 in                       │
│ processing_process_images_hijack                                                                                    │
│                                                                                                                     │
│    41 │   │   │   # we are not in batch mode, fallback to original function                                         │
│ >  42 │   │   │   return getattr(processing, '__controlnet_original_process_images_inner')(p,                       │
│    43                                                                                                               │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\modules\processing.py:681 in process_images_inner                                          │
│                                                                                                                     │
│    680 │   │   │   if shared.backend == shared.Backend.ORIGINAL:                                                    │
│ >  681 │   │   │   │   uc = get_conds_with_caching(prompt_parser.get_learned_conditioning, p.ne                     │
│    682 │   │   │   │   c = get_conds_with_caching(prompt_parser.get_multicond_learned_condition                     │
│                                                                                                                     │
│                                              ... 15 frames hidden ...                                               │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\venv\lib\site-packages\torch\nn\modules\module.py:1501 in _call_impl                       │
│                                                                                                                     │
│   1500 │   │   │   │   or _global_forward_hooks or _global_forward_pre_hooks):                                      │
│ > 1501 │   │   │   return forward_call(*args, **kwargs)                                                             │
│   1502 │   │   # Do not call functions when jit is used                                                             │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\venv\lib\site-packages\transformers\models\clip\modeling_clip.py:274 in forward            │
│                                                                                                                     │
│    273 │   │   # get query proj                                                                                     │
│ >  274 │   │   query_states = self.q_proj(hidden_states) * self.scale                                               │
│    275 │   │   key_states = self._shape(self.k_proj(hidden_states), -1, bsz)                                        │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\venv\lib\site-packages\torch\nn\modules\module.py:1501 in _call_impl                       │
│                                                                                                                     │
│   1500 │   │   │   │   or _global_forward_hooks or _global_forward_pre_hooks):                                      │
│ > 1501 │   │   │   return forward_call(*args, **kwargs)                                                             │
│   1502 │   │   # Do not call functions when jit is used                                                             │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\extensions-builtin\Lora\lora.py:403 in lora_Linear_forward                                 │
│                                                                                                                     │
│   402 │                                                                                                             │
│ > 403 │   return torch.nn.Linear_forward_before_lora(self, input)                                                   │
│   404                                                                                                               │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\extensions-builtin\a1111-sd-webui-lycoris\lycoris.py:741 in lyco_Linear_forward            │
│                                                                                                                     │
│   740 │                                                                                                             │
│ > 741 │   return torch.nn.Linear_forward_before_lyco(self, input)                                                   │
│   742                                                                                                               │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
TypeError: 'NoneType' object is not callable

Backend

Original

Model

Other

Acknowledgements

vladmandic commented 1 year ago

Issue happens in lycoris extnsion. I'll investigate, but as a temporary workaround you can just disable extension (can't uninstall it as it's a flagged as builtin one, but you can disable it)

StableInfo commented 1 year ago

Indeed, now it's working, thank you.

vladmandic commented 1 year ago

i've tried to reproduce this with so many different combos and i cant reproduce. does the issue occure if you start sdnext with --safe?

StableInfo commented 1 year ago

I reactivated Lycoris and now Its not giving the same error message, it gives me some error but the GENERATION of images goes through. The issue I raised was not letting me even generating images, now it works differenlty for some reason.

Progress 1.05it/s ---------------------------------------- 100% 0:00:00 0:00:19
00:32:35-843245 ERROR    activating extra network lyco: AttributeError
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ D:\vladNEXTGEN\automatic\modules\extra_networks.py:80 in activate                                                   │
│                                                                                                                     │
│    79 │   │   try:                                                                                                  │
│ >  80 │   │   │   extra_network.activate(p, [])                                                                     │
│    81 │   │   except Exception as e:                                                                                │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\extensions-builtin\a1111-sd-webui-lycoris\extra_networks_lyco.py:53 in activate            │
│                                                                                                                     │
│   52 │   │   elif self.base_name == 'lyco':                                                                         │
│ > 53 │   │   │   additional = shared.opts.sd_lyco                                                                   │
│   54                                                                                                                │
│                                                                                                                     │
│ D:\vladNEXTGEN\automatic\modules\shared.py:680 in __getattr__                                                       │
│                                                                                                                     │
│    679 │   │   │   return self.data_labels[item].default                                                            │
│ >  680 │   │   return super(Options, self).__getattribute__(item) # pylint: disable=super-with-                     │
│    681                                                                                                              │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
AttributeError: 'Options' object has no attribute 'sd_lyco'
100%|██████████████████████████████████████████████████████████████████████████████████| 34/34 [00:15<00:00,  2.18it/s]

You mean this command right? ">py launch.py --safe" I am running it right now and Read some interesting logs: WARNING Not used, uninstalling: xformers 0.0.20 ... WARNING Package wrong version: transformers 4.25.1 required 4.31.0 ...

StableInfo commented 1 year ago

OMG what happened? All the extensions, do not appear anymore: EVEN CONTROL NET image

Is that like Safe mode for computer meaning with 0 extension? Anyway, yes the images were generated with 0error this time! However the image generated WAS DIFFERENT for the same parameters and seed etc.

StableInfo commented 1 year ago

I reloaded it now normally without safe. It works fine and wth NO error.

vladmandic commented 1 year ago

Xofrmers being unimstalled is normal - if you're not using them, they will be unimstalled as some modules load them blindly even if they are not selected. If you want to use xformers, just select them in settings and they will be installed and used.

But wrong version for transformers tells me that some extension modified system requirements - and based on specific version, it could be dreambooth - it's notorious for doing that.

Anyhow, glad it's now working.