heshengtao / comfyui_LLM_party

LLM Agent Framework in ComfyUI includes Omost,GPT-sovits, ChatTTS,GOT-OCR2.0, and FLUX prompt nodes,access to Feishu,discord,and adapts to all llms with similar openai/gemini interfaces, such as o1,ollama, grok, qwen, GLM, deepseek, moonshot,doubao. Adapted to local llms, vlm, gguf such as llama-3.2, Linkage neo4j KG, graphRAG / RAG / html 2 img
GNU Affero General Public License v3.0
1.06k stars 94 forks source link

No model named googlegenerative.ai #120

Open offmybach opened 4 weeks ago

offmybach commented 4 weeks ago

I have attempted numerous times and several with the help of ChatGPT4o to correct the error of File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party\llm.py", line 16, in import google.generativeai as genai ModuleNotFoundError: No module named 'google.generativeai'

Cannot import K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party module for custom nodes: No module named 'google.generativeai'

This happens each time I load comfyui. I have entered api key for Gemini Google into the ini in each place required. I have also confirmed that I have the googlegenerativeai files in my LIB site packages folder.

I am using windows 11 and the latest version of Comfyui. All are up to date.

The log repeatedly shows the following: Traceback (most recent call last): File "K:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 2006, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party__init__.py", line 14, in from .llm import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party\llm.py", line 16, in import google.generativeai as genai ModuleNotFoundError: No module named 'google.generativeai'

Cannot import K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party module for custom nodes: No module named 'google.generativeai' [MaraScott] Loaded

this is my config.ini . Maybe there is error here?

[API_KEYS] openai_api_key = base_url = https://api.openai.com/v1/ google_api_key = cse_id = bing_api_key = bing_api_key_put_here github_api_key = github_api_key_put_here google_api_url = wechat_url=work_wechat_url_put_here dingding_url=dingding_url_put_here feishu_url=feishu_url_put_here language=#zh_CN or en_US fastapi_api_key=

[google_gemini] base_url = api_key =

[your_model_name] base_url= api_key=

[deepseek-chat] base_url=https://api.deepseek.com/v1/ api_key=

[glm-4] base_url=https://open.bigmodel.cn/api/paas/v4/ api_key=

[qwen-max] base_url=https://dashscope.aliyuncs.com/compatible-mode/v1/ api_key=

[moonshot-v1-8k] base_url=https://api.moonshot.cn/v1/ api_key=

[general] base_url=https://spark-api-open.xf-yun.com/v1/ api_key=

[doubao_YOUR_ENDPOINT_ID] base_url=https://ark.cn-beijing.volces.com/api/v3/ api_key=

[llama3] base_url=http://127.0.0.1:11434/v1/ api_key=ollama

[your_azure_openai_model_name] base_url=https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/chat/completions?api-version=2024-06-01 api_key=

heshengtao commented 4 weeks ago

First of all, your key is exposed on the public network, please delete your key immediately. Second, you can use pip install google-generativeai in the comfyui environment.

heshengtao commented 4 weeks ago

Also, if you want to use gemini, you need to use the gemini API loader node.

offmybach commented 4 weeks ago

thanks I deleted key, that was really stupid of me.

offmybach commented 4 weeks ago

now I get this... HTTP Request: GET https://api.openai.com/v1/models "HTTP/1.1 401 Unauthorized" Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-proj-****DLIA. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}} Traceback (most recent call last): File "K:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 2006, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party__init__.py", line 14, in from .llm import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party\llm.py", line 16, in import google.generativeai as genai ModuleNotFoundError: No module named 'google.generativeai'

Cannot import K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party module for custom nodes: No module named 'google.generativeai'

offmybach commented 4 weeks ago

google.generativeai is definitely installed 0..8.3

heshengtao commented 4 weeks ago

The first error can be ignored. He requested openai with the key in your config.ini file to automatically get the model of openai, but you are using gemini, you should not have filled in your gemini key in the openai_api_key. The second error means that there is no such dependency in the environment. You must have not activated the comfyui environment and installed the dependency into your base environment.

You can find python.exe in your comfyui folder. Under the folder containing python.exe, right-click to open CMD and enter python.exe -m pip install google-generativeai.

offmybach commented 4 weeks ago

I just spent 2 hours with Chatgpt cleaning up my requirements and comfyui files to get google gen and other dependencies working properly. now this is the error I am receiving. it changed from missing googlegenai to google ai now.
I may sound stupid but I just don't understand how this works. I thought that it was a "party" and all of the models could be accessed at once. How do I fix this so that there aren't any conflicts and just using llama and gpt or whatever else is necessary? Thanks!

HTTP Request: GET https://api.openai.com/v1/models "HTTP/1.1 401 Unauthorized" Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-proj-****DLIA. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}} Traceback (most recent call last): File "K:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 2006, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party__init.py", line 14, in from .llm import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party\llm.py", line 16, in import google.generativeai as genai File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\generativeai__init__.py", line 45, in from google.generativeai import caching File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\generativeai\caching.py", line 21, in from google.generativeai import protos File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\generativeai\protos.py", line 74, in from google.ai.generativelanguage_v1beta.types import * File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\ai\generativelanguage_v1beta\init.py", line 21, in from .services.cache_service import CacheServiceAsyncClient, CacheServiceClient File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\ai\generativelanguage_v1beta\services\cache_service\init__.py", line 16, in from .async_client import CacheServiceAsyncClient File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\ai\generativelanguage_v1beta\services\cache_service\async_client.py", line 31, in from google.api_core import exceptions as core_exceptions ModuleNotFoundError: No module named 'google.api_core'

Cannot import K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party module for custom nodes: No module named 'google.api_core'

offmybach commented 4 weeks ago

wait! now I only get this error File "K:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 2006, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party__init__.py", line 13, in from .config_update import update_config File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party\config_update.py", line 18, in llm_base_url=llm_api_keys.get("base_url").strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'strip'

Cannot import K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party module for custom nodes: 'NoneType' object has no attribute 'strip'

offmybach commented 4 weeks ago

I have spent nearly an entire day attempting to fix this nightmare and now am back to the beginning - can't find googlegenai. If i install this again, all of the dependencies that I've cured will be ruined again.

heshengtao commented 3 weeks ago

I have reinstalled party many times on different devices and have not reproduced your problem. I think you have another plugin blocking the installation of googlegenai.

offmybach commented 1 week ago

I have reinstalled party many times on different devices and have not reproduced your problem. I think you have another plugin blocking the installation of googlegenai.

It seems like each time that I attempt to fix the install, I get another missing google file. now it's google.rpc.

aceback (most recent call last): File "K:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 2024, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party__init.py", line 14, in from .llm import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party\llm.py", line 16, in import google.generativeai as genai File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\generativeai__init__.py", line 45, in from google.generativeai import caching File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\generativeai\caching.py", line 21, in from google.generativeai import protos File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\generativeai\protos.py", line 74, in from google.ai.generativelanguage_v1beta.types import * File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\ai\generativelanguage_v1beta\init.py", line 21, in from .services.cache_service import CacheServiceAsyncClient, CacheServiceClient File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\ai\generativelanguage_v1beta\services\cache_service\init__.py", line 16, in from .async_client import CacheServiceAsyncClient File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\ai\generativelanguage_v1beta\services\cache_service\async_client.py", line 31, in from google.api_core import exceptions as core_exceptions File "K:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\google\api_core\exceptions.py", line 29, in from google.rpc import error_details_pb2 ModuleNotFoundError: No module named 'google.rpc'

Cannot import K:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_LLM_party module for custom nodes: No module named 'google.rpc'