Communitygithub.com

evalix098/tiktoklive

如何使用 Grok Build 中的 Imagine 工具:imagine_text_to_image、imagine_image_to_image、imagine_reference_to_image、imagine_text_to_video、imagine_image_to_video、imagine_reference_to_video 以及用於聊天預覽的 render_file。了解何時應透過程式碼建構視覺內容而非直接生成。涵蓋提示詞撰寫、真人形象以參考為優先、事實查證以及資產一致性。每當需要生成或編輯圖片或影片時,請載入此技能。此技能為工具驅動,不會因使用者僅提及圖片而觸發。

tiktoklive 是什麼?

此技能文件詳細說明 Grok Build 的「Imagine」影像與影片生成工具組,採用模組化工具架構,並無統一的「imagine_image」或「imagine_video」工具。使用者必須根據需求選擇對應的工具:純文字生成用「imagine_text_to_image」、編輯單一圖片用「imagine_image_to_image」、合成多張參考圖用「imagine_reference_to_image」,以及對應的影片生成工具。技能強調絕對不要發明工具未回傳的檔案路徑,並應使用「render_file」在對話中展示結果,而非自訂 Markdown 圖片連結。 文件的核心理念指出,對於需要精確文字、數字或結構的輸出(如圖表、圖解、UI畫面),應優先使用程式碼(例如 HTML/CSS)建構,因為影像模型在這些方面容易出錯。此外,技能要求對真人形象一律採用「參考優先」策略,透過「imagine_image_to_image」搭配真實參考圖片,且絕不生成未經同意或涉及未成年人的渲染。 技能也提供嚴謹的驗證流程,要求開發者在產生結果後,使用「read_file」檢查內容正確性,並在發現錯誤時以程式碼重建而非單純重試提示詞。最後,技能涵蓋提示詞撰寫的最佳實踐、多步驟工作流程規劃、失敗處理機制,以及保持角色或物體一致性的「基底重用」方法,適用於任何需要生成或編輯圖片與影片的場景。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/evalix098/tiktoklive/tree/HEAD/.grok/skills/imagine-grok-build

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Imagine

Grok Build 使用分拆的 Imagine 電腦堆疊(grok_computer 變體)。 沒有統一的 imagine_image 或 imagine_video 工具——務必 從下表呼叫特定於模態的名稱。

工具角色
imagine_text_to_image僅從文字提示生成新圖片(無來源)。
imagine_image_to_image編輯/重新設計一個現有圖片(沙箱路徑)。
imagine_reference_to_image結合 2+ 張參考圖片(沙箱路徑)。
imagine_text_to_video僅從文字提示生成新影片(無來源)。
imagine_image_to_video將一個靜態圖片(沙箱路徑)動畫化為影片。
imagine_reference_to_video從 1+ 張參考圖片(沙箱路徑)生成影片。
render_file在聊天中向使用者顯示沙箱圖片/影片路徑。

基於路徑的控制代碼。 這些工具讀寫共用的沙箱:

  • 生成作業會回傳一個沙箱 file_path(位於 artifacts 下)。使用 read_file / shell 開啟;使用 render_file 向使用者顯示。
  • 編輯/動畫化工具接受該路徑(或多個路徑)作為輸入——比對即時結構描述 (image、images 等)。切勿發明路徑。
  • 切勿呼叫 imagine_image / imagine_video。資產 ID 輔助工具 (imagine_create_asset / imagine_view_media / render_imagine_media) 不在此堆疊中。

每當您考慮或即將呼叫這些工具時,請套用此原則。

處理流程(強制思維模型)

生成 → file_path → render_file(顯示給使用者) / read_file 或腳本(品質檢查)
編輯 / 動畫化 → 將先前的 file_path 傳入 image_to_* / reference_to_*
  • 使用工具實際回傳的路徑——不要發明檔案系統路徑。
  • 使用 render_file 向使用者顯示媒體,不要使用臨時的 Markdown 圖片連結。

使用程式碼建構精確的視覺內容,而非影像工具

  1. 影像模型在處理精確文字、數字和結構時不可靠。 它們可以處理簡短文字或簡單版面,但常常扭曲文字、憑空創造數字、繪製與資料不符的圖表長條,或讓圖解箭頭指向無意義的方向,而且要求越精確,表現越差。詳細的提示詞無法使其可靠,而另一次 imagine_image_to_image 編輯通常也無法修正。因此,當結果需要正確的特定文字、資料或結構時(來自真實數字的圖表、有標籤的技術圖解、數學說明、表格、含有真實內容的畫面),請使用程式碼建構資產,這樣您才能控制確切內容。偏好使用 HTML 和 CSS,其在版面、排版和精緻度上遠優於 Python 繪圖。只有在視覺效果重要時(照片、插圖、角色、場景、裝飾藝術),影像工具才是正確選擇。應根據輸出需要達成哪些正確性來決定使用何種工具,而非根據請求的措辭。

