К основному содержанию
скилл CX Codex

scenario-text-overlay — скилл для Claude Code: что делает

Рендерит точный текст и плашки в PNG через Mustache-шаблоны для наложения на графику и видео в Scenario.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add scenario-labs/skills --skill scenario-text-overlay -a claude-code
Открыть на GitHub

Что делает scenario-text-overlay

Модели генерации картинок часто искажают буквы. Этот скилл решает проблему детерминированным рендерингом: агент готовит JSON-манифест с переменными Mustache, а скрипт scripts/overlay.py собирает прозрачный PNG. Поддерживаются обычные текстовые блоки и вёрстка на HTML/CSS со стилями, градиентами или тенями.

Под капотом скрипт задействует движок Chromium для сложных макетов либо библиотеку Pillow как запасной вариант для простого текста. Для работы скрипта требуется установить зависимости командой pip install chevron pillow. Если переменная в шаблоне пропущена, сборка сразу завершается ошибкой.

Финальное сведение слоёв выполняется не локально, а на платформе Scenario через вызов моделей model_scenario-compose-image или model_scenario-compose-video. Сводить слои вручную через Pillow или ffmpeg бессмысленно: готовый креатив должен оставаться на платформе рядом со своими слоями и шаблоном.

Какие задачи решает

  • наложить титры и дисклеймеры на сгенерированное видео
  • отрендерить плашку с ценой или CTA без искажения букв
  • создать прозрачный PNG с HTML-вёрсткой и тенями по шаблону
  • подставить локализованные надписи через переменные Mustache

Примеры запросов агенту

  • Собери JSON-шаблон для плашки с дисклеймером и отрендери PNG через overlay.py
  • Подготовь карточку с ценой и наложи её поверх промо-видео в Scenario
  • Сделай оверлей с кнопкой CTA для баннера с холстом 1080x1920

Как установить scenario-text-overlay

1Через Skills CLI (Vercel)

npx skills add scenario-labs/skills --skill scenario-text-overlay -a claude-code

2Вручную: положить файлы

~/.claude/skills/scenario-text-overlay/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/scenario-text-overlay/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о scenario-text-overlay

Как установить scenario-text-overlay в Claude Code?

Выполните в терминале команду npx skills add scenario-labs/skills --skill scenario-text-overlay -a claude-code.

Что делает scenario-text-overlay?

Скилл генерирует надписи, титры и плашки в виде прозрачных PNG по строгим шаблонам. Готовый слой затем передаётся в Scenario для наложения поверх сгенерированного видео или изображения.

Какие зависимости нужны для рендеринга оверлеев?

Скрипту требуются установленные пакеты pip install chevron pillow. Для отрисовки сложных HTML-слоёв со стилями также необходим браузер семейства Chromium.

Исходный текст

SKILL.md · MIT
---
name: scenario-text-overlay
description: "Use when text must appear letter-perfect on generated media: taglines, CTAs, prices, legal supers, lower thirds, end cards, nameplates, or styled rich cards composited over Scenario images and video. Keywords: text overlay, text card, caption card, CTA, legal super, tagline, end card, lower third, price card, HUD text, transparent PNG."
license: MIT
---

# Scenario Text Overlay

## Overview

Generation models drift on type, so text that must be exact is rendered deterministically here and
composited over the media. One JSON payload describes one overlay, in one of two kinds: a text layer
(plain styled text in a box) or a rich layer (HTML/CSS typography: gradients, strokes, shadows, card
layouts). Both substitute Mustache `{{variables}}` strictly (a missing variable fails the render) on
a transparent canvas.

[scripts/overlay.py](scripts/overlay.py) renders the payload to a PNG with an installed
Chromium-family browser (both kinds, discovered automatically) or a Pillow fallback (text layers
only), embeds the payload JSON into the PNG, and prints the path. Its modules:
[scripts/templating.py](scripts/templating.py) (strict Mustache),
[scripts/html_render.py](scripts/html_render.py) (browser engine),
[scripts/pillow_render.py](scripts/pillow_render.py) (fallback). The field-by-field contract and
example payloads live in [references/payloads.md](references/payloads.md). The script needs
`pip install chevron pillow`.

