@firebase/vertexai
Version:
A Firebase SDK for VertexAI
62 lines (61 loc) • 1.92 kB
TypeScript
/**
* @license
* Copyright 2025 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.
*/
/**
* Defines the image format for images generated by Imagen.
*
* Use this class to specify the desired format (JPEG or PNG) and compression quality
* for images generated by Imagen. This is typically included as part of
* <code>{@link ImagenModelParams}</code>.
*
* @example
* ```javascript
* const imagenModelParams = {
* // ... other ImagenModelParams
* imageFormat: ImagenImageFormat.jpeg(75) // JPEG with a compression level of 75.
* }
* ```
*
* @beta
*/
export declare class ImagenImageFormat {
/**
* The MIME type.
*/
mimeType: string;
/**
* The level of compression (a number between 0 and 100).
*/
compressionQuality?: number;
private constructor();
/**
* Creates an <code>{@link ImagenImageFormat}</code> for a JPEG image.
*
* @param compressionQuality - The level of compression (a number between 0 and 100).
* @returns An <code>{@link ImagenImageFormat}</code> object for a JPEG image.
*
* @beta
*/
static jpeg(compressionQuality?: number): ImagenImageFormat;
/**
* Creates an <code>{@link ImagenImageFormat}</code> for a PNG image.
*
* @returns An <code>{@link ImagenImageFormat}</code> object for a PNG image.
*
* @beta
*/
static png(): ImagenImageFormat;
}