驗證離散精確性(循環)

當輸出必須正確呈現特定文字、數字、資料或結構時,不要信任第一次的結果——以循環方式驗證:

  1. 產生結果(生成,或依據使用程式碼建構精確的視覺內容,用程式碼建構)。
  2. 檢查實際輸出——對結果路徑使用 read_file(影像理解)——確認每個詞彙、數字、標籤和結構細節都符合要求,且沒有任何元素重疊、被裁剪或超出畫布。
  3. 如果任何地方有誤,修正並重新驗證:
    • 來自影像模型的文字扭曲、數字錯誤或版面損壞?不要只是重試提示詞——很可能又會扭曲。改用程式碼重建。
    • 以程式碼建構的輸出中元素重疊或遭裁剪?使用自動版面(HTML/CSS)重新佈局,而非手動調整座標。
    • 否則,透過 imagine_image_to_image 並帶入先前的路徑,進行一次有針對性的編輯。
  4. 只有在離散內容完全正確時才完成。如果無法使其準確,請告知使用者,而不是交付錯誤的內容。

核心原則

  1. 您掌握提示詞。 如果使用者提供了詳細的提示詞或要求您使用他們的,請逐字使用。否則,您應撰寫最終提示詞:將主體放在前面,針對情緒、構圖、燈光和風格給予強而有力的高階方向,但不要過度指定每個細節;使用自然的散文而非關鍵字標籤;以正面描述代替負面提示。對於編輯,僅描述變更。目標為 2-5 句話。
  2. 真人形象以參考為優先。 切勿對具名的真人或群體使用純文字轉圖片,包括換臉、海報、卡通以及電影或編輯性描繪。改為搭配真實參考路徑使用 imagine_image_to_image,且絕不產出未經同意、性化或涉及未成年人的肖像。請參閱「真人與參考」中的程序。
  3. 先搜尋事實再生成。 如果請求的任何部分依賴於真實世界的事實、身份、品牌或產品、地點、事件,或最新/當前的結果,請在生成前搜尋網路,並將實際驗證過的細節放入提示詞中。不要依賴記憶,也不要撰寫模糊的佔位符,例如「現任總統」;請寫出經查證的姓名。
  4. 為保持一致性重用基底。 當同一個角色、物體或場景必須出現在多張圖片中時,使用 imagine_text_to_image 生成一個基底,保留其 file_path,然後將該路徑傳遞給 imagine_image_to_image 進行每個變體。不要為重複出現的主題每次都從頭重新執行文字轉圖片。
  5. 優雅處理失敗。 遇到審核或安全封鎖時,停止;不要重試,也不要改寫提示詞以規避過濾器。告知使用者已被封鎖,並提供不同的方向。如果參考品質不佳或結果看起來不對勁,請明確指出,並要求上傳或重新導向,而非默默迭代。
  6. 規劃多步驟工作流程。 規劃步驟順序;僅可並行化屬於同一步驟的生成作業。
  7. 最後進行審查。 確認您預期要生成的內容確實已執行,且符合要求。使用 render_file 渲染最終資產。
  8. 不要假設工具行為。 不要發明實際未提供的工具參數、回傳值或環境功能;先驗證而非猜測。

選擇工具

情境呼叫
新圖片,無來源imagine_text_to_image,使用 prompt(+ aspect_ratio)
編輯/重新設計/重新著色一張現有圖片imagine_image_to_image,使用 prompt + 來源路徑
將 2+ 張參考圖片合成一張imagine_reference_to_image,使用 prompt + 來源路徑
對先前的結果進行迭代imagine_image_to_image,使用先前的路徑
具名的真人或群體網路搜尋後,使用真實參考路徑呼叫 imagine_image_to_image
從無到有創作一般/虛構的主題imagine_text_to_image
新影片,無來源imagine_text_to_video,使用 prompt
將一個靜態圖片動畫化imagine_image_to_video,使用該靜態圖片的路徑
多參考影片imagine_reference_to_video,使用圖片路徑

