Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General question: how do I set up my OpenAI API Key #6

Open
KannManMachen opened this issue May 29, 2024 · 2 comments
Open

General question: how do I set up my OpenAI API Key #6

KannManMachen opened this issue May 29, 2024 · 2 comments

Comments

@KannManMachen
Copy link

I think there are many people (including me) who are integrating an LLM into their ComfyUI workflow for the first time with the help of anynode. So please forgive this generic question about setting up the OpenAI API.

I have already generated a project API key, but now I don't know how to connect my portable ComfyUI version under Windows 11 with the API key. Can anyone give me a tip on how to proceed?

Would this be the right guide for this: https://platform.openai.com/docs/quickstart?context=python

Cheers :)

@lks-ai
Copy link
Owner

lks-ai commented May 30, 2024

Yes, that guide is the official one. Get your API key that way.

Once you have it, you can follow this for Windows:

https://www.howtogeek.com/787217/how-to-edit-environment-variables-on-windows-10-or-11/

That explains it pretty well and you should be setting the variable name OPENAI_API_KEY and value set to the key you got from the first guide.

@gonzalu
Copy link

gonzalu commented Jun 7, 2024

I always get errors:

{"model": "gpt-4o", "server": "", "api_key": "", "prompt": "Convert the image to high contrast B&W", "last_comment": null, "inputs": ["Type: <class 'torch.Tensor'>, Shape: (1, 1152, 896, 3), Dtype: torch.float32", "Type: <class 'NoneType'>"], "imports": [], "function": "An error occurred: Error code: 404 - {'error': {'message': 'The model `gpt-4o` does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}", "last_error": null}

But my Environment is properly set:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants