diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenControlType.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenControlType.kt index 0732b9a0553..6d0bf1a98ab 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenControlType.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenControlType.kt @@ -19,18 +19,26 @@ package com.google.firebase.ai.type public class ImagenControlType internal constructor(internal val value: String) { public companion object { - /** Use edge detection to ensure the new image follow the same outlines */ + /** + * Use edge detection to ensure the new image follows the same outlines as the reference image. + */ @JvmField public val CANNY: ImagenControlType = ImagenControlType("CONTROL_TYPE_CANNY") - /** Use enhanced edge detection to ensure the new image follow similar outlines */ + /** + * Use enhanced edge detection to ensure the new image follows the same outlines as the + * reference image. + */ @JvmField public val SCRIBBLE: ImagenControlType = ImagenControlType("CONTROL_TYPE_SCRIBBLE") - /** Use face mesh control to ensure that the new image has the same facial expressions */ + /** + * Use face mesh control to ensure that the new image has the same facial expressions as the + * reference image. + */ @JvmField public val FACE_MESH: ImagenControlType = ImagenControlType("CONTROL_TYPE_FACE_MESH") /** * Use color superpixels to ensure that the new image is similar in shape and color to the - * original + * reference image. */ @JvmField public val COLOR_SUPERPIXEL: ImagenControlType = diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenEditMode.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenEditMode.kt index a852ea88a2a..6be2b44baab 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenEditMode.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenEditMode.kt @@ -25,7 +25,7 @@ public class ImagenEditMode private constructor(internal val value: String) { /** Removes an element from an image */ @JvmField public val INPAINT_REMOVAL: ImagenEditMode = ImagenEditMode("EDIT_MODE_INPAINT_REMOVAL") - /** Extend the borders of an image outwards */ + /** Extends the borders of an image outwards */ @JvmField public val OUTPAINT: ImagenEditMode = ImagenEditMode("EDIT_MODE_OUTPAINT") } } diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenReferenceImage.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenReferenceImage.kt index b9ba2ff48b2..7456acaf46c 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenReferenceImage.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ImagenReferenceImage.kt @@ -80,10 +80,11 @@ internal constructor( * @param referenceId the reference ID for this image, to be referenced in the prompt * @param enableComputation requests that the reference image be generated serverside instead of * provided - * @param superpixelRegionSize if type is COLOR_SUPERPIXEL and [enableComputation] is true, this - * will control the size of each superpixel region in pixels for the generated referenced image - * @param superpixelRuler if type is COLOR_SUPERPIXEL and [enableComputation] is true, this will - * control the superpixel smoothness factor for the generated referenced image + * @param superpixelRegionSize if type is [ImagenControlType.COLOR_SUPERPIXEL] and + * [enableComputation] is true, this will control the size of each superpixel region in pixels for + * the generated referenced image + * @param superpixelRuler if type is [ImagenControlType.COLOR_SUPERPIXEL] and [enableComputation] is + * true, this will control the superpixel smoothness factor for the generated referenced image */ @PublicPreviewAPI public class ImagenControlReference( @@ -102,9 +103,8 @@ public class ImagenControlReference( ) {} /** - * Represents a reference image for Imagen editing which will mask of a region to be edited. This - * image (generated or provided) should contain only black and white pixels, with black representing - * parts of the image which should not change. + * Represents a mask for Imagen editing. This image (generated or provided) should contain only + * black and white pixels, with black representing parts of the image which should not change. */ @PublicPreviewAPI public abstract class ImagenMaskReference @@ -113,17 +113,16 @@ internal constructor(maskConfig: ImagenMaskConfig, image: ImagenInlineImage? = n public companion object { /** - * Generates these two reference images in order: + * Generates two reference images of [ImagenRawImage] and [ImagenRawMask]. These images are + * generated in this order: * * One [ImagenRawImage] containing the original image, padded out to the new dimensions with * black pixels, with the original image placed at the given placement * * One [ImagenRawMask] of the same dimensions containing white everywhere except at the - * placement original image. - * - * This is the format expected by Imagen for outpainting requests. + * placement original image. This is the format expected by Imagen for outpainting requests. * * @param image the original image - * @param newDimensions the new dimensions for outpainting. This *must* be more than the - * original image. + * @param newDimensions the new dimensions for outpainting. These new dimensions *must* be more + * than the original image. * @param newPosition the placement of the original image within the new outpainted image. */ @JvmOverloads @@ -190,8 +189,8 @@ internal constructor(maskConfig: ImagenMaskConfig, image: ImagenInlineImage? = n /** * A generated mask image which will auto-detect and mask out the background. The background will be * white, and the foreground black - * @param dilation the amount to dilate the mask, this can help smooth the borders of an edit and - * make it seem more convincing. For example, 0.05 would dilate the mask 5%. + * @param dilation the amount to dilate the mask. This can help smooth the borders of an edit and + * make it seem more convincing. For example, `0.05` will dilate the mask 5%. */ @PublicPreviewAPI public class ImagenBackgroundMask(dilation: Double? = null) : @@ -200,21 +199,20 @@ public class ImagenBackgroundMask(dilation: Double? = null) : /** * A generated mask image which will auto-detect and mask out the foreground. The background will be * black, and the foreground white - * @param dilation the amount to dilate the mask, this can help smooth the borders of an edit and - * make it seem more convincing. For example, 0.05 would dilate the mask 5%. + * @param dilation the amount to dilate the mask. This can help smooth the borders of an edit and + * make it seem more convincing. For example, `0.05` will dilate the mask 5%. */ @PublicPreviewAPI public class ImagenForegroundMask(dilation: Double? = null) : ImagenMaskReference(maskConfig = ImagenMaskConfig(ImagenMaskMode.FOREGROUND, dilation)) {} /** - * Represents a reference image for Imagen editing which will mask of a region to be edited. This - * image should contain only black and white pixels, with black representing parts of the image - * which should not change. + * Represents a mask for Imagen editing. This image should contain only black and white pixels, with + * black representing parts of the image which should not change. * * @param mask the mask image - * @param dilation the amount to dilate the mask, this can help smooth the borders of an edit and - * make it seem more convincing. For example, 0.05 would dilate the mask 5%. + * @param dilation the amount to dilate the mask. This can help smooth the borders of an edit and + * make it seem more convincing. For example, `0.05` will dilate the mask 5%. */ @PublicPreviewAPI public class ImagenRawMask(mask: ImagenInlineImage, dilation: Double? = null) : @@ -226,11 +224,11 @@ public class ImagenRawMask(mask: ImagenInlineImage, dilation: Double? = null) : /** * Represents a generated mask for Imagen editing which masks out certain objects using object * detection. - * @param classes the list of segmentation IDs for objects to detect and mask out. See - * [here](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api-edit#segment-ids) - * for a list of segmentation IDs - * @param dilation the amount to dilate the mask, this can help smooth the borders of an edit and - * make it seem more convincing. For example, 0.05 would dilate the mask 5%. + * @param classes the list of segmentation IDs for objects to detect and mask out. Find a + * [list of segmentation IDs](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api-edit#segment-ids) + * in the Vertex AI documentation. + * @param dilation the amount to dilate the mask. This can help smooth the borders of an edit and + * make it seem more convincing. For example, `0.05` will dilate the mask 5%. */ @PublicPreviewAPI public class ImagenSemanticMask(classes: List, dilation: Double? = null) :