經驗法則:無參考 → text_to_;一個參考 → image_to_;2+ 參考 → reference_to_*。

imagine_text_to_image

從文字提示生成新圖片。

輸入:

  • prompt(必填)- 對所需圖片的完整描述。
  • aspect_ratio - 可為 1:1、3:4、4:3、2:3、3:2、9:16、16:9、21:9、5:2、50:11 或 unknown 之一。為 OG 分享卡片使用 16:9,為遊戲生成自訂 public/x-banner.jpg 時使用 50:11 作為 X 動態橫幅(每個應用程式都連接 x:game:image;只有遊戲會為此呼叫 Imagine——請參閱 og 技能);如需真正的 2:1 畫布,請呼叫 xAI Images API。

要產生多個變體,請使用不同的提示詞進行多次 imagine_text_to_image 呼叫。此工具不提供 n 或 count 參數。

imagine_image_to_image

編輯一張現有圖片。

輸入(名稱遵循即時結構描述——通常是單一的沙箱路徑):

  • prompt(必填)- 要變更的內容(僅描述編輯)。
  • 來源路徑欄位(必填)- 由先前的生成或下載回傳的沙箱路徑。
  • aspect_ratio - 僅在使用者明確要求變更比例時設定。

imagine_reference_to_image

從 2+ 個參考路徑合成一張圖片。

輸入:

  • prompt(必填)。
  • 來源路徑(必填)- 2+ 個沙箱路徑。
  • aspect_ratio - 選填。

對於單一來源的編輯,請改用 imagine_image_to_image。

imagine_text_to_video

僅從文字提示生成新影片(無來源影格)。

輸入:

  • prompt(必填)- 簡短的現在式鏡頭描述。
  • duration / aspect_ratio / 解析度欄位,依即時結構描述暴露的為準。

偏好簡短的鏡頭;提示詞撰寫規則與下方的圖片轉影片相同。

imagine_image_to_video

將一個靜態圖片動畫化為影片。

輸入:

  • 單一來源靜態圖片路徑(必填)。
  • prompt - 簡短的現在式鏡頭(建議使用;部分變體要求必填)。
  • duration - 6(預設)、10 或 15(當有暴露時)。
  • aspect_ratio - 選填;動畫化單一圖片時省略以保持來源比例。

偏好簡短的鏡頭。 將影片建構為一系列預先規劃的短片,而非一個長鏡頭:

  1. 將故事規劃為鏡頭——每個鏡頭一個節拍。
  2. 偏好較多 6 秒的鏡頭,而非較少的長鏡頭。
  3. 使用 imagine_text_to_image / imagine_image_to_image 建立每個鏡頭的來源靜態圖片(保持角色路徑一致)。
  4. 使用 imagine_image_to_video + 該靜態圖片路徑進行動畫化。

關鍵行為:

  • 提示詞撰寫: 用 1-2 句話描述一個簡短、生動的現在式時刻,並附帶明確的攝影機運動。
  • 最小但有趣: 一個明確的主體和一個簡單的動作或攝影機運動。
  • 來源複雜? 讓主體固定,僅移動攝影機,或分解成更簡單的鏡頭。
  • 真人: 以參考為優先——從驗證過的參考出發;絕不對無參考的具名人物進行動畫化。
  • 除非被要求,否則不要循環同一個剪輯。
  • 使用 FFmpeg stream copy 在回傳的影片路徑上組裝多鏡頭時間軸。

imagine_reference_to_video

從一個或多個參考圖片路徑,並由提示詞引導生成影片。當目標是獲得一個乾淨的第一影格時,偏好先使用 imagine_reference_to_image 合成一個靜態圖片,再使用 imagine_image_to_video。

撰寫強而有力的提示詞

大致按此順序描述:主體 -> 動作/姿勢 -> 設定 -> 風格 -> 構圖 -> 燈光/情緒 -> 關鍵細節。

  • 具體而具體;以最重要的元素開頭。
  • 陳述要包含的內容,而非要排除的內容。
  • 每個提示詞使用一個連貫的場景。
  • 將 aspect_ratio 匹配用例:9:16 用於手機/限時動態,16:9 用於橫幅/影片影格或 OG 分享卡片,1:1 用於大頭貼/圖示。

