OpenSenseNova/SenseNova-Skills / skills/sn-image-imitate
sn-image-imitate
VerifiedGenerates a new image that imitates the style of a reference image while updating content based on user intent. Uses a three-stage pipeline: image annotation (long caption), caption rewriting, and image generation. Use when user asks to "imitate style", "保持这个风格重画", "按这张图风格生成", or "style transfer with new content".
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 5.7 KB |
| README_CN.md | markdown | 5.2 KB |
| SKILL.md | skill md | 15.1 KB |
| prompts/caption_rewrite.md | markdown | 1.2 KB |
| prompts/image_annotate.md | markdown | 3.3 KB |
| prompts/layout_review.md | markdown | 1.2 KB |
README.md
View on GitHub# SN Image Style Imitation Skill
English | [简体中文](README_CN.md)
This document introduces the `sn-image-imitate` skill and provides a Quick Start for using it end-to-end in OpenClaw / Hermes.
## Prerequisites
- **Python** 3.9 or later (3.10+ recommended).
- **SN API** credentials for image generation and LLM/VLM endpoints (`SN_API_KEY` and `SN_BASE_URL` are enough when all capabilities use one gateway; see Quick Start).
- `sn-image-base` skill installed (as a base dependency).
## Skill Overview
### sn-image-imitate (Tier 1)
Image style imitation scene skill, built on top of `sn-image-base`. See [`skills/sn-image-imitate/SKILL.md`](../sn-image-imitate/SKILL.md) for full behavior.
Given a reference image and a target content description, the skill:
1. **Image Annotation** — Uses VLM to extract a long caption and layout blueprint from the reference image
2. **Caption Rewrite** — Rewrites the caption to replace content with the user-specified target while preserving style and layout
3. **Generation & Review** — Generates a new image from the rewritten caption, reviews layout consistency via VLM, and retries with corrective hints when the threshold is not met
### Non-goals
- Pure style transfer without content change — use dedicated style-transfer tools instead
- Local editing / inpainting
- Video or animation input
- Batch generation from multiple reference images
- Pixel-level fidelity to the reference
### Dependency Graph
```
sn-image-base (Tier 0)
├── sn-image-recognize → VLM calls (image annotation + layout review)
├── sn-text-optimize → LLM calls (caption rewrite)
└── sn-image-generate → Image generation
```
## Quick Start
### 1. Register the skill
Make sure `sn-image-base` is already registered (see the registration steps in [`sn-image-generate_en.md`](../../docs/sn-image-generate_en.md)), then register `sn-image-imitate` with OpenClaw or Hermes:
| Approach | What to do |
|----------|------------|
| **Shared on this machine** | Copy or symlink `skills/sn-image-imitate` to `~/.openclaw/skills/` (OpenClaw) or `~/.hermes/skills/openclaw-imports/` (Hermes). |
| **Workspace `skills/`** | Copy or symlink `skills/sn-image-imitate` into your agent workspace. |
| **`openclaw.json`** | If you have already pointed `skills.load.extraDirs` to this repo's `skills` directory, no additional action is needed. |
### 2. Python dependencies and API keys
Dependency installation and API key configuration are for [sn-image-base](../sn-image-base/SKILL.md) skill.
The minimum environment variables to configure `sn-image-base` skill running with [SenseNova Token Plan](https://platform.sensenova.cn/token-plan):
```ini
SN_BASE_URL="https://token.sensenova.cn/v1"
SN_API_KEY="your-api-key"
```
Use capability-specific variables only when a provider differs from the shared gateway: `SN_TEXT_*`, `SN_VISION_*`, `SN_CHAT_*`, or `SN_IMAGE_GEN_*`.
Please refer to the **Python dependencies and API keys** section in [`sn-image-generate_en.md`](../../docs/sn-image-generate_en.md) for more configurations.
### 3. Invoke in agent
Describe the task in chat, for example:
> "Use the style of this image to create a poster about new energy vehicles"
Or call the skill by name:
> /skill sn-image-imitate "Reference image: /path/to/ref.png, Target content: new energy vehicle poster"
## Parameters
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `reference_image` | string | **Required** | Local path or URL of the reference image |
| `target_content` | string | **Required** | Description of the desired new content |
| `output_mode` | string | `friendly` | Output mode: `friendly` (concise) or `verbose` (detailed) |
| `aspect_ratio` | string | `16:9` | Aspect ratio of the generated image |
| `image_size` | string | `2k` | Size preset of the generated image |
| `max_attempts` | int | `3` | Maximum number of generation attempts |
| `layout_threshold` | float | `0.75` | Minimum layout similarity score to accept the result |
## Workflow Overview
```
User request → Main Agent
├── Parameter validation + preflight message
└── Launch Worker Agent
├── Step 0: Initialization (task_id, temp directory)
├── Step 1: VLM image annotation → short/long caption + layout blueprint
├── Step 2: LLM caption rewrite (preserve style & layout, replace content)
└── Step 3: Generation + review loop
├── Generate candidate image
├── VLM layout consistency review (only when max_attempts > 1)
├── Pass threshold → early termination
└── Fail → append corrective hints, continue to next attempt
```
## Output Modes
### friendly mode (default)
A concise description + the final generated image.
### verbose mode
A structured summary including:
1. Reference image short caption
2. Style and layout highlights
3. Rewritten long caption used for generation
4. Per-attempt similarity scores and major deviations
5. Timing summary
6. Final image
## FAQ
### Q: The generated image layout differs significantly from the reference. What should I do?
- Increase `max_attempts` to allow more retry rounds
- Lower `layout_threshold` to relax the acceptance criteria
- Ensure the reference image has clear visual structure and distinct regions
### Q: How to fix a missing API key error?
Run the `sn-image-doctor` skill to check environment configuration, or refer to the API key setup in [`sn-image-generate_en.md`](../../docs/sn-image-generate_en.md).
### Q: Can I change only the style without modifying content?
This skill is designed to preserve style while replacing content. If you only need style transfer without content change, use a dedicated style-transfer tool instead.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |