mcpField
S
style-transfer

style-transfer

github.com/eachlabs创意与媒体44385 次安装今天更新
代码仓库

关于 style-transfer

style-transfer 是基于 each::sense 的图像风格迁移技能,可将照片转换为绘画、插画或数字艺术效果,同时保留构图与主体。适合制作艺术化照片,并支持参考图和多种效果强度。

主要功能

  1. 01涵盖经典绘画与数字艺术风格
  2. 02使用参考图迁移视觉风格
  3. 03保留面部特征与原图构图
  4. 04生成不同强度的风格变体

适用场景

  1. 01将风景照片转为印象派绘画
  2. 02把人像转换为动漫或像素艺术
  3. 03依照指定作品风格处理照片

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/eachlabs/skills --skill style-transfer

安装后在 Claude Code 中输入/style-transfer确认已加载。

附带文件references/SSE-EVENTS.md

详细介绍

图像风格迁移

使用 each::sense 将任意照片转变为令人惊艳的艺术风格。这项技能会将著名画家的艺术手法、插画风格和数字艺术应用到图像中,同时保留原始构图和主体。

功能

  • 经典艺术风格:梵高、莫奈、毕加索、伦勃朗
  • 传统媒介:水彩、油画、铅笔素描、炭笔画
  • 数字艺术:动漫/漫画、像素艺术、波普艺术、漫画书风格
  • 自定义参考:使用任意参考图像作为风格来源
  • 保留选项:保留面部特征、构图和关键细节
  • 多种输出:生成不同强度的变体

快速开始

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this photo into Van Gogh Starry Night style with swirling brushstrokes and vibrant blues"}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/my-portrait.jpg"],
    "mode": "max"
  }'

风格类别

类别风格适用场景
印象派莫奈、雷诺阿、德加风景、花园、柔和的场景
后印象派梵高、塞尚肖像、富有表现力的场景
立体派毕加索、布拉克肖像、抽象演绎
传统风格水彩、油画、铅笔画任意主体,营造经典感
数字风格动漫、像素艺术、波普艺术现代、风格化的外观
自定义任意参考图像匹配特定美学风格

使用场景示例

1. 梵高《星月夜》风格

将照片转换为具有梵高标志性旋转笔触和富有表现力色彩的作品。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Apply Van Gogh Starry Night style to this cityscape photo. Use swirling, dynamic brushstrokes, deep blues and bright yellows, expressive post-impressionist technique. Make the sky dramatic with spiral patterns."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/cityscape.jpg"],
    "mode": "max"
  }'
2. 毕加索立体派风格

以毕加索开创性的立体派风格解构并重新演绎照片。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this portrait into Picasso cubist style. Fragment the face into geometric shapes, show multiple perspectives simultaneously, use muted earth tones with bold accents. Analytical cubism approach."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/portrait.jpg"],
    "mode": "max"
  }'
3. 莫奈印象派风格

将莫奈柔和、光影充盈的印象派技法应用于风景和场景。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Apply Claude Monet impressionist style to this garden photo. Soft dappled light, loose brushstrokes, focus on atmosphere and light rather than details. Like his Water Lilies series - dreamy and ethereal."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/garden.jpg"],
    "mode": "max"
  }'
4. 动漫/漫画风格迁移

将照片转换为日本动漫或漫画插画风格。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this photo into anime style. Large expressive eyes, clean line art, cel-shaded coloring, vibrant colors. Studio Ghibli inspired aesthetic with soft backgrounds and detailed character rendering."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/person-photo.jpg"],
    "mode": "max"
  }'
5. 水彩画风格

将照片转换为色彩流动、边缘柔和的精致水彩画。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Convert this landscape photo into a watercolor painting. Soft washes of color, visible paper texture, gentle color bleeds, transparent layers. Traditional watercolor technique with wet-on-wet effects."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/landscape.jpg"],
    "mode": "max"
  }'
6. 油画风格

运用浓郁且富有肌理感的油画技法,创作出媲美博物馆藏品的艺术作品。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this portrait into a classical oil painting. Rich impasto brushstrokes, dramatic chiaroscuro lighting, deep saturated colors. Renaissance master style with visible paint texture and depth."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/portrait.jpg"],
    "mode": "max"
  }'
7. 铅笔素描风格

