krita_stable_diffusion icon indicating copy to clipboard operation
krita_stable_diffusion copied to clipboard

Plugin Config Button is unable to restart Stable Diffusion on Linux

Open metanerd opened this issue 3 years ago • 1 comments

Describe the bug Plugin Config Button is unable to restart Stable Diffusion. I guess, it is not running to begin with.

To Reproduce Steps to reproduce the behavior:

  1. Install plugin and stable diffusion following the Readme.txt for Linux.
  2. Click on Plugin Config "Restart Stable Diffusion" Button
  3. See error
AttributeError
Python 3.8.1: /usr/bin/python3
Sun Oct  2 16:56:35 2022

A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /home/myuser/.local/share/krita/pykrita/krita_stable_diffusion/interface/widgets/button.py in <lambda>()
   19         """
   20         element = QPushButton(self.label)
   21         element.released.connect(lambda: self.release_callback(element))
   22         self.widget = self.initialize_widget(element)
   23 
element = <PyQt5.QtWidgets.QPushButton object>
element.released = <bound PYQT_SIGNAL released of QPushButton object>
element.released.connect = <built-in method connect of PyQt5.QtCore.pyqtBoundSignal object>
self = <krita_stable_diffusion.interface.widgets.button.Button object>
self.release_callback = <bound method ConfigTab.restart_stable_diffusion...usion.interface.tabs.configtab.ConfigTab object>>

 /home/myuser/.local/share/krita/pykrita/krita_stable_diffusion/interface/tabs/configtab.py in restart_stable_diffusion(self=<krita_stable_diffusion.interface.tabs.configtab.ConfigTab object>, _element=<PyQt5.QtWidgets.QPushButton object>)
   28         Restarts the Stable Diffusion Response connection
   29         """
   30         Application.sdresponse_connection.restart()
   31         # os.system("sudo systemctl restart stablediffusiond.service")
   32         # os.system("sudo systemctl restart stablediffusion_responsed.service")
builtinApplication = <PyKrita.krita.Krita object>
Application.sdresponse_connection undefined
AttributeError: 'Krita' object has no attribute 'sdresponse_connection'
    __cause__ = None
    __class__ = <class 'AttributeError'>
    __context__ = None
    __delattr__ = <method-wrapper '__delattr__' of AttributeError object>
    __dict__ = {}
    __dir__ = <built-in method __dir__ of AttributeError object>
    __doc__ = 'Attribute not found.'
    __eq__ = <method-wrapper '__eq__' of AttributeError object>
    __format__ = <built-in method __format__ of AttributeError object>
    __ge__ = <method-wrapper '__ge__' of AttributeError object>
    __getattribute__ = <method-wrapper '__getattribute__' of AttributeError object>
    __gt__ = <method-wrapper '__gt__' of AttributeError object>
    __hash__ = <method-wrapper '__hash__' of AttributeError object>
    __init__ = <method-wrapper '__init__' of AttributeError object>
    __init_subclass__ = <built-in method __init_subclass__ of type object>
    __le__ = <method-wrapper '__le__' of AttributeError object>
    __lt__ = <method-wrapper '__lt__' of AttributeError object>
    __ne__ = <method-wrapper '__ne__' of AttributeError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of AttributeError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of AttributeError object>
    __repr__ = <method-wrapper '__repr__' of AttributeError object>
    __setattr__ = <method-wrapper '__setattr__' of AttributeError object>
    __setstate__ = <built-in method __setstate__ of AttributeError object>
    __sizeof__ = <built-in method __sizeof__ of AttributeError object>
    __str__ = <method-wrapper '__str__' of AttributeError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __suppress_context__ = False
    __traceback__ = <traceback object>
    args = ("'Krita' object has no attribute 'sdresponse_connection'",)
    with_traceback = <built-in method with_traceback of AttributeError object>

The above is a description of an error in a Python program.  Here is
the original traceback:

Traceback (most recent call last):
  File "/home/myuser/.local/share/krita/pykrita/krita_stable_diffusion/interface/widgets/button.py", line 21, in <lambda>
    element.released.connect(lambda: self.release_callback(element))
  File "/home/myuser/.local/share/krita/pykrita/krita_stable_diffusion/interface/tabs/configtab.py", line 30, in restart_stable_diffusion
    Application.sdresponse_connection.restart()
AttributeError: 'Krita' object has no attribute 'sdresponse_connection'

Expected behavior A silent restart.

Desktop (please complete the following information):

  • OS: Linux Mint (Ubuntu 20.04 derivative)

metanerd avatar Oct 02 '22 15:10 metanerd

Thanks will fix

w4ffl35 avatar Oct 02 '22 16:10 w4ffl35