Skip to content

Commit aca7dcf

Browse files
matthew29tangcopybara-github
authored andcommitted
docs: Remove deprecated product recontext model samples from docstrings
PiperOrigin-RevId: 896300152
1 parent a39c679 commit aca7dcf

1 file changed

Lines changed: 9 additions & 45 deletions

File tree

google/genai/models.py

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5121,38 +5121,20 @@ def recontext_image(
51215121
) -> types.RecontextImageResponse:
51225122
"""Recontextualizes an image.
51235123
5124-
There are two types of recontextualization currently supported:
5125-
1) Imagen Product Recontext - Generate images of products in new scenes
5126-
and contexts.
5127-
2) Virtual Try-On: Generate images of persons modeling fashion products.
5124+
There is one type of recontextualization currently supported:
5125+
1) Virtual Try-On: Generate images of persons modeling fashion products.
51285126
51295127
Args:
51305128
model (str): The model to use.
51315129
source (RecontextImageSource): An object containing the source inputs
51325130
(prompt, person_image, product_images) for image recontext. prompt is
5133-
optional for product recontext and disallowed for virtual try-on.
5134-
person_image is required for virtual try-on, disallowed for product
5135-
recontext. product_images is required for both product recontext and
5136-
virtual try-on. Only one product image is supported for virtual try-on,
5137-
and up to 3 product images (different angles of the same product) are
5138-
supported for product recontext.
5131+
behind an allowlist. person_image is required. product_images is
5132+
required. Only one product image is supported currently.
51395133
config (RecontextImageConfig): Configuration for recontextualization.
51405134
51415135
Usage:
51425136
51435137
```
5144-
product_recontext_response = client.models.recontext_image(
5145-
model="imagen-product-recontext-preview-06-30",
5146-
source=types.RecontextImageSource(
5147-
prompt="In a modern kitchen setting.",
5148-
product_images=[types.ProductImage.from_file(IMAGE_FILE_PATH)],
5149-
),
5150-
config=types.RecontextImageConfig(
5151-
number_of_images=1,
5152-
),
5153-
)
5154-
image = product_recontext_response.generated_images[0].image
5155-
51565138
virtual_try_on_response = client.models.recontext_image(
51575139
model="virtual-try-on-001",
51585140
source=types.RecontextImageSource(
@@ -7085,39 +7067,21 @@ async def recontext_image(
70857067
) -> types.RecontextImageResponse:
70867068
"""Recontextualizes an image.
70877069
7088-
There are two types of recontextualization currently supported:
7089-
1) Imagen Product Recontext - Generate images of products in new scenes
7090-
and contexts.
7091-
2) Virtual Try-On: Generate images of persons modeling fashion products.
7070+
There is one type of recontextualization currently supported:
7071+
1) Virtual Try-On: Generate images of persons modeling fashion products.
70927072
70937073
Args:
70947074
model (str): The model to use.
70957075
source (RecontextImageSource): An object containing the source inputs
70967076
(prompt, person_image, product_images) for image recontext. prompt is
7097-
optional for product recontext and disallowed for virtual try-on.
7098-
person_image is required for virtual try-on, disallowed for product
7099-
recontext. product_images is required for both product recontext and
7100-
virtual try-on. Only one product image is supported for virtual try-on,
7101-
and up to 3 product images (different angles of the same product) are
7102-
supported for product recontext.
7077+
behind an allowlist. person_image is required. product_images is
7078+
required. Only one product image is supported currently.
71037079
config (RecontextImageConfig): Configuration for recontextualization.
71047080
71057081
Usage:
71067082
71077083
```
7108-
product_recontext_response = client.models.recontext_image(
7109-
model="imagen-product-recontext-preview-06-30",
7110-
source=types.RecontextImageSource(
7111-
prompt="In a modern kitchen setting.",
7112-
product_images=[types.ProductImage.from_file(IMAGE_FILE_PATH)],
7113-
),
7114-
config=types.RecontextImageConfig(
7115-
number_of_images=1,
7116-
),
7117-
)
7118-
image = product_recontext_response.generated_images[0].image
7119-
7120-
virtual_try_on_response = client.models.recontext_image(
7084+
virtual_try_on_response = await client.aio.models.recontext_image(
71217085
model="virtual-try-on-001",
71227086
source=types.RecontextImageSource(
71237087
person_image=types.Image.from_file(IMAGE1_FILE_PATH),

0 commit comments

Comments
 (0)