Closed sergiogbrox closed 1 year ago
To Reproduce Steps to reproduce the behavior: workflow / workflow to text2img / run this work flow / See error
It appears you're trying to run the workflow when it's empty. If you want to load a custom workflow to be run in Krita, follow these steps. The button you probably want to press is this one:
Alternatively, you can go to: txt2img tab -> click "Get Workflow" button
A workflow with your current settings will be automatically generated. You can then edit it in the text editor or elsewhere.
"Run this workflow" button uses what's in the textbox as input.
Note: make sure the workflow you want to import is in API format. Normal workflows exported directly from ComfyUI won't work, that's why we use Get Prompt
node instead of a normal export.
@JasonS09 do you have any example workflows to recommend? Sorry, I'm having a bit of difficulty with this.
@JasonS09 do you have any example workflows to recommend? Sorry, I'm having a bit of difficulty with this.
If you're not familiar with workflows and nodes in ComfyUI, I suggest you to stick with the basic usage of this tool (txt2img, img2img, inpainting, upscaling and controlnet). You can do all of that by simply using the UI like you would in other canvas oriented UIs. The plugin will take care to automatically build the workflow under the hood so you don't have to.
Running/injecting custom workflows is for more specific situations where you want some behaviour changed on all your subsequent generations. Like if you need a custom node applied to them, or want to increase the steps of the KSampler during the upscaling pass (you're unable to do that from the UI).
You don't need to know workflows to use this tool. That said, is there any specific workflow you're attempting to incorporate? Maybe I can help crafting one if you need.
ok @JasonS09, now I understand how the pre-programmed workflows in the extension work, but when I load the txt2img, it gives the following error:
TypeError Python 3.8.1: C:\Program Files\Krita (x64)\bin\krita.exe Tue Aug 1 08:46:27 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:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\pages\workflow.py in
C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\script.py in action_run_workflow(self=
C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\script.py in apply_run_workflow(self=
C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\client.py in run_workflow(self=
C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\client.py in restore_params(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\sergi\AppData\Roaming\krita\pykrita\krita_comfy\pages\workflow.py", line 73, in
You're trying to load a workflow for ComfyUI, those are not supported. It expects a workflow in API format. To get one, follow these steps .
Describe the bug When I click to load the workflow in the Krita plugin, it gives an error.
JSONDecodeError Python 3.8.1: C:\Program Files\Krita (x64)\bin\krita.exe Fri Jul 28 09:27:33 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:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\pages\workflow.py in()
71 self.import_images.released.connect(script.action_get_last_images)
72 self.run_this_workflow.released.connect(
73 lambda: script.action_run_workflow(script.cfg(f"{self.prefix}_workflow", str))
74 )
75 self.workflow.textChanged.connect(
global script =
script.action_run_workflow = <bound method Script.action_run_workflow of >
script.cfg =
builtinstr = <class 'str'>
C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\script.py in action_run_workflow(self=, workflow='')
608 return
609 self.adjust_selection()
610 self.apply_run_workflow(workflow)
611
612 def action_update_controlnet_config(self):
self =
self.apply_run_workflow = <bound method Script.apply_run_workflow of >
workflow = ''
C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\script.py in apply_run_workflow(self=, workflow='')
485 mask_image = sel_image = self.get_selection_image()
486
487 self.client.run_workflow(workflow, sel_image, mask_image, cb)
488
489 def apply_get_last_images(self):
self =
self.client =
self.client.run_workflow = <bound method Client.run_workflow of >
workflow = ''
sel_image =
mask_image =
cb = <function Script.basic_callback_crafter..cb>
C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\client.py in run_workflow(self=, workflow='', src_img=, mask=, cb=<function Script.basic_callback_crafter..cb>)
1568
1569 def run_workflow(self, workflow, src_img, mask, cb=None):
1570 params = self.restore_params(json.loads(workflow), src_img, mask)
1571 self.get_images(params, cb)
1572
params undefined
self =
self.restore_params = <bound method Client.restore_params of >
global json = <module 'json' from 'C:\Program Files\Krita (x64)\python\python38.zip\json\init.pyc'>
json.loads =
workflow = ''
src_img =
mask =
C:\Users\sergi\AppData\Local\Pitikapp Remote Dashboard\json__init__.py in loads(s='', cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw={})
C:\Users\sergi\AppData\Local\Pitikapp Remote Dashboard\json\decoder.py in decode(self=, s='', _w=)
C:\Users\sergi\AppData\Local\Pitikapp Remote Dashboard\json\decoder.py in raw_decode(self=, s='', idx=0)
JSONDecodeError: Expecting value: line 1 column 1 (char 0) cause = None class = <class 'json.decoder.JSONDecodeError'> context = StopIteration(0) delattr = <method-wrapper 'delattr' of JSONDecodeError object> dict = {'colno': 1, 'doc': '', 'lineno': 1, 'msg': 'Expecting value', 'pos': 0} dir =
doc = None
eq = <method-wrapper 'eq' of JSONDecodeError object>
format =
ge = <method-wrapper 'ge' of JSONDecodeError object>
getattribute = <method-wrapper 'getattribute' of JSONDecodeError object>
gt = <method-wrapper 'gt' of JSONDecodeError object>
hash = <method-wrapper 'hash' of JSONDecodeError object>
init = <bound method JSONDecodeError.init of JSONDe...ror('Expecting value: line 1 column 1 (char 0)')>
init_subclass = <built-in method init_subclass of type object>
le = <method-wrapper 'le' of JSONDecodeError object>
lt = <method-wrapper 'lt' of JSONDecodeError object>
module = 'json.decoder'
ne = <method-wrapper 'ne' of JSONDecodeError object>
new =
reduce = <bound method JSONDecodeError.reduce of JSON...ror('Expecting value: line 1 column 1 (char 0)')>
reduce_ex = <built-in method reduce_ex of JSONDecodeError object>
repr = <method-wrapper 'repr' of JSONDecodeError object>
setattr = <method-wrapper 'setattr' of JSONDecodeError object>
setstate =
sizeof =
str = <method-wrapper 'str' of JSONDecodeError object>
subclasshook =
__suppress_context = True
traceback =
weakref__ = None
args = ('Expecting value: line 1 column 1 (char 0)',)
colno = 1
doc = ''
lineno = 1
msg = 'Expecting value'
pos = 0
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:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\pages\workflow.py", line 73, in
lambda: script.action_run_workflow(script.cfg(f"{self.prefix}_workflow", str))
File "C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\script.py", line 610, in action_run_workflow
self.apply_run_workflow(workflow)
File "C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\script.py", line 487, in apply_run_workflow
self.client.run_workflow(workflow, sel_image, mask_image, cb)
File "C:\Users\sergi\AppData\Roaming\krita\pykrita\krita_comfy\client.py", line 1570, in run_workflow
params = self.restore_params(json.loads(workflow), src_img, mask)
File "json__init__.py", line 357, in loads
File "json\decoder.py", line 337, in decode
File "json\decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
To Reproduce Steps to reproduce the behavior: workflow / workflow to text2img / run this work flow / See error
Screenshots
Desktop (please complete the following information):
Additional context plz help me s2