diff --git a/CHANGELOG.md b/CHANGELOG.md index 844d57e..2babdec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [1.0.5 - 2025-05-25] + +### Fixed + +- Corrected support of the `GOOGLE_API_KEY` env variable. + ## [1.0.4 - 2025-04-04] ### Added diff --git a/nodes.py b/nodes.py index 1d91e9b..ab0bb7c 100644 --- a/nodes.py +++ b/nodes.py @@ -1,4 +1,5 @@ import logging +import os import random import google.generativeai as genai @@ -73,7 +74,10 @@ class GeminiNode: for image in [image_1, image_2, image_3]: if image is not None: images_to_send.extend(images_to_pillow(image)) - genai.configure(api_key=api_key, transport="rest") + if "GOOGLE_API_KEY" in os.environ and not api_key: + genai.configure(transport="rest") + else: + genai.configure(api_key=api_key, transport="rest") model = genai.GenerativeModel(model, safety_settings=safety_settings, system_instruction=system_instruction) generation_config = genai.GenerationConfig( response_mime_type="application/json" if response_type == "json" else "text/plain" diff --git a/pyproject.toml b/pyproject.toml index 7a3c061..8017898 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "comfyui-gemini" -version = "1.0.4" +version = "1.0.5" description = "Nodes for Google Gemini API, focusing on backward compatibility and stability within ComfyUI." license = { file = "LICENSE" } requires-python = ">=3.10"