Connection and the core MCP loop: see the `scenario` skill. The overlay meets its content on the
platform, never locally: `model_run` on the compose tool models, `model_scenario-compose-image` for
stills and `model_scenario-compose-video` for video (fixed ids: each is Scenario's single
deterministic compositor for its medium, so discovery would only re-derive them), whose layer
contract lives in `scenario-video-assembly`. If a sibling skill named here is missing from your
available skills, ask the user to install it (`npx skills add scenario-labs/skills --skill <name>`);
unattended, proceed from tool schemas and flag the gap.

## Quick reference

| Step                    | Detail                                                                                               |
| ----------------------- | ---------------------------------------------------------------------------------------------------- |
| 1. Write the payload    | Kind by field (`text_template` or `html_template`); every changeable string in `variables`           |
| 2. Render               | `python3 overlay.py --payload card.json --out card.png`                                              |
| 3. Verify               | Open the PNG: glyphs verbatim, box placement right, background transparent                           |
| 4. Upload               | `upload_asset` (kind `image`, multipart path)                                                        |
| 5. Persist the template | `asset_update` sets `metadata.description` to the payload JSON; `asset_add_tags` adds `text-overlay` |
| 6. Composite            | `model_run` on `model_scenario-compose-image` or `model_scenario-compose-video`, overlay on top      |

## Choose the face for its meaning

The face is part of the message: heavy condensed sans shouts (hooks, prices, CTAs), light geometric
or grotesque sans reads neutral and premium (legal supers, lower thirds, nameplates), serif signals
editorial or heritage weight, rounded forms read friendly and casual. Match the media's art
direction rather than fighting it, keep one family per card, and build hierarchy with `font_weight`
(100 to 900) and size instead of mixing faces. `font_family` reaches any Google Fonts family, so
every class above is available by name; a contractual brand face rides `font_url` instead. Meaning
survives only above legibility, so judge the flattened preview at destination size, where a subtle
face turns generic.

## Worked example: a localized legal super

1. Payload, with the changeable line as a variable:

```json
{
  "text_template": "{{disclaimer}}",
  "variables": [
    {
      "key": "disclaimer",
      "value": "EPA-estimated 310 mi. Actual range varies."
    }
  ],
  "font_family": "Inter",
  "font_weight": 500,
  "size": 34,
  "color": "#FFFFFF",
  "align": "center",
  "bbox": [{ "x": 86, "y": 1560, "w": 908, "h": 120 }],
  "canvas_width": 1080,
  "canvas_height": 1920,
  "overflow": "shrink"
}
```

2. `python3 overlay.py --payload super.json --out super.png`, then open `super.png`: the line must
   read exactly as written, shrunk to fit the box.
3. Upload with `upload_asset`, then `asset_update` with the payload JSON as `metadata.description`
   and `asset_add_tags` with `["text-overlay"]` (`asset_update`'s own `metadata.tags` replaces the
   whole set): the template now lives on the platform beside its render, and the PNG itself carries
   it in a `tEXt` chunk.
4. Composite over the spot: `model_schema_get` on `model_scenario-compose-video`, then `model_run`
   with the base video at `zIndex` 0 and the super as an image layer above it (layer fields:
   `scenario-video-assembly`); `jobs_wait`, then `asset_display`.
5. The French variant is the same payload with one `value` edited, never a new template.

## Common mistakes

- Baking changeable strings into the template: variants and localizations should be edits to
  `variables`; the uploaded payload is the reproducibility contract.
- Using `{{var}}` for values holding `&`, `<`, or `>`: it HTML-escapes, so they render as literal
  entity text; `{{{var}}}` is the raw opt-out (full Mustache rules: the payload reference).
- Leaving images or fonts as remote URLs: inline them as `data:` URIs (Google Fonts links excepted)
  or the render depends on the network and drifts.
- Skipping the visual check before upload: font resolution differs per machine, and light text on
  the transparent canvas previews as blank; flatten over a contrasting backdrop first.
