360 Secure SkillHub
360 安全技能中心

Google vertex image generator

该 Skill 通过 Python 脚本调用 Google Cloud Vertex AI 的 generateContent 接口,读取本地提示词文件生成图像并保存到指定路径。默认使用 gcloud 应用默认凭据(ADC),也可切换为用户令牌;需安装 gcloud 与 curl,可指定项目、区域和模型,调试响应可能写入系统临时文件。

分类:创作
neogeosnk
neogeosnk
热度 17.12
最近更新 2026-06-28 11:17:09

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add neogeosnk/vertex-image-adc
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
vertex-image-adc
description
Generate images via Google Cloud Vertex AI generateContent using Application Default Credentials (ADC).
homepage
https://cloud.google.com/vertex-ai
metadata
{"openclaw":{"emoji":"🎨","requires":{"binaries":["gcloud","curl"]},"security":{"permissions":["shell","file-access","environment-access"],"note":"This skill requires shell execution (for gcloud/curl/python) and file access (for prompt/output handling). It uses system temporary storage (/tmp) for debug logs, which are cleared by system management. Users should be aware that sensitive prompt data or API responses may briefly reside in temporary files during the request cycle."}}}

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 subprocess to orchestrate gcloud and curl for 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

  1. Configure required environment variables or parameters:
    • 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).
  2. Construct/save prompt to a local text file.
  3. 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 (gcloud CLI) installed and available in $PATH.
  • Active authentication token:
    • Default ADC mode: gcloud auth application-default login
    • User-token mode: gcloud auth login
  • The system must have curl installed to issue the API request.