pydn / ComfyUI-to-Python-Extension

A powerful tool that translates ComfyUI workflows into executable Python code.
MIT License
1.08k stars 113 forks source link

black.parsing.InvalidInput: Cannot parse: 147:629: #34

Closed chnl closed 8 months ago

chnl commented 9 months ago

I run the Workflow in the GUI without any issues. When I try and create a python script to execute this same workflow I get the following... Traceback (most recent call last): File "F:\SDXL\ComfyUI_windows_portable\ComfyUI\ComfyUI-to-Python-Extension\comfyui_to_python.py", line 460, in ComfyUItoPython(input_file=input_file, output_file=output_file, queue_size=queue_size) File "F:\SDXL\ComfyUI_windows_portable\ComfyUI\ComfyUI-to-Python-Extension\comfyui_to_python.py", line 425, in init self.execute() File "F:\SDXL\ComfyUI_windows_portable\ComfyUI\ComfyUI-to-Python-Extension\comfyui_to_python.py", line 445, in execute generated_code = code_generator.generate_workflow(load_order, filename=self.output_file, queue_size=self.queue_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\SDXL\ComfyUI_windows_portable\ComfyUI\ComfyUI-to-Python-Extension\comfyui_to_python.py", line 243, in generate_workflow final_code = self.assemble_python_code(import_statements, special_functions_code, code, queue_size, custom_nodes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\SDXL\ComfyUI_windows_portable\ComfyUI\ComfyUI-to-Python-Extension\comfyui_to_python.py", line 325, in assemble_python_code final_code = black.format_str(final_code, mode=black.Mode()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "src\black__init__.py", line 1172, in format_str File "src\black__init__.py", line 1186, in _format_str_once File "src\black\parsing.py", line 89, in lib2to3_parse black.parsing.InvalidInput: Cannot parse: 147:629: facedetailerpipe_75:4 = facedetailerpipe.doit(guide_size=256, guide_size_for=True, max_size=768, seed=random.randint(1, 2**64), steps=20, cfg=8, sampler_name="dpmpp_sde_gpu", scheduler="normal", denoise=0.3, feather=5, noise_mask=True, force_inpaint=False, bbox_threshold=0.5, bbox_dilation=10, bbox_crop_factor=3, sam_detection_hint="center-1", sam_dilation=0, sam_threshold=0.93, sam_bbox_expansion=0, sam_mask_hint_threshold=0.7, sam_mask_hint_use_negative="False", drop_size=10, refiner_ratio=0.2, cycle=1, image=get_value_at_index(ksampler_adv_efficient_37, 5), detailer_pipe=get_value_at_index(basicpipetodetailerpipe_75:3, 0))

StoryMaster.json

chnl commented 8 months ago

Import error

Maryalalaland commented 7 months ago

I'm facing the same issue. What kind of import error you had?

AdrienLF commented 3 months ago

Getting the same issue here