- Letting a generation model paint the text instead: generated type drifts frame to frame; overlays
  exist to avoid exactly that.
- Generating the plate with no room for the card: brief the base image or video with the overlay's
  zone kept plain and text-free (a dark right third, an empty top band) for every frame the card is
  up, so the composite lands on quiet pixels rather than generated lettering or detail.
- Merging the overlay locally with Pillow or ffmpeg: compositing is a `model_run` on the compose
  models, so the finished creative lands on the platform beside its layers.
- Sizing the canvas to something other than the destination: match the target resolution so the
  overlay composites 1:1 with no post-scale blur. Content layers may scale inside the compose run
  when a generation model cannot hit the exact size; the overlay must not.
- Expecting the fallback to match the browser: Pillow draws plain text only; rich layers need a
  Chromium-family browser installed.
- Trusting `wrap` with a hard box: it lets text spill below; use `shrink` (fits or fails loudly) or
  `clip` when the box is binding.

© scenario-labs · MIT · scenario-labs/skills

Похожие скиллы

Всё по теме «Дизайн» →
pixijs-scene-text pixijs Скилл учит нейросеть работать с текстом в PixiJS v8. Он помогает выбрать подходящий класс рендеринга и не тратить ресурсы на перерисовку канваса каждый кадр. CX Codex +1 5 800установок moviepy digitalsamba Скилл для сборки видео на Python: накладывает читаемый текст на ролики LTX-2 и SadTalker, склеивает клипы в одном build.py. CX Codex +1 1 000установок chat-motion-overlay nexu-io Создаёт анимированные сцены переписки из текста или скриншота и готовит их для рендера в Remotion. Нужен для роликов с пузырями сообщений и прозрачных наложений. CX Codex +1 829установок infographics K-Dense-AI Собирает инфографику из ваших данных или после быстрого поиска в Perplexity Sonar, а потом сам проверяет картинку по порогу качества. Пригодится, когда нужен PNG для отчёта или презентации. CX Codex +1 2 000установок llm-icon-finder daymade Скилл находит ссылки на иконки AI-моделей и провайдеров из библиотеки lobe-icons и помогает скачать их в SVG, PNG или WEBP. CX Codex +1 952установок codex-gpt-image-2-5-flare MengTo Скилл для генерации и правки графики встроенным инструментом Codex: прозрачные PNG, спрайты, эмблемы и элементы интерфейса. CX Codex +1 475установок

Из того же набора68

scenario-rodin Скилл для генерации 3D-ассетов моделями Rodin Hyper3D на Scenario через MCP. Пригодится, когда нужны персонажи или объекты из картинок либо текстового промпта. CX Codex +1 422установок scenario-3d-worlds Скилл для генерации проходимых 3D-миров и гауссовых сплатов на Scenario через MCP: из текста, картинки, панорамы или видео. CX Codex +1 418установок scenario-sparc3d Превращает одну-четыре фотографии в watertight-меш через модели Sparc3D на Scenario. Пригодится для игровых ассетов, AR/VR и 3D-печати. CX Codex +1 414установок scenario-report Помогает превратить сбой генерации или ошибку MCP-инструмента в воспроизводимый отчёт и отправить его в трекер Scenario. CX Codex +1 413установок scenario-gemini-image Управляет генерацией и редактированием картинок через модели Google Gemini на Scenario по протоколу MCP. CX Codex +1 392установок scenario-gpt-image Скилл учит агента работать с моделями GPT Image на Scenario через MCP: генерация, правки по референсу, инпейнтинг по альфа-маске и прозрачные вырезы. CX Codex +1 402установок scenario-blender-lighting-rendering Скилл для ИИ-агента, который разбирается со светом, рендером и композитингом в Blender: от трёхточечной схемы до цветокоррекции AgX. CX Codex +1 400установок scenario-seedance Направляет генерацию и монтаж видео через модели Seedance от ByteDance в Scenario по протоколу MCP. Помогает задать первый и последний кадры, перенести персонажа или продлить ролик. CX Codex +1 387установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой