Download skills/sn-image-imitate/SKILL.md from the publisher, or copy the path and open the repository. PlugMCP lists the skill and does not host the file.
Where does sn-image-imitate live?
The publisher keeps it at https://github.com/OpenSenseNova/SenseNova-Skills.
Which agents can use sn-image-imitate?
Claude, Cursor, and Codex can read a SKILL.md you add from the publisher's repository.
|
name: sn-image-imitate
description: |
Generates 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".
metadata:
project: SenseNova-Skills
tier: 1
category: scene
priority: 8
user_visible: true
triggers:
"style imitation"
"style transfer"
"imitate this image style"
"use this style with new content"
"reference style image"
"风格模仿"
"风格迁移"
"模仿这张图风格"
"按参考图风格生成"
sn-image-imitate
Image style imitation scene skill (tier 1), relying on the sn-image-recognize, sn-text-optimize, and sn-image-generate tools provided by (tier 0).
sn-image-base
Features:
Extracts high-fidelity long caption from a reference image
Rewrites caption according to user requested content change while preserving style and layout
Enforces layout-lock constraints during caption rewrite
Performs post-generation layout consistency review and bounded retries
Returns structured process artifacts for debugging and reproducibility
Non-goals
Pure neural style transfer without content change (use dedicated style-transfer tools instead)
Local editing / inpainting of specific regions within the reference image
Processing video or animation input (only single static images are supported)
Batch generation from multiple reference images in one invocation
Guaranteeing pixel-level fidelity to the reference; the skill targets layout and style consistency, not exact reproduction
Input Specification
reference_image (string, required): local path or URL of the style reference image
target_content (string, required): new content user wants in the generated image
output_mode (string, default friendly): output mode, friendly or verbose
aspect_ratio (string, default 16:9): output aspect ratio for generation
Fallback priority is dedicated variable > domain shared variable > global variable. Text calls use SN_TEXT_API_KEY -> SN_CHAT_API_KEY -> SN_API_KEY; vision calls use SN_VISION_API_KEY -> SN_CHAT_API_KEY -> SN_API_KEY; image generation uses SN_IMAGE_GEN_API_KEY -> SN_API_KEY.
Please refer to the Python dependencies and API keys section in sn-image-generate_en.md for more configurations.
API Configuration
All API calls in this skill are executed through the sn_agent_runner.py of the sn-image-base skill,
please refer to the sn-image-base skill (README.md) for more details.
VLM call: sn-image-recognize (Step 1 & 3)
LLM call: sn-text-optimize (Step 2)
Image generation call: sn-image-generate (Step 3)
When encountering MissingApiKeyError or needing explicit model control: pass model and auth params explicitly via CLI arguments. See $SN_IMAGE_BASE/references/api_spec.md.
$SN_IMAGE_BASE path explanation: $SN_IMAGE_BASE is the installation directory of the sn-image-base skill (SKILL.md exists). The agent can locate this path by skill name sn-image-base.
Architecture: Main Agent + Worker Agent
This skill uses a two-tier agent architecture:
Main Agent: receives user request, normalizes parameters, sends preflight, invokes Worker Agent, and sends final text/image to user
Worker Agent: executes fixed 3-step pipeline and returns structured JSON
Responsibility Boundaries:
Worker Agent does not send any user-visible message directly
Main Agent sends all user-facing responses
Worker Agent last message must be and only be the JSON string defined in Return Contract
Worker Agent executes VLM/LLM/image calls directly; no nested subagent for these low-level calls
Send preflight message: "Using sn-image-imitate skill to generate a style-consistent image, please wait..."
Start Worker Agent with full normalized parameters and working directory
On Worker result:
status=ok: send final summary and generated image
status=error: report the actual error
Worker Agent Workflow
Worker Agent receives reference_image, target_content, output_mode, aspect_ratio, image_size, max_attempts, layout_threshold, and the working directory of this skill ($SKILL_DIR).
Error Handling Strategy:
All sn_agent_runner.py calls share the same error handling rules:
If the subprocess exits with non-zero code, crashes, or times out: do not fallback, return status=error with the actual error message from stderr or the system error string
If the subprocess returns invalid JSON or the JSON lacks an expected result field: return status=error, do not silently continue with empty or default values
If the VLM review call fails during Step 3, treat the attempt as incomplete: do not record a score, and either retry the review once or skip to the next attempt depending on remaining budget
Step 0 — Initialization
Generate task_id with format YYYYMMDD_HHMMSS
Create temp directory: /tmp/openclaw/sn-image-imitate/<task_id>/ as TEMP_DIR
major region bounding boxes and topological relations from blueprint
Preferred system prompt: prompts/caption_rewrite.md (recommended to add).
If missing, use inline fallback system prompt:
Rewrite the long caption by preserving style and layout constraints while replacing semantic content according to user target. Do not change block topology, reading order, or visual hierarchy. Keep the caption detailed and directly usable for image generation.
Call sn-text-optimize:
python "$SN_IMAGE_BASE/scripts/sn_agent_runner.py" sn-text-optimize \
--system-prompt-path "$SKILL_DIR/prompts/caption_rewrite.md" \
--user-prompt "Reference long caption:\n$LONG_CAPTION\n\nLayout blueprint JSON:\n$LAYOUT_BLUEPRINT_JSON\n\nTarget content:\n$TARGET_CONTENT\n\nReturn only the rewritten long caption." \
--output-format json
Parse JSON result as NEW_LONG_CAPTION. If empty, return status=error.
Note: elapsed_seconds is read from the --output-format json return of each CLI call; image_generation.model is fixed to the hardcoded placeholder "sn_image_model" (sn-image-generate does not return the model field); vlm_review.model is read from the JSON return of sn-image-recognize. timing.vlm_review is omitted when max_attempts=1.
Early Termination Check (only executed when max_attempts > 1):
Pass criteria:
layout_similarity_score >= layout_threshold
pass = true
If pass: immediately exit the loop, do not continue generating
If fail and attempts remain, append correction hints to prompt:
../sn-image-base/SKILL.md - Base tool behavior and parameter defaults
How do I install sn-image-imitate?
Download skills/sn-image-imitate/SKILL.md from the publisher, or copy the path and open the repository. PlugMCP lists the skill and does not host the file.
Where does sn-image-imitate live?
The publisher keeps it at https://github.com/OpenSenseNova/SenseNova-Skills.
Which agents can use sn-image-imitate?
Claude, Cursor, and Codex can read a SKILL.md you add from the publisher's repository.