# 提取 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>
