natto-maki / ComfyUI-NegiTools

Apache License 2.0
28 stars 4 forks source link

GPT vision error #8

Open filliptm opened 4 months ago

filliptm commented 4 months ago

Error occurred when executing NegiTools_OpenAiGpt4v:

Server returned an error

File "C:\Users\Filli\Desktop\Comfy_Version_Tests\ComfyUI_Copy\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\Users\Filli\Desktop\Comfy_Version_Tests\ComfyUI_Copy\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "C:\Users\Filli\Desktop\Comfy_Version_Tests\ComfyUI_Copy\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 "C:\Users\Filli\Desktop\Comfy_Version_Tests\ComfyUI_Copy\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "C:\Users\Filli\Desktop\Comfy_Version_Tests\ComfyUI_Copy\custom_nodes\ComfyUI-NegiTools\negi\openai_gpt4v.py", line 77, in doit raise openai.BadRequestError("Server returned an error", body=None, response=r0)

ShadoW-Shinigami commented 2 weeks ago

ensure that you have set your API key in your env variable. If you still face the issue, add these lines to the openai_gpt4v.py file replacing lines 76-77. It will give you the exact error message from openai in your commandline, which should help you fix the problem.

if r0.status_code != 200:
    print(f"Status Code: {r0.status_code}")
    print(f"Response Content: {r0.text}")
    raise openai.BadRequestError("Server returned an error", body=None, response=r0)
natto-maki commented 2 weeks ago

Please try https://github.com/natto-maki/ComfyUI-NegiTools/commit/8e8cf9e1a33f41146d8cf0e0874f1d6a7261248d This was probably a bug introduced by an update to the OpenAI API, possibly caused by the gpt-4-vision-preview model used by NegiTools_OpenAiGpt4v, which is no longer supported.