hako-mikan / sd-webui-negpip

Extension for Stable Diffusion web-ui enables negative prompt in prompt
GNU Affero General Public License v3.0
193 stars 15 forks source link

Breaks with SD.Next #7

Closed lbeltrame closed 11 months ago

lbeltrame commented 1 year ago

The code relies on something that is not present in modules.prompt_parser from SD.Next.

Backtrace:

12:49:51-811743 ERROR    Running script process batch:                          
                         extensions/sd-webui-negpip/scripts/negpip.py:          
                         AttributeError                                         
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /notebooks/automatic/modules/scripts.py:467 in process_batch                 │
│                                                                              │
│   466 │   │   │   │   args = p.per_script_args.get(script.title(), p.script_ │
│ ❱ 467 │   │   │   │   script.process_batch(p, *args, **kwargs)               │
│   468 │   │   │   except Exception as e:                                     │
│                                                                              │
│ /notebooks/automatic/extensions/sd-webui-negpip/scripts/negpip.py:149 in     │
│ process_batch                                                                │
│                                                                              │
│   148 │   │                                                                  │
│ ❱ 149 │   │   self.conds_all = calcconds(nip)                                │
│   150 │   │   self.unconds_all = calcconds(pin)                              │
│                                                                              │
│ /notebooks/automatic/extensions/sd-webui-negpip/scripts/negpip.py:141 in     │
│ calcconds                                                                    │
│                                                                              │
│   140 │   │   │   │   │   │   if targets:                                    │
│ ❱ 141 │   │   │   │   │   │   │   conds, contokens = conddealer(targets)     │
│   142 │   │   │   │   │   │   │   regionconds.append([region, conds, contoke │
│                                                                              │
│ /notebooks/automatic/extensions/sd-webui-negpip/scripts/negpip.py:114 in     │
│ conddealer                                                                   │
│                                                                              │
│   113 │   │   │   for target in targets:                                     │
│ ❱ 114 │   │   │   │   input = prompt_parser.SdConditioning([f"({target[0]}:{ │
│   115 │   │   │   │   cond = prompt_parser.get_learned_conditioning(shared.s │
╰──────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'modules.prompt_parser' has no attribute 'SdConditioning'
hako-mikan commented 12 months ago

May be fixed. In Sd.Next, sampler is limited. You cannot use DDIM or similar type of samplers.