关于 object-removal
object-removal 是基于 each::sense 的图像编辑技能,可按文字描述移除照片中的物体并补全区域,适合需要清理人物、文字或瑕疵的图片处理者。支持多轮细化处理。
主要功能
- 01移除人物与物体
- 02清除文字、水印和标志
- 03修复瑕疵、阴影与线缆
- 04按背景内容补全移除区域
- 05通过多轮会话迭代修改
适用场景
- 01从风景照中移除路人或杂物
- 02清理商品图中的标签与反光
- 03移除照片水印并恢复背景
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ eachlabs/ skills --skill object-removal安装后在 Claude Code 中输入/object-removal确认已加载。
附带文件references/SSE-EVENTS.md
详细介绍
对象移除与图像修补
使用 each::sense 移除照片中的不需要元素。此技能可智能移除对象、人物、文字、水印和瑕疵,同时以符合上下文的内容无缝填充移除区域。
功能
- 对象移除:从任意照片中移除不需要的物品
- 人物移除:干净地移除背景中的人物
- 文字/水印移除:清理叠加了不需要文字的图像
- 瑕疵移除:移除皮肤瑕疵和照片伪影
- 电线/线缆移除:清理电线、电缆和线路
- Logo 移除:从图像中移除品牌标识和 Logo
- 阴影移除:消除不需要的阴影
- 背景清理:移除分散注意力的背景元素
快速开始
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": "Remove the person standing on the left side of this photo"}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/beach-photo.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": "Remove the person in the red shirt from this beach photo. Fill the area naturally with the ocean and sand background."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/beach-group.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": "Remove the trash can and bench from the right side of this park landscape photo. Make it look like a clean natural scene."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/park-landscape.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": "Remove the watermark from the bottom right corner of this image. Restore the original background seamlessly."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/watermarked-image.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": "Remove the skin blemishes and acne marks from this portrait photo. Keep the skin looking natural and maintain the original skin texture."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/portrait.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": "Remove all the power lines and electrical wires from this sunset cityscape photo. Make the sky look clean and unobstructed."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/cityscape-wires.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": "Remove all the tourists and people from this Eiffel Tower photo. I want it to look like an empty plaza with just the monument."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/eiffel-tower-crowded.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": "Remove the person on the right side of this vacation photo. Fill in with the background scenery naturally so it looks like a solo travel photo."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/vacation-couple.jpg"],
"mode": "max"
}'
8. 移除 Logo/品牌标识
清理产品照片或带有不需要品牌标识的图像。
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": "Remove the brand logo from the t-shirt in this photo. Replace it with plain fabric that matches the shirt color and texture."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/branded-shirt.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": "Clean up this product photo by removing the price tag, dust spots, and the reflection of the photographer in the surface. Make it look professional and ready for e-commerce."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/product-raw.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": "Remove the harsh shadow cast by the photographer on the ground in this outdoor portrait. Make the lighting look natural and even."}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/portrait-shadow.jpg"],
"mode": "max"
}'
多轮对象移除
使用 session_id 进行迭代移除和优化:
# First removal
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": "Remove the car parked on the left side of this street photo"}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/street-scene.jpg"],
"session_id": "cleanup-project-001"
}'
# Second removal (same session)
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 also remove the garbage bins near the building entrance"}],
"model": "eachsense/beta",
"stream": true,
"session_id": "cleanup-project-001"
}'
# Refinement (same session)
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": "The area where the car was removed looks a bit blurry. Can you improve the texture to match the surrounding pavement better?"}],
"model": "eachsense/beta",
"stream": true,
"session_id": "cleanup-project-001"
}'
对象移除提示词技巧
请求移除对象时,请在提示词中包含以下信息:
- 移除内容:具体说明要移除的对象
- 位置:描述对象在图像中的位置(左侧、右侧、中心、背景)
- 填充说明:描述移除区域应填充的内容
- 保留背景信息:说明是否需要保持某些元素完整
提示词结构示例
"Remove [object description] from [location in image].
Fill the area with [expected background/content].
Keep [elements to preserve] intact."
良好的提示词示例
- “移除左侧喷泉附近穿蓝色夹克的人”
- “从图像中移除所有文字和水印,恢复原始背景”
- “移除汽车,并用匹配的草地和小路填充”
应避免的提示词
- “清理这张照片”(过于模糊)
- “移除一些东西”(不够具体)
- “让它更好看”(目标不明确)
模式选择
| 模式 | 适用场景 | 速度 | 质量 |
|---|---|---|---|
max | 最终成品、复杂移除、专业工作 | 较慢 | 最高 |
eco | 快速预览、简单移除、批量处理 | 较快 | 良好 |
建议:复杂移除(人物、大型对象)使用 max 模式,简单清理(小瑕疵、灰尘斑点)使用 eco 模式。
最佳实践
获得最佳效果
- 高分辨率源图:使用可获取的最高质量源图像
- 清晰描述:具体说明要移除什么以及其位置
- 简单背景:前方背景简单、重复的对象更容易干净地移除
- 多轮处理:对于复杂场景,可使用多轮移除,一次处理一个元素
棘手场景
- 复杂背景:位于细节丰富、独特背景前的对象可能需要手动优化
- 大型对象:移除非常大的对象(占图像面积超过 30%)可能会产生不够真实的效果
- 倒影:带有倒影的对象可能需要分别请求移除对象及其倒影
- 阴影:如果对象投下了明显阴影,请记得请求移除阴影
错误处理
| 错误 | 原因 | 解决方案 |
|---|---|---|
Failed to create prediction: HTTP 422 | 余额不足 | 在 eachlabs.ai 充值 |
| 内容策略违规 | 禁止的内容 | 查看内容指南 |
| 超时 | 生成内容复杂 | 将客户端超时设置为至少 10 分钟 |
| 移除效果不佳 | 提示词含糊 | 更具体地说明位置和填充内容 |
客户端超时配置
移除对象可能需要一些时间,尤其是在场景复杂时。请将 HTTP 客户端的超时时间配置为至少 10 分钟,以避免过早断开连接。
# Example with extended timeout
curl --max-time 600 -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": "Remove all people from this crowded plaza photo"}],
"model": "eachsense/beta",
"stream": true,
"image_urls": ["https://example.com/crowded-plaza.jpg"],
"mode": "max"
}'
相关技能
each-sense- 核心 API 文档image-edit- 通用图像编辑功能background-removal- 移除并替换背景
评论
支持 Markdown