sn-image-imitate
它能做什么
这项技能生成一张与参考图风格相同、但内容由你描述的新图片。适合喜欢某种风格、并希望把它用于新内容的人。
适用场景
- ✓当你有一张参考图,并想把它的风格用于新场景时。
- ✓当你想保留图片的构图和氛围,但改变其中展示的内容时。
- ✓当你想把一张图片的风格复制到新生成的图片中的时候。
技能链接
https://github.com/OpenSenseNova/SenseNova-Skills/blob/main/skills/sn-image-imitate/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请参照这张照片的风格和配色,画一张夜晚咖啡店的新图片。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体详细描述参考图,然后把这段描述改写为你的新内容,同时保持风格和构图。接着它生成新图片,并检查其构图。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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 sn-image-base (tier 0).
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 imagetarget_content(string, required): new content user wants in the generated imageoutput_mode(string, defaultfriendly): output mode,friendlyorverboseaspect_ratio(string, default16:9): output aspect ratio for generationimage_size(string, default2k): output image size presetmax_attempts(int, default3): maximum generation attempts for meeting layout consistencylayout_threshold(float, default0.75): minimum layout similarity score to accept result
Environment Variable
Dependency installation and API key configuration are for sn-image-base skill.
The minimum environment variables to configure sn-image-base skill running with SenseNova Token Plan:
SN_BASE_URL="https://token.sensenova.cn/v1"
SN_API_KEY="your-api-key"
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
Workflow
Main Agent Workflow
- Extract
reference_image,target_content,output_mode(defaultfriendly),aspect_ratio(default16:9),image_size(default2k),max_attempts(default3), andlayout_threshold(default0.75) - Validate required inputs:
reference_imageis provided and resolvabletarget_contentis non-empty
- 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- `sta
常见问题
它会逐像素复制参考图吗?
不会。它的目标是风格和构图相符,而不是完全复制。
它能处理视频吗?
不能。它只适用于单张静态图片。
它能只修改图片的某一部分吗?
不能。它会生成新图片,而不是编辑参考图的某个区域。
详情
作者的原始描述
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".
热度
- GitHub 星标
- 6.0k
- 排名
- #14461
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
sn-code-video
6.0k教你的智能体使用 Canvas、SVG、Three.js 或 Remotion 制作代码驱动的视频,逐帧检查并导出为 MP4。
sn-image-base
6.0k为其他技能提供底层工具,使用 SenseNova 服务生成图片、识别图片内容并优化文字。
sn-image-doctor
6.0k检查 SenseNova-Skills 是否已安装、Python 包是否齐全、所需 API 密钥是否配置,并把缺失的密钥保存到文件。
sn-image-resume
6.0k帮你的智能体把简历文字转换为设计感强的作品集风格简历图片,并可选择风格。