使用应用默认凭证 (ADC) 通过 Google Cloud Vertex AI generateContent 生成图像。
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.
subprocess to orchestrate gcloud and curl for secure API interaction.GOOGLE_CLOUD_PROJECT: Your Google Cloud Project ID.GOOGLE_CLOUD_LOCATION (Optional): Location/region (defaults to global).GOOGLE_CLOUD_MODEL (Optional): Model name (defaults to gemini-3.1-flash-image-preview).bash
python3 {baseDir}/scripts/image_harness.py --prompt-file <prompt_path> --out <output_path>
bash
python3 {baseDir}/scripts/image_harness.py --prompt-file <prompt_path> --out <output_path> --project <project_id> --location <location> --model <model>
bash
python3 {baseDir}/scripts/image_harness.py --prompt-file <prompt_path> --out <output_path> --auth-mode user-token
gcloud CLI) installed and available in $PATH.gcloud auth application-default logingcloud auth logincurl installed to issue the API request.