mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-21 23:39:35 +08:00
[Partner Nodes] chore(Google): remove preview versions of models that will be deprecated soon (#14555)
Some checks failed
Detect Unreviewed Merge / detect (push) Waiting to run
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
Some checks failed
Detect Unreviewed Merge / detect (push) Waiting to run
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run
Build package / Build Test (3.10) (push) Has been cancelled
Build package / Build Test (3.11) (push) Has been cancelled
Build package / Build Test (3.12) (push) Has been cancelled
Build package / Build Test (3.13) (push) Has been cancelled
Build package / Build Test (3.14) (push) Has been cancelled
Signed-off-by: bigcat88 <bigcat88@icloud.com> Co-authored-by: Alexis Rolland <alexisrolland@hotmail.com>
This commit is contained in:
parent
d282ef7201
commit
dc3f8f314a
@ -5,7 +5,6 @@ See: https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/infer
|
|||||||
|
|
||||||
import base64
|
import base64
|
||||||
import os
|
import os
|
||||||
from enum import Enum
|
|
||||||
from fnmatch import fnmatch
|
from fnmatch import fnmatch
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from typing import Any, Literal
|
from typing import Any, Literal
|
||||||
@ -78,15 +77,6 @@ GEMINI_IMAGE_2_PRICE_BADGE = IO.PriceBadge(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class GeminiImageModel(str, Enum):
|
|
||||||
"""
|
|
||||||
Gemini Image Model Names allowed by comfy-api
|
|
||||||
"""
|
|
||||||
|
|
||||||
gemini_2_5_flash_image_preview = "gemini-2.5-flash-image-preview"
|
|
||||||
gemini_2_5_flash_image = "gemini-2.5-flash-image"
|
|
||||||
|
|
||||||
|
|
||||||
async def create_image_parts(
|
async def create_image_parts(
|
||||||
cls: type[IO.ComfyNode],
|
cls: type[IO.ComfyNode],
|
||||||
images: Input.Image | list[Input.Image],
|
images: Input.Image | list[Input.Image],
|
||||||
@ -243,21 +233,15 @@ def calculate_tokens_price(response: GeminiGenerateContentResponse) -> float | N
|
|||||||
if not response.modelVersion:
|
if not response.modelVersion:
|
||||||
return None
|
return None
|
||||||
# Define prices (Cost per 1,000,000 tokens), see https://cloud.google.com/vertex-ai/generative-ai/pricing
|
# Define prices (Cost per 1,000,000 tokens), see https://cloud.google.com/vertex-ai/generative-ai/pricing
|
||||||
if response.modelVersion in ("gemini-2.5-pro-preview-05-06", "gemini-2.5-pro"):
|
if response.modelVersion == "gemini-2.5-pro":
|
||||||
input_tokens_price = 1.25
|
input_tokens_price = 1.25
|
||||||
output_text_tokens_price = 10.0
|
output_text_tokens_price = 10.0
|
||||||
output_image_tokens_price = 0.0
|
output_image_tokens_price = 0.0
|
||||||
elif response.modelVersion in (
|
elif response.modelVersion == "gemini-2.5-flash":
|
||||||
"gemini-2.5-flash-preview-04-17",
|
|
||||||
"gemini-2.5-flash",
|
|
||||||
):
|
|
||||||
input_tokens_price = 0.30
|
input_tokens_price = 0.30
|
||||||
output_text_tokens_price = 2.50
|
output_text_tokens_price = 2.50
|
||||||
output_image_tokens_price = 0.0
|
output_image_tokens_price = 0.0
|
||||||
elif response.modelVersion in (
|
elif response.modelVersion == "gemini-2.5-flash-image":
|
||||||
"gemini-2.5-flash-image-preview",
|
|
||||||
"gemini-2.5-flash-image",
|
|
||||||
):
|
|
||||||
input_tokens_price = 0.30
|
input_tokens_price = 0.30
|
||||||
output_text_tokens_price = 2.50
|
output_text_tokens_price = 2.50
|
||||||
output_image_tokens_price = 30.0
|
output_image_tokens_price = 30.0
|
||||||
@ -455,8 +439,6 @@ class GeminiNode(IO.ComfyNode):
|
|||||||
IO.Combo.Input(
|
IO.Combo.Input(
|
||||||
"model",
|
"model",
|
||||||
options=[
|
options=[
|
||||||
"gemini-2.5-pro-preview-05-06",
|
|
||||||
"gemini-2.5-flash-preview-04-17",
|
|
||||||
"gemini-2.5-pro",
|
"gemini-2.5-pro",
|
||||||
"gemini-2.5-flash",
|
"gemini-2.5-flash",
|
||||||
"gemini-3-pro-preview",
|
"gemini-3-pro-preview",
|
||||||
@ -904,8 +886,7 @@ class GeminiImage(IO.ComfyNode):
|
|||||||
),
|
),
|
||||||
IO.Combo.Input(
|
IO.Combo.Input(
|
||||||
"model",
|
"model",
|
||||||
options=GeminiImageModel,
|
options=["gemini-2.5-flash-image"],
|
||||||
default=GeminiImageModel.gemini_2_5_flash_image,
|
|
||||||
tooltip="The Gemini model to use for generating responses.",
|
tooltip="The Gemini model to use for generating responses.",
|
||||||
),
|
),
|
||||||
IO.Int.Input(
|
IO.Int.Input(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user