真人與參考

  1. 先搜尋網路以確認身份、角色、關係或事件,即使看似顯而易見。
  2. 在磁碟上取得一張強而有力的參考圖片(使用者上傳或搜尋 → 沙箱路徑),然後使用該路徑呼叫 imagine_image_to_image。使用者上傳的照片是最佳選擇。
  3. 如果沒有合適的參考,要求使用者上傳一張,而不是從薄弱的基底生成。

顯示結果

  • 使用沙箱 file_path 呼叫 render_file,讓使用者在聊天中看到圖片/影片。
  • 對於您自己的品質檢查和腳本,請對該路徑使用 read_file / shell。

遊戲精靈和地圖有自己的流程——請遵循 generate2dsprite、 video2dsprite 和 generate2dmap。

應避免的失敗模式

  • 呼叫統一名稱 imagine_image 或 imagine_video(它們不可用)。
  • 將列表傳遞給 imagine_image_to_image / imagine_image_to_video(僅接受單一來源)。
  • 發明工具從未回傳的檔案系統路徑。
  • 在沒有實際生成/file_path 的情況下,對您編造的路徑執行 chroma/ffmpeg。

Individual skills in this repo

This repo contains 17 individual skills — each has its own dedicated page.

evalix098/tiktoklive

Add user accounts and sign-in to this TanStack Start app. Use when the app needs authentication, sign-in, user accounts, protected routes, or per-user data. Triggers on "auth", "login", "log in", "sign in", "sign up", "account", "users", "authentication", "protected", "who is logged in", "current user", "per-user".

evalix098/tiktoklive

Build browser games and interactive/canvas/3D experiences in this TanStack Start + React app. Use for any game, simulation, or WebGL/Canvas experience — 2D or 3D, single-player. Covers the game loop & timing, 3D orientation/camera conventions, collision, performance, assets, audio, save, game feel, and per-genre playbooks. For WASD / vehicle / flight **input signs and inverted A/D**, open the **`controls`** skill — do not rely on this file or racing-kart alone. Triggers on "game", "minecraft", "fps", "platformer", "racing", "tetris", "snake", "shooter", "3d", "three.js", "canvas", "voxel", "physics".

evalix098/tiktoklive

Player-facing input signs for browser games: WASD, vehicles, flight, FPS mouse-look, and the #1 failure mode (inverted A/D). Mandatory control self-tests and a tiny test interface so you can verify A turns left before shipping. Load for ANY game with movement, steering, flying, driving, tanks, boats, mechs, drones, planes, karts, third-person follow cams — not only racing. Triggers on "controls", "WASD", "inverted", "steer", "flight", "airplane", "kart", "vehicle", "yaw", "roll", "pitch", "mouse look", "A/D".

evalix098/tiktoklive

Design and build polished, non-generic UI for this TanStack Start + React + Tailwind v4 + shadcn/Radix app. Use whenever you create or restyle any interface surface — pages, landing pages, dashboards, forms, modals, nav, and game overlays (start screens, HUD, menus). Covers design tokens, layout, typography, color, spacing, motion, and the anti-"AI-slop" rules that keep output from looking generic. Triggers on "design", "UI", "make it look good", "polish", "landing page", "theme", "style", "redesign", "ugly", "clean up".

evalix098/tiktoklive

Deep guide for game ANIMATION assets: motion cycles, action keyframes, effect sequences, and animation sprite sheets — built around a video-first pipeline. In this app-builder sandbox, execute via the video2dsprite / generate2dsprite skills (magenta + scripts), not ad-hoc ffmpeg. Use whenever generating anything that moves: walk/run cycles, attacks, idles, FX, flags, fire, animation sheets. Complements game-asset-core.

evalix098/tiktoklive

Core discipline for ANY game-asset generation with Imagine tools: the engine-ready defaults users don't state, spec checklists, style anchoring, read-back verification, honest defect flagging. Use whenever generating any game art (sprites, sheets, animations, tiles, UI, FX) — then ALSO load the matching specialist skill: game-animation-frames for anything that moves, game-tilesets for tiles/terrain, game-character-consistency for recurring characters, game-ui-icons for UI and icons.

evalix098/tiktoklive

Deep guide for CHARACTER IDENTITY across images: turnarounds (front/side/ back), state and damage variants, palette swaps, equipment changes, and same-character-in-context sets. Use whenever generating character turnarounds, character sheets, variants of an existing sprite, or any same-subject multi-image set. Complements game-asset-core.

evalix098/tiktoklive

