Skip to content

Commit

Permalink
Image gen (#549)
Browse files Browse the repository at this point in the history
* Add more enum samples

Change-Id: I743d5967cc1cc91576b8ddf5a60db1767d94508d

* format

Change-Id: I8f6f9389f1cae0a7c934217968d4e2e20bb9590e

* From: https://github.com/googleapis/python-aiplatform/tree/v1.65.0/vertexai/vision_models

Change-Id: I693579ccf2994212f25d0354d091d3210fbf3212

* clear out extra classes

Change-Id: I64dec6a71f3f04fa834f2174e4a6b2d4740f4e90

* remove gcs_uri

Change-Id: Ieafe776bde8e79e1747ab6cf252b49a001ab66bf

* IPython reprs

Change-Id: I586876f524684dc3d0ee0ea8510b56bc5153642b

* remove output_gce_uri

Change-Id: Ic4424d06a705bf94f0fade34468160566cb3a6be

* remove IPython reprs

Change-Id: I474c76c1e73d7a92a653932d1984c02de7e3b71a

* remove more gcs_uri.

Change-Id: I9f6b8c879dc8f38c5193ddb1e271a62984c7f020

* handle instances converversion to Value protos.

Change-Id: Id33f8d2d6a4cffbfb7b0d37955cc800a867a70d5

* Basically works.

Change-Id: I28364ab70b2a263b29026f2cf2d1d4f807d88f53

* add _repr_png_

Change-Id: I436170460e17983637283d0086ebc232c9c425ce

* Remoive "add watermark" switch.

Change-Id: I6580ae1b508a458c9813fdf161a08329cd676c08

* Remove seed (it doesn't work without watermark), +fix upscale

Change-Id: I4c394cd861d2646cd663224f0bbeec52580bc0bd

* remove edit and upscale

Change-Id: Ic9c270279ee020baef2c3b2117199ff17b066d88

* remove upscale

Change-Id: I84f3b603732c3c1e91da9d5abf38c332b24772cb

* skip bad test

Change-Id: Ief70d4fdc9d7478b402cf2f790817f98e336b25a

* format

Change-Id: I4d00cad9d0e6485f5b710d2ffcec82a9b738e2b0

* check enums

Change-Id: I8e7b92fc15d3941b7fa74a97b95d2577be9d6c1f

* Remove * unpackng

Change-Id: Iddc42b906dfab12dfa500f0f9774d58521684548

* ignore typing errors, these are incorrect

Change-Id: Idc4e594811e52aa3d17562851ef02808e6dd5633

* fix typing?

Change-Id: I5005dd38b7d3a03edc1c54d42f3a6c8f959d7274

* fix lazy loading with typing

Change-Id: I2ebb3afbe3df93f918ffe5f66dac20392665c6cc

* Revert "fix lazy loading with typing"

This reverts commit 0baabfe.

* Use if TYPE_CHECKING

Change-Id: I63c4c7909f7d7060a4b557f41cff4ba9010e004c

* format

Change-Id: I446692905361c56505b070d72d94ea7fecdaede8
  • Loading branch information
MarkDaoust authored Oct 2, 2024
1 parent 8f77cc6 commit bbd5af3
Show file tree
Hide file tree
Showing 7 changed files with 565 additions and 3 deletions.
2 changes: 2 additions & 0 deletions google/generativeai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
from google.generativeai.generative_models import GenerativeModel
from google.generativeai.generative_models import ChatSession

from google.generativeai.vision_models import *

from google.generativeai.models import list_models
from google.generativeai.models import list_tuned_models

Expand Down
8 changes: 8 additions & 0 deletions google/generativeai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,11 @@ def get_default_permission_client() -> glm.PermissionServiceClient:

def get_default_permission_async_client() -> glm.PermissionServiceAsyncClient:
return _client_manager.get_default_client("permission_async")


def get_default_prediction_client() -> glm.PermissionServiceClient:
return _client_manager.get_default_client("prediction")


def get_default_prediction_async_client() -> glm.PermissionServiceAsyncClient:
return _client_manager.get_default_client("prediction_async")
2 changes: 1 addition & 1 deletion google/generativeai/generative_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from collections.abc import Iterable
import textwrap
from typing import Any, Union, overload
from typing import Any, Literal, Union, overload
import reprlib

# pylint: disable=bad-continuation, line-too-long
Expand Down
29 changes: 29 additions & 0 deletions google/generativeai/vision_models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""Classes for working with vision models."""

from google.generativeai.vision_models._vision_models import (
Image,
GeneratedImage,
ImageGenerationModel,
ImageGenerationResponse,
)

__all__ = [
"Image",
"GeneratedImage",
"ImageGenerationModel",
"ImageGenerationResponse",
]
Loading

0 comments on commit bbd5af3

Please sign in to comment.