Merge pull request #107 from Semonxue/feature/update-gemini-models

Update Gemini models and fix inline_data check
This commit is contained in:
chflame163
2025-08-31 21:08:55 +08:00
committed by GitHub
+2 -1
View File
@@ -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)