Deep guide for game TILE assets: seamless tileable textures, terrain transition tilesets, autotiles, and ground/platform tiles. Use whenever generating tileable textures, tilesets, terrain transitions, or seamless patterns. Complements game-asset-core.

evalix098/tiktoklive

Deep guide for game UI assets: buttons with interaction states, panels, bars, wordmark logos, and icon sets. Use whenever generating game UI elements, HUD assets, inventory icons, icon sets, buttons, or title logos. Complements game-asset-core.

evalix098/tiktoklive

Generate production-oriented 2D game maps with `imagine_text_to_image`: RPG/top-down maps, side-scroller parallax stages, tilemaps, layered raster maps, prop packs, collision zones, and walkable areas. Use when building browser games that need real map art (not pure code-drawn tiles), layered props, or map collision metadata. Triggers on "map", "level", "stage", "tilemap", "overworld", "dungeon", "side scroller background", "prop pack", "2D map".

evalix098/tiktoklive

Generate and postprocess 2D game sprites and animation sheets: pixel-art characters, NPCs, creatures, spells, projectiles, impacts, props, summons, and transparent PNG/GIF exports. Use when building browser games that need real sprite sheets (not code-drawn placeholders), matching a map art style, or producing magenta-background sheets for chroma-key cleanup. Triggers on "sprite", "sprite sheet", "animation sheet", "pixel art character", "walk cycle", "attack animation", "projectile sprite", "2D game asset".

evalix098/tiktoklive

Peer-to-peer realtime multiplayer over WebRTC data channels: every user of the deployed app connects directly to every other user (full mesh), the server only brokers the handshake at /api/rtc. Lowest possible latency, zero per-message server cost. Use for 2-8 player co-op/casual realtime: shared cursors, drawing, party games, casual action. Triggers: p2p, peer to peer, webrtc, low latency multiplayer, direct connection.

evalix098/tiktoklive

Use Neon Postgres (the database) in this TanStack Start app. Use when the app needs to store or query data, persist state, or keep per-user data. Triggers on "database", "Postgres", "Neon", "save data", "store data", "persist", "tables", "SQL", "query", "migrations".

evalix098/tiktoklive

Share-link previews and app identity for apps on *.grok.me: the injector-owned og:image card, the SVG favicon, and PWA icons for installable apps. Use when scaffolding, renaming, or restyling the app — and for share / unfurl / OG / Twitter card questions. A custom 1200×630 card from the app's own art is the default — games of every kind (DOM board/word games included), whimsical apps, creative tools, and brand-forward pages; only plain utilities keep the placeholder. Always run the brand-asset pass as a `task` subagent and never wait for it. Triggers on "share", "rename", "app name", "OG", "Open Graph", "twitter card", "unfurl", "og:image", "og:type", "x:game:image", "x-banner", "link preview", "social card", "thumbnail", "preview image", "favicon", "app icon", "PWA", "manifest", "installable", "home screen", "SEO", "meta description".

evalix098/tiktoklive

Official Three.js API and TSL (Three.js Shading Language) reference for LLM code generation. Load when writing or debugging three.js / WebGL / WebGPU / custom materials / shaders / GLTF / advanced three APIs beyond basic game loop/controls. Prefer building-games for game correctness (loop, WASD, camera, orientation); use this skill for full API/TSL depth. Triggers on "three.js", "threejs", "WebGPU", "TSL", "NodeMaterial", "shader", "GLTF", "MeshStandard", "OrbitControls", "WebGLRenderer".

evalix098/tiktoklive

Grok Build only. Turn a 2D character still into denser animation sprites via imagine_text_to_image base → imagine_image_to_video (6s/10s run-in-place) → ffmpeg frames → magenta chroma-key → dense sampled strips/grids/GIFs. Use when the user wants video-to-sprite, smoother run/walk cycles, or denser intermediate poses. Prefer generate2dsprite for crisp production pixel sheets. Triggers on "video to sprite", "imagine_image_to_video sprite", "dense walk cycle", "smooth run animation from video".

evalix098/tiktoklive

Call the xAI API (Grok) from this app's server code using the injected XAI_API_KEY: chat/LLM features, image and video generation (Imagine), and voice (text-to-speech). Use when the app needs any "AI" / "assistant" / "chatbot" / "Grok" functionality, runtime image/video generation, or speech. Triggers on "AI", "LLM", "chatbot", "assistant", "Grok", "xAI", "generate text", "summarize", "generate image", "AI video", "voice", "text to speech", "TTS", "OpenAI" (use xAI instead).

相關技能