[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EGJ4DMCE9FD0209VE6N088":3,"skill-same:01M6EGJ4DMCE9FD0209VE6N088":110},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":27,"linkOnly":28,"markdownContent":29,"markdownBody":29,"frontMatter":30,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":36,"ownerHtmlUrl":37,"ownerBlogUrl":6,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M6EGJ4DMCE9FD0209VE6N088","vertex-media-generation",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fvertex-media-generation\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[23,24,25,26],"Media","generation","media generation","vertex media generation","2026-11-10 10:12:30",false,"# Vertex Media Generation\n\n## Overview\n\nBuild image and video generation features using Google Vertex AI through the Vercel AI SDK. Covers Imagen models for image generation and editing (inpainting, outpainting, background swap) and Veo models for video generation with optional audio. Uses the `@ai-sdk\u002Fgoogle-vertex` provider with the unified `ai` SDK.\n\n## Instructions\n\n### Step 1: Set up the project\n\n```bash\nnpm install ai @ai-sdk\u002Fgoogle-vertex\ngcloud auth application-default login\n```\n\nUse the default provider instance (reads `GOOGLE_CLOUD_PROJECT` from env), or create a custom one:\n\n```typescript\nimport { vertex } from '@ai-sdk\u002Fgoogle-vertex';\n\u002F\u002F Or: import { createVertex } from '@ai-sdk\u002Fgoogle-vertex';\n\u002F\u002F const vertex = createVertex({ project: 'my-gcp-project', location: 'us-central1' });\n```\n\n### Step 2: Generate images with Imagen\n\nUse `generateImage` from the `ai` package with a Vertex image model:\n\n```typescript\nimport { vertex } from '@ai-sdk\u002Fgoogle-vertex';\nimport { generateImage } from 'ai';\n\nconst { image } = await generateImage({\n  model: vertex.image('imagen-4.0-generate-001'),\n  prompt: 'A futuristic cityscape at sunset',\n  aspectRatio: '16:9',\n});\n```\n\nImagen does NOT support the `size` parameter. Use `aspectRatio` instead. Supported ratios: `1:1`, `3:4`, `4:3`, `9:16`, `16:9`.\n\nAvailable Imagen models:\n\n| Model | Speed | Quality |\n|-------|-------|---------|\n| `imagen-4.0-ultra-generate-001` | Slow | Highest |\n| `imagen-4.0-generate-001` | Medium | High |\n| `imagen-4.0-fast-generate-001` | Fast | Good |\n| `imagen-3.0-generate-002` | Medium | High |\n| `imagen-3.0-fast-generate-001` | Fast | Good |\n\nConfigure generation with provider options:\n\n```typescript\nconst { image } = await generateImage({\n  model: vertex.image('imagen-4.0-generate-001'),\n  prompt: 'Professional headshot portrait',\n  aspectRatio: '1:1',\n  providerOptions: {\n    vertex: {\n      negativePrompt: 'blurry, low-quality, distorted',\n      personGeneration: 'allow_adult',\n      safetySetting: 'block_medium_and_above',\n      addWatermark: true,\n    },\n  },\n});\n```\n\nProvider options: `negativePrompt` (exclude elements), `personGeneration` (`allow_adult` | `allow_all` | `dont_allow`), `safetySetting` (`block_low_and_above` | `block_medium_and_above` | `block_only_high` | `block_none`), `addWatermark` (boolean, default true), `storageUri` (GCS path).\n\n### Step 3: Edit images with Imagen\n\nUse `imagen-3.0-capability-001` for inpainting, outpainting, and background swap. Provide the source image and a mask (white pixels = area to edit):\n\n```typescript\nimport { generateImage } from 'ai';\nimport fs from 'fs';\n\nconst sourceImage = fs.readFileSync('.\u002Fphoto.png');\nconst mask = fs.readFileSync('.\u002Fmask.png');\n\nconst { images } = await generateImage({\n  model: vertex.image('imagen-3.0-capability-001'),\n  prompt: {\n    text: 'Add a golden retriever sitting on the grass',\n    images: [sourceImage],\n    mask,\n  },\n  providerOptions: {\n    vertex: {\n      edit: {\n        mode: 'EDIT_MODE_INPAINT_INSERTION',\n        maskMode: 'MASK_MODE_USER_PROVIDED',\n        baseSteps: 50,\n        maskDilation: 0.01,\n      },\n    },\n  },\n});\n```\n\nEdit modes: `EDIT_MODE_INPAINT_INSERTION` (add objects), `EDIT_MODE_INPAINT_REMOVAL` (remove objects), `EDIT_MODE_OUTPAINT` (extend canvas), `EDIT_MODE_BGSWAP` (replace background), `EDIT_MODE_PRODUCT_IMAGE` (product photography), `EDIT_MODE_CONTROLLED_EDITING` (style transfer). The `baseSteps` parameter (35-75) controls quality: higher values produce better results but take longer.\n\n### Step 4: Generate videos with Veo\n\nUse `experimental_generateVideo` for video generation. Video generation is asynchronous and may take several minutes:\n\n```typescript\nimport { vertex } from '@ai-sdk\u002Fgoogle-vertex';\nimport { experimental_generateVideo as generateVideo } from 'ai';\n\nconst { video } = await generateVideo({\n  model: vertex.video('veo-3.1-generate-001'),\n  prompt: 'Aerial drone shot of a coral reef with tropical fish',\n  aspectRatio: '16:9',\n  resolution: '1920x1080',\n  duration: 8,\n});\n```\n\nAvailable Veo models:\n\n| Model | Audio |\n|-------|-------|\n| `veo-3.1-generate-001` | Yes |\n| `veo-3.1-fast-generate-001` | Yes |\n| `veo-3.0-generate-001` | Yes |\n| `veo-3.0-fast-generate-001` | Yes |\n| `veo-2.0-generate-001` | No |\n\nConfigure with provider options:\n\n```typescript\nconst { video } = await generateVideo({\n  model: vertex.video('veo-3.1-generate-001'),\n  prompt: 'Time-lapse of a flower blooming',\n  aspectRatio: '16:9',\n  providerOptions: {\n    vertex: {\n      generateAudio: true,\n      personGeneration: 'allow_adult',\n      negativePrompt: 'blurry, shaky, low-resolution',\n      pollIntervalMs: 5000,\n      pollTimeoutMs: 600000,\n    },\n  },\n});\n```\n\nProvider options: `generateAudio` (boolean), `personGeneration`, `negativePrompt`, `gcsOutputDirectory` (GCS URI), `referenceImages` (style guidance), `pollIntervalMs` (check interval), `pollTimeoutMs` (max wait, default 10 min for long videos).\n\n## Examples\n\n### Example 1: Product photography pipeline\n\n**User request:** \"Generate product photos for an e-commerce listing of a ceramic mug\"\n\n**Actions taken:**\n\n```typescript\nimport { vertex } from '@ai-sdk\u002Fgoogle-vertex';\nimport { generateImage } from 'ai';\nimport fs from 'fs';\n\nconst backgrounds = [\n  'Minimalist white marble countertop with soft natural lighting',\n  'Cozy breakfast table with morning sunlight and croissants',\n  'Modern office desk with laptop and notebook, shallow depth of field',\n];\n\nfor (const [i, scene] of backgrounds.entries()) {\n  const { image } = await generateImage({\n    model: vertex.image('imagen-4.0-generate-001'),\n    prompt: `Professional product photo of a handmade ceramic coffee mug, earth-tone glaze, ${scene}`,\n    aspectRatio: '1:1',\n    providerOptions: {\n      vertex: {\n        negativePrompt: 'text, watermark, logo, blurry, oversaturated',\n        addWatermark: false,\n      },\n    },\n  });\n\n  fs.writeFileSync(`mug-scene-${i + 1}.png`, Buffer.from(image.base64, 'base64'));\n  console.log(`Saved mug-scene-${i + 1}.png`);\n}\n```\n\n**Expected output:** Three 1:1 product images saved as PNG files, each showing the mug in a different setting.\n\n### Example 2: Video ad generation with audio\n\n**User request:** \"Create a short video ad for a hiking app launch\"\n\n**Actions taken:**\n\n```typescript\nimport { vertex } from '@ai-sdk\u002Fgoogle-vertex';\nimport { experimental_generateVideo as generateVideo } from 'ai';\nimport fs from 'fs';\n\nconst { video } = await generateVideo({\n  model: vertex.video('veo-3.1-generate-001'),\n  prompt: `Cinematic drone shot following a solo hiker ascending a mountain trail\nat golden hour. Camera starts low behind the hiker and rises to reveal a\npanoramic vista of snow-capped peaks. Style: epic, aspirational, warm color\ngrading. Text overlay space at the top third of the frame.`,\n  aspectRatio: '9:16',\n  resolution: '1080x1920',\n  duration: 8,\n  providerOptions: {\n    vertex: {\n      generateAudio: true,\n      negativePrompt: 'shaky camera, low quality, overexposed, urban elements',\n      pollTimeoutMs: 600000,\n    },\n  },\n});\n\nfs.writeFileSync('hiking-app-ad.mp4', Buffer.from(video.base64, 'base64'));\nconsole.log('Saved hiking-app-ad.mp4');\n```\n\n**Expected output:** An 8-second vertical video with generated audio, saved as MP4.\n\n### Example 3: Image editing — background swap\n\n**User request:** \"Replace the background of this product photo with a beach scene\"\n\n**Actions taken:**\n\n```typescript\nimport { vertex } from '@ai-sdk\u002Fgoogle-vertex';\nimport { generateImage } from 'ai';\nimport fs from 'fs';\n\nconst sourceImage = fs.readFileSync('.\u002Fproduct-original.png');\nconst mask = fs.readFileSync('.\u002Fbackground-mask.png');\n\nconst { images } = await generateImage({\n  model: vertex.image('imagen-3.0-capability-001'),\n  prompt: {\n    text: 'Sandy tropical beach at sunset with palm trees and calm ocean waves',\n    images: [sourceImage],\n    mask,\n  },\n  providerOptions: {\n    vertex: {\n      edit: {\n        mode: 'EDIT_MODE_BGSWAP',\n        maskMode: 'MASK_MODE_USER_PROVIDED',\n        baseSteps: 60,\n      },\n    },\n  },\n});\n\nfs.writeFileSync('product-beach-bg.png', Buffer.from(images[0].base64, 'base64'));\nconsole.log('Saved product-beach-bg.png');\n```\n\n**Expected output:** The original product preserved with a new beach background.\n\n## Guidelines\n\n- Always use `aspectRatio` instead of `size` for Imagen models — `size` is not supported.\n- Use `imagen-4.0-generate-001` as the default for new image generation. Use `imagen-3.0-capability-001` only for editing operations.\n- Set `pollTimeoutMs` to at least 600000 (10 min) for Veo video generation — it can take several minutes, especially for higher resolutions or longer durations.\n- Use `negativePrompt` to refine outputs: list specific artifacts to avoid (blurry, distorted, watermark) rather than vague terms.\n- For production pipelines, specify `storageUri` (images) or `gcsOutputDirectory` (videos) to write directly to Cloud Storage instead of handling base64 in memory.\n- Video generation with Veo is experimental (`experimental_generateVideo`). The API may change between SDK versions.\n- Models with `fast` in the name trade quality for speed — use them for drafts and iteration, switch to standard models for final output.\n- `personGeneration` defaults to blocking people. Set to `allow_adult` or `allow_all` when generating content that intentionally includes people.\n- GCP billing applies to all Vertex AI media generation. Imagen ultra and Veo 3.1 cost more than their standard\u002Ffast counterparts.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fvertex-media-generation",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill vertex-media-generation",{"tool":46,"command":47},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill vertex-media-generation",{"tool":49,"command":50},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill vertex-media-generation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fvertex-media-generation\u002FSKILL.md",true,[54,60,66,70,74,78,82,86,90,94,98,102,106],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"checklist.md","REFERENCE","参考文档",10101,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Fchecklist.md",{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"documentation-requirements.csv","ASSET","资产文件",8076,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Fdocumentation-requirements.csv",{"path":67,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":68,"sourceHtmlUrl":69},"instructions.md",5164,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Finstructions.md",{"path":71,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":72,"sourceHtmlUrl":73},"templates\u002Fdeep-dive-template.md",5854,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Ftemplates\u002Fdeep-dive-template.md",{"path":75,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":76,"sourceHtmlUrl":77},"templates\u002Findex-template.md",4510,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Ftemplates\u002Findex-template.md",{"path":79,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":80,"sourceHtmlUrl":81},"templates\u002Fproject-overview-template.md",1951,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Ftemplates\u002Fproject-overview-template.md",{"path":83,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":84,"sourceHtmlUrl":85},"templates\u002Fproject-scan-report-schema.json",4836,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Ftemplates\u002Fproject-scan-report-schema.json",{"path":87,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":88,"sourceHtmlUrl":89},"templates\u002Fsource-tree-template.md",2160,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Ftemplates\u002Fsource-tree-template.md",{"path":91,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":92,"sourceHtmlUrl":93},"workflow.md",719,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Fworkflow.md",{"path":95,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":96,"sourceHtmlUrl":97},"workflows\u002Fdeep-dive-instructions.md",11909,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Fworkflows\u002Fdeep-dive-instructions.md",{"path":99,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":100,"sourceHtmlUrl":101},"workflows\u002Fdeep-dive-workflow.md",979,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Fworkflows\u002Fdeep-dive-workflow.md",{"path":103,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":104,"sourceHtmlUrl":105},"workflows\u002Ffull-scan-instructions.md",43200,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Fworkflows\u002Ffull-scan-instructions.md",{"path":107,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":108,"sourceHtmlUrl":109},"workflows\u002Ffull-scan-workflow.md",970,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.roo\u002Fskills\u002Fbmad-document-project\u002Fworkflows\u002Ffull-scan-workflow.md",[111,123,133,142,148,155],{"skillNo":112,"name":113,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":119,"publishedAt":27},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[116],{"categoryNo":117,"categoryName":118,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[120,121,122],"model","model hierarchy","model hierarchy skill",{"skillNo":124,"name":125,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":129,"publishedAt":27},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[128],{"categoryNo":117,"categoryName":118,"taxonomyType":20,"taxonomyTypeDesc":21},[130,131,132],"MCP","zoom","zoom mcp",{"skillNo":134,"name":135,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":27},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[139,140,141,131],"sdk","zoom apps sdk","apps",{"skillNo":143,"name":144,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":27},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[144],{"skillNo":149,"name":150,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":154,"publishedAt":27},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[153],{"categoryNo":117,"categoryName":118,"taxonomyType":20,"taxonomyTypeDesc":21},[150],{"skillNo":156,"name":157,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":27},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[157]]