Closed liujvnes closed 6 months ago
What's happening is that the plugin is trying to pull in your settings, using a combination of what you've used before and what's saved in your WebUI's settings. Since this is your first time using the plugin, it's trying to use the defaults I provide in cyanic/default_settings.json
, but it's not finding them.
Can you check where you installed the plugin to see if cyanic/default_settings.json
got deleted? If default_settings.json
is not in the cyanic
folder, then you can download just that file from here and see if that fixes it.
If it's still there, then it's possible that the way I try to find the cyanic
directory isn't working on your computer. Krita doesn't provide a way to find the directory, so I have to ask Python "what directory is my program file in?", which has worked so far. I don't think the folder names being Chinese would mess up Python, but could I get the full path of where you installed cyanic-sd-krita
just in case? I can try to replicate that on my computer and test it.
I'll try to change the code to not break if it can't find the default_settings.json
in the meantime.
There is a default_settings.json file. I generated it once in Stable Diffusion WebUI. Now, no error is reported when opening the software. After connecting after entering the plug-in, an error will be reported when going to txt2img.
TypeError Python 3.10.7: C:\软件\图形图像\Krita 5.2\bin\krita.exe Sun Apr 14 21:36:44 2024
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:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py in change_page(self=
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py in show_txt2img(self=
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\pages\txt2img.py in init(self=
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\models.py in init(self=
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\models.py in init_variables(self=
The above is a description of an error in a Python program. Here is the original traceback:
Traceback (most recent call last): File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py", line 67, in change_page page['content']() File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py", line 78, in show_txt2img self.content_area.setWidget(Txt2ImgPage(self.settings_controller, self.api)) File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\pages\txt2img.py", line 17, in init self.model_widget = ModelsWidget(self.settings_controller, self.api) File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\models.py", line 25, in init self.init_variables() File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\models.py", line 33, in init_variables if len(settings_model) > 0 and settings_model in models: TypeError: object of type 'NoneType' has no len()
Just double checking, you do have a model or two installed for WebUI, right?
I pushed a new version of the models selector code just now, and it should fix these errors, but I'm guessing there's something else that's the root of the problem and this is just where the code is crashing because of it. Still, worth pulling down a new copy and seeing what the next error is.
仔细检查一下,您确实为WebUI安装了一两个模型,对吧?
我刚才推送了模型选择器代码的新版本,它应该可以修复_这些_错误,但我猜还有其他东西是问题的根源,而这正是代码因此而崩溃的地方。尽管如此,还是值得拉下一个新的副本,看看下一个错误是什么。
Thank you very much. I can connect now. txt2img reports an error and img2img runs normally. AttributeError Python 3.10.7: C:\软件\图形图像\Krita 5.2\bin\krita.exe Mon Apr 15 00:07:39 2024
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:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py in handle_generate_btn_click(self=
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py in generate(self=
The above is a description of an error in a Python program. Here is the original traceback:
Traceback (most recent call last): File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py", line 51, in handle_generate_btn_click self.generate() File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py", line 125, in generate for nested_key, nested_value in w_value.items(): AttributeError: 'int' object has no attribute 'items'
OK, I didn't test that last change enough. Try pulling it again and see if it works now.
OK, I didn't test that last change enough. Try pulling it again and see if it works now.
Hello, I can use it after uninstalling it, but ControlNet still reports an error. Please check the reason again. Thank you very much.
KeyError Python 3.10.7: C:\软件\图形图像\Krita 5.2\bin\krita.exe Mon Apr 15 12:13:09 2024
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:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\extension_widgets\controlnet.py in
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\extension_widgets\controlnet.py in set_preprocessor_settings(self=
The above is a description of an error in a Python program. Here is the original traceback:
Traceback (most recent call last):
File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\extension_widgets\controlnet.py", line 140, in
I believe it's a Forge specific bug, where their built-in version of ControlNet has a different API response than the A1111 and SD.Next versions. I've filed a bug report with them about it here. The Forge version omits information needed to create the preprocessor sliders, which can be useful for fine tuning the results.
I pushed a "fix" that skips the preprocessor sliders, avoiding the error. Thanks for your patience with me fixing all these bugs.
I believe it's a Forge specific bug, where their built-in version of ControlNet has a different API response than the A1111 and SD.Next versions. I've filed a bug report with them about it here. The Forge version omits information needed to create the preprocessor sliders, which can be useful for fine tuning the results.
I pushed a "fix" that skips the preprocessor sliders, avoiding the error. Thanks for your patience with me fixing all these bugs.
I understand, I don’t know English, so I use the software to translate and use various functions, mainly photo modification functions. Of course, it would be better if you can develop simplified Chinese. Thank you again for your selfless dedication!
Hello! There is a bug in Remove Background
AttributeError Python 3.10.7: C:\软件\图形图像\Krita 5.2\bin\krita.exe Mon Apr 15 15:17:01 2024
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:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\pages\rembg.py in
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\pages\rembg.py in run_rembg(self=
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\krita_controller.py in result_to_transparency_mask(self=
The above is a description of an error in a Python program. Here is the original traceback:
Traceback (most recent call last):
File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\pages\rembg.py", line 81, in
RuntimeError Python 3.10.7: C:\软件\图形图像\Krita 5.2\bin\krita.exe Mon Apr 15 15:34:54 2024
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:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py in
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py in progress_check(self=
The above is a description of an error in a Python program. Here is the original traceback:
Traceback (most recent call last): File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py", line 172, in progress_check self.progress_bar.setValue(int(results['progress'] * 100)) RuntimeError: wrapped C/C++ object of type QProgressBar has been deleted
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py", line 145, in
Hello! When switching the interface during txt2img running, the program will report an error and the background process continues. If you switch back to txt2img again, the previous settings and progress bar will disappear, and the running speed has doubled after this update.
RuntimeError Python 3.10.7: C:\软件\图形图像\krita 5.3\bin\krita.exe Mon Apr 15 17:48:01 2024
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:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py in
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py in progress_check(self=
The above is a description of an error in a Python program. Here is the original traceback:
Traceback (most recent call last): File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py", line 172, in progress_check self.progress_bar.setValue(int(results['progress'] * 100)) RuntimeError: wrapped C/C++ object of type QProgressBar has been deleted
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\generate.py", line 145, in
I'm going to mark this bug report as closed, because we're a bit past start up errors now (and you made the other ticket to report more issues).
Switching tabs now shouldn't crash the image generation. It doesn't let you interrupt it or see the progress if you go back.
Hello, I enabled the api in Stable Diffusion WebUI, and Krita reported an error when starting up. Please help me.
TypeError Python 3.10.7: C:\软件\图形图像\Krita 5.2\bin\krita.exe Sun Apr 14 19:32:55 2024
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:\软件\图形图像\Krita 5.2\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 = <class 'cyanic.cyanic.CyanicDocker'>
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py in init(self=)
53
54 # Set the initial page
55 self.change_page()
56
57 # This was part of the template, might be relevant later
self =
self.change_page = <bound method CyanicDocker.change_page of >
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py in change_page(self=)
65 self.settings_controller.set('pages.last', page['name'])
66 self.settings_controller.save()
67 page['content']()
68 self.update()
69
page = {'content': <bound method CyanicDocker.show_txt2img of >, 'name': 'Txt2Img'}
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py in show_txt2img(self=)
76
77 def show_txt2img(self):
78 self.content_area.setWidget(Txt2ImgPage(self.settings_controller, self.api))
79
80 def show_img2img(self):
self =
self.content_area =
self.content_area.setWidget =
global Txt2ImgPage = <class 'cyanic.pages.txt2img.Txt2ImgPage'>
self.settings_controller =
self.api =
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\pages\txt2img.py in init(self=, settings_controller=, api=)
15 self.setLayout(QVBoxLayout())
16
17 self.model_widget = ModelsWidget(self.settings_controller, self.api)
18 self.layout().addWidget(self.model_widget)
19
self =
self.model_widget undefined
global ModelsWidget = <class 'cyanic.widgets.models.ModelsWidget'>
self.settings_controller =
self.api =
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\models.py in init(self=, settings_controller=, api=, ignore_hidden=False)
23 'sampling_steps': self.settings_controller.get('defaults.sampling_steps'),
24 }
25 self.init_variables()
26
27 self.draw_ui()
self =
self.init_variables = <bound method ModelsWidget.init_variables of >
C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\models.py in init_variables(self=)
31 models, self.variables['model'] = self.api.get_models_and_default()
32 settings_model = self.settings_controller.get('defaults.model')
33 if len(settings_model) > 0 and settings_model in models:
34 self.variables['model'] = settings_model
35
builtinlen =
settings_model = None
models = ['anything-v5-PrtRE.safetensors [7f96a1a9ca]', 'cosxl_edit.safetensors', 'dreamshaper_8.safetensors [879db523c3]', 'dreamshaper_8LCM.safetensors', 'flat2DAnimerge_v45Sharp.safetensors', 'ghostmix_v20Bakedvae.safetensors', 'juggernautXL_v8Rundiffusion.safetensors', 'juggernautXL_v9Rdphoto2Lightning.safetensors', 'leosamsHelloworldSDXL_helloworldSDXL40.safetensors', 'majicmixRealistic_v7.safetensors', 'playgroundV25Fp16.safetensors [bcaa7dd678]', 'playgroundV25Fp32.safetensors', 'realisticStockPhoto_v20.safetensors', 'realisticVisionV51_v51VAE.safetensors', 'realisticVisionV60B1_v51VAE.safetensors', 'rmsdxlHybridTurboXL_scorpius.safetensors', 'sd_xl_base_1.0.safetensors', 'sd_xl_refiner_1.0.safetensors', 'SUPIR-v0Q.ckpt', 'TURBOV7.safetensors', ...]
TypeError: object of type 'NoneType' has no len()
cause = None
class = <class 'TypeError'>
context = None
delattr = <method-wrapper 'delattr' of TypeError object>
dict = {}
dir =
doc = 'Inappropriate argument type.'
eq = <method-wrapper 'eq' of TypeError object>
format =
ge = <method-wrapper 'ge' of TypeError object>
getattribute = <method-wrapper 'getattribute' of TypeError object>
gt = <method-wrapper 'gt' of TypeError object>
hash = <method-wrapper 'hash' of TypeError object>
init = <method-wrapper 'init' of TypeError object>
init_subclass = <built-in method init_subclass of type object>
le = <method-wrapper 'le' of TypeError object>
lt = <method-wrapper 'lt' of TypeError object>
ne = <method-wrapper 'ne' of TypeError object>
new =
reduce =
reduce_ex = <built-in method reduce_ex of TypeError object>
repr = <method-wrapper 'repr' of TypeError object>
setattr = <method-wrapper 'setattr' of TypeError object>
setstate =
sizeof =
str = <method-wrapper 'str' of TypeError object>
subclasshook =
__suppress_context = False
traceback__ =
args = ("object of type 'NoneType' has no len()",)
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:\软件\图形图像\Krita 5.2\lib\krita-python-libs\krita\dockwidgetfactory.py", line 18, in createDockWidget return self.klass() File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py", line 55, in init self.change_page() File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py", line 67, in change_page page['content']() File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\cyanic.py", line 78, in show_txt2img self.content_area.setWidget(Txt2ImgPage(self.settings_controller, self.api)) File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\pages\txt2img.py", line 17, in init self.model_widget = ModelsWidget(self.settings_controller, self.api) File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\models.py", line 25, in init self.init_variables() File "C:\Users\liujv\AppData\Roaming\krita\pykrita\cyanic\widgets\models.py", line 33, in init_variables if len(settings_model) > 0 and settings_model in models: TypeError: object of type 'NoneType' has no len()