Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

image-gen

БесплатноБез исполняемых скриптовНе проверен

Generate real Instagram image ads with AI-generated visuals and text overlays. Combines TD Creative Studio image generation with headline compositing via…

treasure-dataот treasure-data★ 23 звезды на GitHub

Об этом скилле

Instagram Image Ad Generation

Generate real Instagram image ads with AI-generated visuals and composited headline text. Unlike the standard instagram-ad-ideation skill which produces HTML mockups with placeholder visuals, this skill produces actual PNG images ready for use.

How It Works

This skill chains three systems together:

Creative Ideation (concept + copy)
    ↓
TD Creative Studio Agent (AI image generation from concept description)
    ↓
Pillow Text Compositor (headline overlay on generated image)
    ↓
Treasure Studio (display final PNG in artifact panel)

Key difference from standard Instagram skill: The Image Concept description and Primary Text become the image generation prompt. The Headline becomes the text overlay composited onto the final image.


Output Format

Phase 1: Text Concept Format (Initial Generation)

Generate 3-5 Instagram image ad concepts in this text-only format:

### Concept: [Concept Name]
**Creative Direction**: Following the "[Selected Direction Name]" approach

#### Ad Copy
- **Primary Text**: [125 chars max] ([X] chars)
- **Headline**: [40 chars max] ([X] chars) — THIS WILL BE OVERLAID ON THE IMAGE
- **Description**: [30 chars max] ([X] chars)
- **CTA Button**: [Instagram CTA option]

#### Image Generation Prompt
[Combine the visual concept description with the primary text theme into a rich,
detailed prompt for AI image generation. **If Description text is provided, incorporate
it into the prompt context.** Include composition, lighting, color palette, mood, style,
and any specific visual elements. This is what gets sent to the TD Creative Studio
Image Generation Agent.]

- **Dimensions**: 1024x1024 (will be generated at this size)
- **Style**: [Photorealistic, illustration, flat design, etc.]
- **Mood/Tone**: [Energetic, calm, luxurious, urgent, etc.]
- **Key Visual Elements**: [Specific objects, scenes, or compositions to include]
- **Negative Prompt**: [Elements to exclude from generation]

#### Headline Overlay Style
- **Font**: [Serif/Sans-serif — maps to system font]
- **Size**: [48-96px based on text length]
- **Color**: [Hex code for text color]
- **Position**: [Bottom (default), Center, Top]
- **Text Padding**: [Pixels from edge — 60px (bottom/center), 200px (top to avoid logo)]
- **Gradient**: [Subtle/Medium/Heavy — backdrop gradient for readability]

#### Logo Overlay (if provided)
- **Logo File**: [Path to logo PNG, if brand guidelines include logo]
- **Position**: [top-right/top-left/bottom-right/bottom-left/center]
- **Size**: [80-120px width, maintains aspect ratio]
- **Padding**: [Pixels from edge, typically 40px]
- **Note**: Logo will be composited onto the AI-generated image before headline text overlay

*Image will be generated and composited after you confirm this concept.*

Phase 2: Image Generation + Compositing (After Confirmation)

ONLY generate images AFTER user confirms text concepts. Trigger phrases:

  • "Generate that image"
  • "Let's see concept [X]"
  • "Create the image for concept [X]"
  • "Show me what that looks like"
  • "Generate all of them"

When triggered, execute the full pipeline for each confirmed concept.


Execution Pipeline

Step 1: Set Project Context

tdx use llm_project "TD-Managed: Creative Studio"

Step 2: Generate the Base Image

Send the Image Generation Prompt from the confirmed concept to the TD agent:

tdx chat --stream \
  --new \
  --agent "TD-Managed: Creative Studio/TD-Managed: Image Generation Agent" \
  "<Image Generation Prompt from confirmed concept>"

Important tool selection: Use tdx chat --stream via Bash for this step. The mcp__tdx-studio__tdx_chat tool strips binary image data, which breaks the image extraction process. Include the --new flag to start a fresh chat, ensuring the history contains only one image for clean extraction.

Parse the chatId from the metadata event in the stream output:

{"type":"metadata","data":{"chatId":"<CHAT_ID>"}}

Step 3: Extract Image from Chat History

tdx llm history "<CHAT_ID>"

This output is large (2-3MB+) and will be persisted to a tool-results file. Extract the image binary:

import re, base64

with open("<persisted_output_file>", "r") as f:
    content = f.read()

matches = list(re.finditer(r'"binaryBase64":"([A-Za-z0-9+/=]+)"', content))
if matches:
    b64_data = matches[-1].group(1)  # Last match = most recent image
    img_bytes = base64.b64decode(b64_data)
    with open("<concept_name>_base.png", "wb") as out:
        out.write(img_bytes)

Step 3.5: Logo Overlay (Optional)

When to use: If brand guidelines include a logo file, composite it onto the AI-generated image before adding text overlays.

Logo overlay workflow:

  1. User provides logo path: "Generate Instagram ad with logo at /path/to/logo.png"
  2. Load and resize logo maintaining aspect ratio
  3. Calculate position based on bra
Полный SKILL.md на GitHub

Установить image-gen в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл image-gen?

Generate real Instagram image ads with AI-generated visuals and text overlays. Combines TD Creative Studio image generation with headline compositing via Pillow. Use when user wants to create Instagram ad images, generate ad visuals with text, or produce shareable ad PNGs. Trigger keywords: instagram ad image, generate ad image, image ad with text, ad visual, create instagram ad.

Как установить скилл image-gen?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл image-gen запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить image-gen с