asagi4 / comfyui-prompt-control

ComfyUI nodes for prompt editing and LoRA control
GNU General Public License v3.0
200 stars 16 forks source link

Error occurred when executing PromptToSchedule: #38

Closed zhenyuanzhou closed 6 months ago

zhenyuanzhou commented 6 months ago

Error occurred when executing PromptToSchedule:

float() argument must be a string or a real number, not 'Tree'

File "F:\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-0246\utils.py", line 381, in new_func res_value = old_func(final_args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\node_other.py", line 129, in parse schedules = parse_prompt_schedules(text) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 382, in parse_prompt_schedules return PromptSchedule(prompt) ^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 277, in init self.interpolations, self.parsed_prompt = self._parse() ^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 289, in _parse interpolation_steps, steps = get_steps(tree) ^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 129, in get_steps CollectSteps().visit(tree) File "F:\ComfyUI\python_embeded\Lib\site-packages\lark\visitors.py", line 316, in visit self._call_userfunc(subtree) File "F:\ComfyUI\python_embeded\Lib\site-packages\lark\visitors.py", line 294, in _call_userfunc return getattr(self, tree.data, self.default)(tree) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 105, in scheduled tree.children[i] = tostep(tree.children[i]) ^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 94, in tostep w = float(s) 100 ^^^^^^^^

asagi4 commented 6 months ago

Try updating your lark package (activate the virtualenv and pip install -U lark).

Another user reported that there is a bug in 1.1.7 that causes this.

If that doesn't help, I'll need your prompt text to be able to reproduce and debug this

zhenyuanzhou commented 6 months ago

I updated the lark version from 1.1.8 to 1.1.9, new error emerged, please see below

Error occurred when executing KSampler:

apply_lora_for_step() missing 5 required positional arguments: 'step', 'total_steps', 'state', 'original_model', and 'lora_cache'

File "F:\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-0246\utils.py", line 381, in new_func res_value = old_func(final_args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\nodes.py", line 1344, in sample return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\nodes.py", line 1314, in common_ksampler samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\hijack.py", line 39, in pc_sample r = cb(orig_sampler, args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\ComfyUI\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\node_lora.py", line 67, in sampler_cb apply_lora_for_step(start_step)

asagi4 commented 6 months ago

For that, you need to update the extension. That error is fixed in the latest commit

zhenyuanzhou commented 6 months ago

Thank you for helping. It solves the problem.

HASAN3DG commented 6 months ago

Error occurred when executing PromptToSchedule:

float() argument must be a string or a real number, not 'Tree'

File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-comfy-nodes\deforum_nodes\exec_hijack.py", line 55, in map_node_over_list return orig_exec(obj, input_data_all, func, allow_interrupt) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(*slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\node_other.py", line 129, in parse schedules = parse_prompt_schedules(text) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 382, in parse_prompt_schedules return PromptSchedule(prompt) ^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 277, in init self.interpolations, self.parsed_prompt = self._parse() ^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 289, in _parse interpolation_steps, steps = get_steps(tree) ^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 129, in get_steps CollectSteps().visit(tree) File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\lark\visitors.py", line 316, in visit self._call_userfunc(subtree) File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\lark\visitors.py", line 294, in _call_userfunc return getattr(self, tree.data, self.default)(tree) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 105, in scheduled tree.children[i] = tostep(tree.children[i]) ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-control\prompt_control\parser.py", line 94, in tostep w = float(s) 100 ^^^^^^^^

HASAN3DG commented 6 months ago

I don't know what the problem is, even though I did everything, updating and re-updating several times

zhenyuanzhou commented 6 months ago

Don't use the update.bat If you are using portable version . Download the comfyui and overwrite your comfyui folder may fix the problem.

HASAN3DG commented 6 months ago

Yes, I did it manually by typing, and it was updated, but the problem remains

https://drive.google.com/file/d/1nmsw03InbpfHDMa2_7oimqrMrW-s1BRv/view?usp=sharing

asagi4 commented 6 months ago

pip install lark won't update anything if you already have lark installed. For that you need pip install -U lark. You can use pip show lark to check the version you have