Interpause / auto-sd-paint-ext

Extension for AUTOMATIC1111 to add custom backend API for Krita Plugin & more
MIT License
475 stars 41 forks source link

error loading SD docker panel - TypeError: unable to convert a QVariant of type 10 to a QMetaType of type 6 #126

Closed jmp909 closed 1 year ago

jmp909 commented 1 year ago

Describe the bug Error on Krita startup TypeError: unable to convert a QVariant of type 10 to a QMetaType of type 6 when loading one of the SD panels (the main panel with txt2img inputs etc..... other panels such as SD Common Options and SD Plugin Config load ok)

To Reproduce Steps to reproduce the behavior:

  1. install latest a1111
  2. load krita (5.1.5)
  3. observe errors

Screenshots Desktop (please complete the following information):

Additional context I installed ControlNet extension but I don't think it's that as I've disabled it and it still is giving the error

jmp909 commented 1 year ago
Error details: ```python TypeError Python 3.8.1: C:\Program Files\Krita (x64)\bin\krita.exe Sun Feb 19 11:17:13 2023 A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. C:\Program Files\Krita (x64)\lib\krita-python-libs\krita\dockwidgetfactory.py in createDockWidget(self=) 14 super(DockWidgetFactory, self).__init__(_id, _dockPosition) 15 self.klass = _klass 16 17 def createDockWidget(self): 18 return self.klass() self = self.klass = .Docker'> C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\docker.py in __init__(self=.Docker object>, *args=(), **kwargs={}) 11 self.setWindowTitle(page.name) 12 self.create_interface() 13 self.update_interface() 14 self.connect_interface() 15 self.setWidget(self.widget) self = .Docker object> self.update_interface = .Docker.upda...iff.docker.create_docker..Docker object>> C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\docker.py in update_interface(self=.Docker object>) 23 24 def update_interface(self): 25 self.page_widget.cfg_init() 26 27 def connect_interface(self): self = .Docker object> self.page_widget = self.page_widget.cfg_init = > C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\pages\img2img.py in cfg_init(self=) 23 24 def cfg_init(self): 25 super(Img2ImgPage, self).cfg_init() 26 27 self.tips.setVisible(not script.cfg("minimize_ui", bool)) builtinsuper = global Img2ImgPage = self = ).cfg_init = > C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\pages\img_base.py in cfg_init(self=) 71 72 def cfg_init(self): 73 self.ext_layout.cfg_init() 74 self.prompt_layout.cfg_init() 75 self.seed_layout.cfg_init() self = self.ext_layout = self.ext_layout.cfg_init = > C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\pages\extension.py in cfg_init(self=) 115 self._init_ext_widgets() 116 for widget in self.ext_widgets.values(): 117 widget.cfg_init() 118 119 def cfg_connect(self): widget = widget.cfg_init = > C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\pages\extension.py in cfg_init(self=) 69 def cfg_init(self): 70 for w in self.widgets: 71 w.cfg_init() 72 73 def cfg_connect(self): w = w.cfg_init = > C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\widgets\spin_box.py in cfg_init(self=) 55 56 def cfg_init(self): 57 val = self.cfg(self.field_cfg, self.cast) 58 cur = self.qspin.value() 59 # prevent cursor from jumping when cfg_init is called by update val undefined self = self.cfg = self.field_cfg = 'scripts_img2img_seedtravel_5' self.cast = C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\config.py in __call__(self=, key='scripts_img2img_seedtravel_5', type=) 34 def __call__(self, key: str, type: type = str): 35 """Shorthand for Config.get()""" 36 return self.get(key, type) 37 38 def get(self, key: str, type: type = str): self = self.get = > key = 'scripts_img2img_seedtravel_5' type = C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\config.py in get(self=, key='scripts_img2img_seedtravel_5', type=) 53 self.model, key 54 ), ERR_MISSING_CONFIG 55 val = self.config.value(key, type=type) 56 return val 57 finally: val undefined self = self.config = self.config.value = key = 'scripts_img2img_seedtravel_5' type = TypeError: unable to convert a QVariant of type 10 to a QMetaType of type 6 __cause__ = None __class__ = __context__ = None __delattr__ = __dict__ = {} __dir__ = __doc__ = 'Inappropriate argument type.' __eq__ = __format__ = __ge__ = __getattribute__ = __gt__ = __hash__ = __init__ = __init_subclass__ = __le__ = __lt__ = __ne__ = __new__ = __reduce__ = __reduce_ex__ = __repr__ = __setattr__ = __setstate__ = __sizeof__ = __str__ = __subclasshook__ = __suppress_context__ = False __traceback__ = args = ('unable to convert a QVariant of type 10 to a QMetaType of type 6',) with_traceback = The above is a description of an error in a Python program. Here is the original traceback: Traceback (most recent call last): File "C:\Program Files\Krita (x64)\lib\krita-python-libs\krita\dockwidgetfactory.py", line 18, in createDockWidget return self.klass() File "C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\docker.py", line 13, in __init__ self.update_interface() File "C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\docker.py", line 25, in update_interface self.page_widget.cfg_init() File "C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\pages\img2img.py", line 25, in cfg_init super(Img2ImgPage, self).cfg_init() File "C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\pages\img_base.py", line 73, in cfg_init self.ext_layout.cfg_init() File "C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\pages\extension.py", line 117, in cfg_init widget.cfg_init() File "C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\pages\extension.py", line 71, in cfg_init w.cfg_init() File "C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\widgets\spin_box.py", line 57, in cfg_init val = self.cfg(self.field_cfg, self.cast) File "C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\config.py", line 36, in __call__ return self.get(key, type) File "C:\Users\J\AppData\Roaming\krita\pykrita\krita_diff\config.py", line 55, in get val = self.config.value(key, type=type) TypeError: unable to convert a QVariant of type 10 to a QMetaType of type 6 ```
Interpause commented 1 year ago

I see, maybe I should just invalidate the extension settings if it runs into an error.

For now, delete krita_diff_plugin_scripts.ini from %APPDATA%\krita (on Windows) or ~/.config/krita (on Linux). When extensions change settings type its problematic.

Interpause commented 1 year ago

That said, by right, the code already replaces the old extension settings if the types change. Weird.