From c1e8dd7f7ba1d5c6012d208032f13f089bb5f363 Mon Sep 17 00:00:00 2001 From: Semon Xue Date: Sun, 31 Aug 2025 00:39:38 +0800 Subject: [PATCH] Update Gemini models and fix inline_data check --- py/gemini.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/gemini.py b/py/gemini.py index b138d38..f07a5f2 100644 --- a/py/gemini.py +++ b/py/gemini.py @@ -392,6 +392,7 @@ class LS_Gemini_Image_Edit: def INPUT_TYPES(self): gemini_model_list = [ "gemini-2.0-flash-exp-image-generation", + "gemini-2.5-flash-image-preview" ] return { @@ -465,7 +466,7 @@ class LS_Gemini_Image_Edit: ) for item in response.candidates[0].content.parts: - if hasattr(item, "inline_data") and item.inline_data.mime_type == "image/png": + if hasattr(item, "inline_data") and item.inline_data is not None and item.inline_data.mime_type == "image/png": image_bytes = item.inline_data.data image_bytes = io.BytesIO(image_bytes) image_bytes.seek(0)