GLabs SDK
Tier Configuration
Understanding Pro and Ultra tier differences
Tier Configuration
The SDK provides utilities for managing account tier differences in video and image generation.
Account Tiers
Google Labs offers two subscription tiers:
| Feature | Pro | Ultra |
|---|---|---|
| Video Modes | quality, fast | quality, fast |
| Default Video Mode | fast | quality |
| PaygateTier | PAYGATE_TIER_TWO | PAYGATE_TIER_TWO |
| HD Upscaling | Yes | Yes |
| Quality Mode | Yes | Yes |
| Max Images/Batch | 4 | 4 |
Tier Utilities
Import tier configuration utilities:
import {
getTierCapabilities,
getEffectiveVideoMode,
getVideoApiConfig,
getImageApiConfig,
isFeatureSupported,
} from '@vrex/glabs-sdk';Get Tier Capabilities
const capabilities = getTierCapabilities('pro');
console.log(capabilities.supportedVideoModes); // ['quality', 'fast']
console.log(capabilities.defaultVideoMode); // 'fast'
console.log(capabilities.paygateTier); // 'PAYGATE_TIER_TWO'
console.log(capabilities.supportsUpsample); // true
console.log(capabilities.supportsQualityMode); // true
console.log(capabilities.maxImageGenerationCount); // 4Get Effective Video Mode
Returns the actual mode that will be used based on tier restrictions:
// Pro account requesting quality mode
const mode = getEffectiveVideoMode('pro', 'quality');
// Returns: 'quality' (supported)
// Pro account with no mode specified
const defaultMode = getEffectiveVideoMode('pro');
// Returns: 'fast' (tier default)Get Video API Config
Get all configuration needed for a video API request:
const config = getVideoApiConfig(
'text-to-video', // Generation type
'pro', // Account tier
'16:9', // Aspect ratio
'fast' // Video mode
);
console.log(config.videoModelKey); // 'veo_3_1_t2v_fast_ultra'
console.log(config.userPaygateTier); // 'PAYGATE_TIER_TWO'
console.log(config.effectiveVideoMode); // 'fast'
console.log(config.aspectRatioEnum); // 'VIDEO_ASPECT_RATIO_LANDSCAPE'Get Image API Config
const config = getImageApiConfig(
'pro', // Account tier
'16:9', // Aspect ratio
'nanobanana' // Model
);
console.log(config.imageModelName); // 'GEM_PIX'
console.log(config.aspectRatioEnum); // 'IMAGE_ASPECT_RATIO_LANDSCAPE'Check Feature Support
// Check if HD upscaling is supported
const upsampleSupport = isFeatureSupported('upsample', 'pro', '16:9');
console.log(upsampleSupport.supported); // true
// HD upscaling only works with 16:9
const portraitUpsample = isFeatureSupported('upsample', 'pro', '9:16');
console.log(portraitUpsample.supported); // false
console.log(portraitUpsample.reason); // 'HD upscaling only supports 16:9 landscape videos'
// Check quality mode support
const qualitySupport = isFeatureSupported('quality_mode', 'pro');
console.log(qualitySupport.supported); // trueVideo Generation Types
| Type | Description |
|---|---|
text-to-video | Generate from text prompt |
image-to-video | Generate from first frame image |
image-to-video-fl | Generate from first and last frame images |
extend | Extend existing video |
reshoot | Camera control reshoot |
upsample | HD upscaling (1080p) |
reference-images | Multi-image reference video |
Video Model Keys
The SDK automatically selects the correct model based on generation type, tier, mode, and aspect ratio.
Text-to-Video Models
| Tier | Mode | Model Key |
|---|---|---|
| Pro/Ultra | fast | veo_3_1_t2v_fast_ultra |
| Pro/Ultra | quality | veo_3_1_t2v |
Image-to-Video Models
| Tier | Mode | Aspect | Model Key |
|---|---|---|---|
| Pro/Ultra | fast | 16:9, 1:1 | veo_3_1_i2v_s_fast_ultra |
| Pro/Ultra | fast | 9:16 | veo_3_1_i2v_s_fast_portrait_ultra |
| Pro/Ultra | quality | 16:9, 1:1 | veo_3_1_i2v_s |
| Pro/Ultra | quality | 9:16 | veo_3_1_i2v_s_portrait |
Camera Control Models
| Aspect | Model Key |
|---|---|
| 16:9 | veo_3_0_reshoot_landscape |
| 9:16 | veo_3_0_reshoot_portrait |
| 1:1 | veo_3_0_reshoot_square |
Reference Images Models
| Tier | Model Key |
|---|---|
| Pro | veo_3_0_r2v_fast |
| Ultra | veo_3_0_r2v_fast_ultra |
Upscale Model
All tiers use veo_2_1080p_upsampler_8s for HD upscaling.
Aspect Ratio Enums
Video Aspect Ratios
| Ratio | Enum Value |
|---|---|
| 16:9 | VIDEO_ASPECT_RATIO_LANDSCAPE |
| 9:16 | VIDEO_ASPECT_RATIO_PORTRAIT |
| 1:1 | VIDEO_ASPECT_RATIO_SQUARE |
Image Aspect Ratios
| Ratio | Enum Value |
|---|---|
| 16:9 | IMAGE_ASPECT_RATIO_LANDSCAPE |
| 9:16 | IMAGE_ASPECT_RATIO_PORTRAIT |
| 1:1 | IMAGE_ASPECT_RATIO_SQUARE |
Utility Functions
getVideoAspectRatioEnum
import { getVideoAspectRatioEnum } from '@vrex/glabs-sdk';
getVideoAspectRatioEnum('16:9'); // 'VIDEO_ASPECT_RATIO_LANDSCAPE'
getVideoAspectRatioEnum('9:16'); // 'VIDEO_ASPECT_RATIO_PORTRAIT'
getVideoAspectRatioEnum('1:1'); // 'VIDEO_ASPECT_RATIO_SQUARE'getImageAspectRatioEnum
import { getImageAspectRatioEnum } from '@vrex/glabs-sdk';
getImageAspectRatioEnum('16:9'); // 'IMAGE_ASPECT_RATIO_LANDSCAPE'
getImageAspectRatioEnum('9:16'); // 'IMAGE_ASPECT_RATIO_PORTRAIT'
getImageAspectRatioEnum('1:1'); // 'IMAGE_ASPECT_RATIO_SQUARE'getVideoModelKey
import { getVideoModelKey } from '@vrex/glabs-sdk';
getVideoModelKey('text-to-video', 'pro', '16:9', 'fast');
// Returns: 'veo_3_1_t2v_fast_ultra'
getVideoModelKey('image-to-video-fl', 'ultra', '9:16', 'quality');
// Returns: 'veo_3_1_i2v_s_portrait_fl'