Google Cloud Vertex AI Image Generator (ADC)
This skill utilizes the Google Cloud SDK (gcloud) and application credentials to call the Google Cloud Vertex AI generateContent API, generating images directly using model predictions.
Security & Privacy Notice
- Process Execution: This skill invokes
subprocessto orchestrategcloudandcurlfor secure API interaction. - Privilege & Access: It requires access to your environment variables (for authentication context) and local file read/write permissions to handle image prompt files and generate the output assets.
- Debug Artifacts: For error tracking and development transparency, full API responses may be written to the system-defined temporary directory. These artifacts are local to the machine running the skill.
Workflow
- Configure required environment variables or parameters:
GOOGLE_CLOUD_PROJECT: Your Google Cloud Project ID.GOOGLE_CLOUD_LOCATION(Optional): Location/region (defaults toglobal).GOOGLE_CLOUD_MODEL(Optional): Model name (defaults togemini-3.1-flash-image-preview).
- Construct/save prompt to a local text file.
- Call the generation script.
Commands
Generate Image (Default ADC)
python3 {baseDir}/scripts/image_harness.py --prompt-file <prompt_path> --out <output_path>
Advanced Usage
- Specify custom project, location, and model:
python3 {baseDir}/scripts/image_harness.py --prompt-file <prompt_path> --out <output_path> --project <project_id> --location <location> --model <model>
- Use user-auth token instead of ADC:
python3 {baseDir}/scripts/image_harness.py --prompt-file <prompt_path> --out <output_path> --auth-mode user-token
Setup & Requirements
- Google Cloud SDK (
gcloudCLI) installed and available in$PATH. - Active authentication token:
- Default ADC mode:
gcloud auth application-default login - User-token mode:
gcloud auth login
- Default ADC mode:
- The system must have
curlinstalled to issue the API request.
