# 提取 UI 元素

针对界面场景图，调用视觉模型直接通过AI生成一张精灵图。

## 先说结论：3个步骤

Extract UI Elements 用在一张具体的游戏场景截图上：调视觉模型，把 UI 抽出来拼进一张精灵位图。区域数量和边界要卡得很准时不太合适——结果是近似的，跟所选模型有关。

**Extract UI Elements** 对当前图片直接调模型做 UI 提取。不用写提示词，界面上点完就能跑。

## 步骤 1：从菜单选中这个功能

提取前先准备好场景或精灵截图。下面这张是本篇演示用的源图。

![Extract UI Elements 之前的游戏场景精灵](/images/extract-ui-elements/extract-ui-elements-base-sprite-image_.webp)

选中目标图后，打开 **AI tools（AI 工具）**，再打开 **AI Extract（AI 提取）**，选 **Extract elements（提取元素）**。

<figure>
  <img src="/images/extract-ui-elements/extract-ui-elements-step1_.webp" alt="AI tools（AI 工具）菜单里，AI Extract（AI 提取）展开，选中 Extract elements（提取元素）">
</figure>

## 步骤 2：设模型和参数

对话框里选模型和输出尺寸。可选 GPT Image 2、Nano Banana / Nano Banana 2、Nano Banana Pro。尺寸越大，抽出来的物件往往更多、花样也更多。

<figure>
  <img src="/images/extract-ui-elements/extract-ui-elements-step2_.webp" alt="Extract UI Elements 对话框：模型和输出尺寸">
  <figcaption>仅作点击流程入口参考。截图为截至 2026 年 9 月 3 日的最新产品界面。</figcaption>
</figure>

## 步骤 3：看提取结果

生成后检查拼合结果。当前输出是一张**不透明**的位图图层；接到后面的步骤前，通常还要清一次。

<figure>
  <img src="/images/extract-ui-elements/extract-ui-elements-step3_.webp" alt="抽出来的 UI 元素拼在一张不透明精灵位图上">
  <figcaption>GPT Image 2，输出尺寸 1K。</figcaption>
</figure>

## 更合适的场景：从位图到精灵表

UI 更密的单张位图，比上面步骤 1–3 的演示更适合 Extract UI Elements。模型从一张源图抽出控件和面板，拼到一张精灵图上；丰富度和边界精度都高于步骤 3 那张演示结果。

<figure>
  <img src="/images/extract-ui-elements/extract-ui-elements-user-case-2-base-image_.webp" alt="用作 Extract UI Elements 源图的 UI 密集游戏位图">
  <figcaption>源图：一张 UI 很密的位图。</figcaption>
</figure>

<figure>
  <img src="/images/extract-ui-elements/extract-ui-elements-user-case-2-output-image-gpt-image-2-1k_.webp" alt="抽出来的 UI 元素铺在一张精灵表上">
  <figcaption>输出精灵表，GPT Image 2，输出尺寸 1K。</figcaption>
</figure>

<figure class="video-embed">
  <div class="video-embed-frame">
    <iframe
      src="https://www.youtube-nocookie.com/embed/bh2G7L_9MYs"
      title="VberAI Studio 提取 UI 元素演示"
      allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
      allowfullscreen
    ></iframe>
  </div>
</figure>
