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 是什么?

evalix098/tiktoklive 是 Grok Build 中 Imagine 计算机栈的完整技能文档,专为 AI 代理(如 Claude Code、Cursor、Codex)设计,用于在开发工作流中处理图像与视频的生成与编辑。该技能明确分离了七种工具:`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`(在聊天中展示媒体)。所有工具均基于沙盒路径操作,返回 `file_path` 供后续使用。技能提供了强制性的心智模型流程:生成 → file_path → render_file(展示)或 read_file(质量控制)。 该技能的核心价值在于,当输出需要精确文本、数字、数据或结构时,指导代理使用代码(HTML/CSS 优先)而非图像模型构建资产,因为图像模型在处理精确内容时不可靠。技能强调离散准确性验证循环:生成 → 检查(使用 read_file)→ 修复 → 重新验证,直至内容完全正确。核心原则还包括:代理拥有提示词控制权、对真人采用参考优先(使用 `imagine_image_to_image` 配合真实参考路径)、通过搜索进行事实核查、为保持一致性复用基础资产、优雅处理失败、规划多步骤工作流并最终审查。技能还提供了详细的工具选择表、prompt 撰写顺序(主体→动作/姿势→场景→风格→构图→光照/氛围→关键细节),以及针对真人和视频剪辑的专项指南(推荐 6 秒短片段,用 FFmpeg 组装)。

兼容平台~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)不属于此栈。

在您考虑或即将调用这些工具中的任何一个时,请应用此规则。

处理流程(强制性心智模型)

generate → file_path → render_file(向用户展示)/ read_file 或脚本(质量控制)
edit / animate → 将先前的 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: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 / 分辨率字段。

推荐使用简短镜头;提示词撰写规则与下面的 image_to_video 相同。

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 流复制处理返回的视频路径,组合多镜头时间线。

imagine_reference_to_video

根据一张或多张参考图像路径,由提示词引导生成视频。当目标是获得一个清晰的起始帧时,推荐先用 imagine_reference_to_image 合成一张静态图,然后使用 imagine_image_to_video。

编写强提示词

大致按此顺序描述:主体 -> 动作/姿势 -> 场景 -> 风格 -> 构图 -> 光线/氛围 -> 关键细节。

  • 具体而实在;以最重要的元素开头。
  • 说明要包含的内容,而非排除的内容。
  • 每个提示词只描述一个连贯的场景。
  • 根据用例匹配 aspect_ratio:手机/故事使用 9:16,横幅/视频帧或 OG 分享卡片使用 16:9,头像/图标使用 1:1。

真人及参考图

  1. 首先搜索网络以确认身份、角色、关系或事件,即使看起来很明显。
  2. 在磁盘上获取一张高质量的参考图像(用户上传或搜索后放入沙盒路径),然后使用该路径调用 imagine_image_to_image。用户上传的照片最佳。
  3. 如果没有合适的参考图,请要求用户上传一张,而不是从薄弱的基础生成。

展示结果

  • 使用 render_file 传入沙盒 file_path,以便用户在聊天中看到图像/视频。
  • 对于您自己的质量控制和脚本,请使用 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).

相关技能