将照片转换为细节丰富、带有交叉排线和明暗效果的铅笔画。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Convert this photo into a detailed pencil sketch. Fine crosshatching for shading, clean outlines, graphite texture on paper. Photorealistic pencil drawing style with subtle gradients and precise details."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/subject.jpg"],
    "mode": "max"
  }'
8. 波普艺术风格

将照片转换为大胆鲜艳、灵感源自沃霍尔和利希滕斯坦的波普艺术作品。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Apply pop art style to this portrait. Bold flat colors, Ben-Day dots, high contrast, Andy Warhol inspired. Bright neon palette with black outlines, comic book aesthetic meets fine art."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/portrait.jpg"],
    "mode": "max"
  }'
9. 像素艺术风格

将照片转换为使用有限色彩的复古像素艺术。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this photo into pixel art style. 16-bit retro gaming aesthetic, limited color palette, visible pixels, clean edges. Like classic SNES or arcade game sprites but detailed."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/character.jpg"],
    "mode": "max"
  }'
10. 自定义参考图像风格

使用任意艺术作品作为风格参考,将其美学风格迁移到照片上。

curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Apply the artistic style from the first image (the reference artwork) to the second image (the photo). Match the color palette, brushwork, texture, and overall aesthetic of the reference while preserving the composition of the photo."}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": [
      "https://example.com/reference-artwork.jpg",
      "https://example.com/my-photo.jpg"
    ],
    "mode": "max"
  }'

最佳实践

风格迁移技巧
  • 描述具体:准确描述你想要的风格元素(笔触、色彩、技法)
  • 提及艺术家:指出具体的艺术家或作品,以获得更准确的结果
  • 保留特征:处理肖像时,说明是否要保留面部特征
  • 控制强度:使用“微妙”“适中”或“强烈”等词语控制效果强度
图像指南
  • 高分辨率:使用高质量源图像,以获得最佳效果
  • 主体清晰:光线充足、主体清晰的照片更适合进行风格迁移
  • 注意构图:简单的构图通常能产生更干净的风格化效果
风格迁移提示词技巧

在提示词中加入以下细节:

  1. 风格名称:具体的艺术家或技法(梵高、水彩、动漫)
  2. 关键元素:你想要的笔触、色彩和纹理
  3. 氛围:戏剧性、柔和、鲜艳、低饱和
  4. 保留内容:需要从原图中保留的内容(面部、构图)
  5. 强度:风格的应用强度
提示词结构示例
"Apply [style name] style to this [subject type].
[Describe key style elements: brushstrokes, colors, technique].
[Mood and atmosphere].
[What to preserve from original]."

模式选择

生成前询问用户:

“你想要快速且便宜的效果,还是高质量效果?”

模式适用场景速度质量
max最终作品、印刷、专业用途较慢最高
eco快速预览、探索风格、草稿较快良好

多轮风格迭代

使用 session_id 对风格迁移进行迭代:

# Initial style transfer
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Apply Van Gogh style to this portrait"}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/portrait.jpg"],
    "session_id": "style-project-001"
  }'

# Refine the style
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Make the brushstrokes more pronounced and add more yellow tones like in Starry Night"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "style-project-001"
  }'

# Try a variation
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Now create a version with cooler blue tones instead"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "style-project-001"
  }'

批量风格探索

生成多个风格变体以供比较:

# Van Gogh variation
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Apply Van Gogh style to this photo"}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/photo.jpg"],
    "mode": "eco"
  }'

# Monet variation
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Apply Monet impressionist style to this photo"}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/photo.jpg"],
    "mode": "eco"
  }'

# Anime variation
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -H "Accept: text/event-stream" \
  -d '{
    "messages": [{"role": "user", "content": "Transform this photo into anime style"}],
    "model": "eachsense/beta",
    "stream": true,
    "image_urls": ["https://example.com/photo.jpg"],
    "mode": "eco"
  }'

错误处理

错误原因解决方案
Failed to create prediction: HTTP 422余额不足在 eachlabs.ai 充值
内容政策违规禁止内容确保源图像符合内容政策
超时生成内容复杂将客户端超时时间设为至少 10 分钟
未识别风格风格描述模糊更具体地描述所需的艺术风格

相关技能

  • each-sense - 核心 API 文档
  • image-generation - 根据文本生成图像
  • image-editing - 编辑和增强图像
  • product-photo-generation - 生成电商产品照片

评论

支持 Markdown