Grid Generate logo

Grid Generate

Community
JianhuiWei7
grid-generate

【视频网格图生成工具】把一个视频按时间间隔或按镜头边界抽帧,拼成一张带序号+时间戳标注的网格总览图 (grid_overview.jpg),便于一次性喂给多模态模型做全片理解、视觉一致性、物理异常等评测。当用户要求生成视频全片概览图/总览拼图/shot 网格图/grid overview/拼帧图,或要给 LLM 一张代表整段视频的图片时,必须立即调用此技能。

Overview

PublisherJianhuiWei7
RepositoryVideoWeaver
Skill namegrid-generate
Stars
48
Forks
1
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by JianhuiWei7 on GitHub. Read the source before you install it.

Installation

Install the Grid Generate AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/JianhuiWei7/VideoWeaver/tree/main/skills/grid-generate
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/JianhuiWei7/VideoWeaver.git /tmp/VideoWeaver
mkdir -p .claude/skills
cp -r /tmp/VideoWeaver/skills/grid-generate .claude/skills/grid-generate
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Grid Generate in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Grid Generate on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Grid Generate is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

视频网格图生成 (grid-generate)

把一段视频抽帧拼成 cols × rows 网格图,每格左上角标 [序号]、左下角标 mm:ss 时间戳,同时输出 sidecar JSON 索引,下游(O3/O4/O6/overview)直接读 JSON 而不用反查时间戳。

前置依赖

bash
pip install opencv-python pillow scenedetect

两种模式

1. by-time (默认) — 等间隔抽帧

按固定时间间隔 (默认 2s) 抽帧,适合做全片概览 (cache/grid_overview.jpg)。

2. by-shot — 按镜头边界抽帧

内部调 PySceneDetect 切镜头,每镜头取一帧 (first/middle/last),适合做跨镜头视觉一致性 (cache/shot_grid.jpg)。也可以传入已经算好的 --shots-json 跳过检测。

标注

每个格子:

  • 左上角 [1] [2] …(黑底白字,LLM 引用"第 7 格"时不会错位)
  • 左下角 00:08 或 shot_03 00:08(by-shot 模式带 shot_id)

参数

参数默认说明
--video_path必填输入视频绝对路径
--modeby-timeby-time 或 by-shot
--interval2.0(by-time) 抽帧间隔 (秒)
--framefirst(by-shot) 每 shot 取哪一帧: first / middle / last
--shots_json无(by-shot) 跳过检测,直接读 [{shot_id,start,end},...]
--cols6列数 (行数自动算)
--cell_width384每格像素宽 (高度按视频宽高比自动算)
--padding4格子间距像素
--max_cells60总格数上限; 超过后均匀降采样
--time_range无限定区间 "00:10-00:50" 或 "10-50" 秒
--no_labelflag关闭标注
--quality92JPEG 质量
--session-key可选输出目录 session-key。CodeX/Claude Code 环境会自动识别,不需要传入session-key;OpenClaw 环境必须运行 session_status 获取session-key并且传入, 格式通常为 agent:{agent_id}:{session_id}。

输出

<session_out>/images/{video_name}_grid_overview.jpg      # by-time 网格 JPG
<session_out>/images/{video_name}_shot_grid.jpg          # by-shot 网格 JPG
同名 `.jpg.json` 文件                                      # sidecar 索引

sidecar schema:

json
{
  "video_path": "...",
  "mode": "by-time",
  "cols": 6,
  "rows": 5,
  "cell_width": 384,
  "cell_height": 216,
  "total_cells": 30,
  "cells": [
    {"idx": 1, "t_sec": 0.0,  "t_label": "00:00", "shot_id": null, "frame_idx": 0},
    {"idx": 2, "t_sec": 2.0,  "t_label": "00:02", "shot_id": null, "frame_idx": 48},
    ...
  ]
}

使用示例

全片概览图 (Step 2 用)

bash
python scripts/grid_generate.py \
  --video_path /path/to/final.mp4 \
  --mode by-time --interval 2 --cols 6

镜头网格图 (O4 用)

bash
python scripts/grid_generate.py \
  --video_path /path/to/final.mp4 \
  --mode by-shot --frame first --cols 6

已有 shots.json 时跳过检测

bash
python scripts/grid_generate.py \
  --video_path /path/to/final.mp4 \
  --mode by-shot --shots_json /path/to/cache/shots.json --frame middle

OpenClaw 环境

bash
python scripts/grid_generate.py \
  --video_path /path/to/final.mp4 \
  --mode by-time --interval 2 \
  --session-key "agent:{agent_id}:{session_id}"

只看片段

bash
python scripts/grid_generate.py \
  --video_path /path/to/final.mp4 \
  --mode by-time --interval 1 --time_range "00:20-00:40"

设计原则

  • 序号 + 时间戳双标注: LLM 引用某格时,既能说"第 7 格"也能说"00:08 那一段",降低指代歧义。
  • sidecar JSON 必出: 下游不用再从图片里 OCR 时间戳。
  • 格数封顶: --max_cells 防超长视频拼出几百格的图,LLM 喂不下。
  • 幂等: 给定相同输入 + 输出路径,产物可重复。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Grid Generate AI skill do?

【视频网格图生成工具】把一个视频按时间间隔或按镜头边界抽帧,拼成一张带序号+时间戳标注的网格总览图 (grid_overview.jpg),便于一次性喂给多模态模型做全片理解、视觉一致性、物理异常等评测。当用户要求生成视频全片概览图/总览拼图/shot 网格图/grid overview/拼帧图,或要给 LLM 一张代表整段视频的图片时,必须立即调用此技能。

Why use Grid Generate on TypingMind?

Because you install it once and use it with any model. Grid Generate is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Grid Generate in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/JianhuiWei7/VideoWeaver/tree/main/skills/grid-generate. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Grid Generate?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Grid Generate?

As many as you like. As long as a model supports skills, you can use Grid Generate with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Grid Generate AI skill free?

It is published on GitHub by JianhuiWei7. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