mcpField
P
photo-restoration

photo-restoration

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

关于 photo-restoration

photo-restoration 是基于 each::sense 的旧照片修复技能,适合修复家庭照片、历史影像及受损扫描件。它可修补物理损伤、恢复褪色、为黑白照片上色,并支持分阶段处理。

主要功能

  1. 01修复划痕、撕裂和折痕
  2. 02为黑白照片添加色彩
  3. 03恢复褪色照片的色彩与对比度
  4. 04修复水渍并增强人脸
  5. 05去除胶片颗粒与噪点
  6. 06多轮及批量处理照片

适用场景

  1. 01修复受损的家庭老照片
  2. 02为黑白历史照片上色
  3. 03恢复褪色或水损照片细节
  4. 04整理有颗粒和模糊人脸的扫描影像

安装

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

$npx skills add https://github.com/eachlabs/skills --skill photo-restoration

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

附带文件references/SSE-EVENTS.md

详细介绍

老照片修复

使用 each::sense 修复和增强老旧、受损或劣化的照片。此技能利用 AI 驱动的修复模型修补划痕、为黑白图像上色、修复褪色、去除胶片颗粒,让受损的照片重焕生机。

功能

  • 损伤修复:修复划痕、撕裂、折痕和物理损伤
  • 上色:为黑白照片添加自然色彩
  • 褪色修复:恢复褪色和色彩暗淡图像的鲜艳度
  • 水渍修复:修复受水或潮湿损伤影响的照片
  • 面部修复:增强并修复老旧或低质量照片中的面部
  • 胶片颗粒去除:清理老胶片照片中的颗粒和噪点
  • 历史照片增强:提升档案照片和复古图像的质量
  • 撕裂照片重建:以数字方式修复撕裂的照片

快速开始

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": "Restore this old damaged family photo - fix the scratches and improve the overall quality"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/old-family-photo.jpg"]
  }'

使用场景示例

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": "Restore this old damaged photo from the 1950s. It has scratches, some staining, and general degradation. Please repair the damage while preserving the authentic vintage feel."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/damaged-1950s-photo.jpg"]
  }'
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": "Colorize this black and white photo from the 1940s. It shows a family portrait - add natural, realistic colors to skin tones, clothing, and the background."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/bw-family-portrait.jpg"]
  }'
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 scratches from this photo. There are multiple deep scratches across the surface and some light surface marks. Keep the image sharp and clear after repair."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/scratched-photo.jpg"]
  }'
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": "Enhance this faded photo - the colors have washed out over time and the image looks dull. Restore the vibrancy and contrast while keeping it looking natural, not over-processed."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/faded-vintage-photo.jpg"]
  }'
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": "Restore this water damaged photo. It has staining, warping effects, and some areas where the image has deteriorated due to moisture. Recover as much detail as possible."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/water-damaged-photo.jpg"]
  }'
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": "Restore the faces in this old family photo. The faces are blurry and lack detail. Enhance facial features to make them clear and recognizable while maintaining the authentic look of the era."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/old-blurry-faces.jpg"]
  }'
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": "Restore this historical photograph from the early 1900s. It is a street scene that has significant age-related degradation. Improve clarity, fix damage, and optionally colorize it while preserving historical accuracy."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/historical-1900s-street.jpg"]
  }'
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": "Restore this precious family photo from my grandparents wedding in 1960. It has yellowing, some creases, and the edges are damaged. Make it look fresh while preserving the nostalgic quality."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/grandparents-wedding.jpg"]
  }'
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": "Repair this torn photo - there is a visible tear line running through the middle of the image. Reconstruct the damaged areas seamlessly and restore the photo to its original state."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/torn-photo.jpg"]
  }'
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 heavy film grain from this old photograph. The grain is very visible and distracting. Clean it up while preserving the sharpness and detail of the image. Keep some subtle texture so it does not look overly processed."}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "max",
    "image_urls": ["https://example.com/grainy-film-photo.jpg"]
  }'

多轮修复会话

使用 session_id 进行迭代修复和调整:

# Initial restoration
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": "Restore this old damaged black and white photo - fix the scratches and damage first"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "family-photo-restoration",
    "image_urls": ["https://example.com/old-bw-damaged.jpg"]
  }'

# Follow up with colorization
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 colorize the restored photo with natural colors appropriate for the 1930s era"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "family-photo-restoration"
  }'

# Further refinement
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": "Enhance the faces to make them clearer and more detailed"}],
    "model": "eachsense/beta",
    "stream": true,
    "session_id": "family-photo-restoration"
  }'

批量修复

使用一致的设置处理多张照片:

# Photo 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": "Restore and colorize this old family photo"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "eco",
    "image_urls": ["https://example.com/family-photo-1.jpg"]
  }'

# Photo 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": "Restore and colorize this old family photo"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "eco",
    "image_urls": ["https://example.com/family-photo-2.jpg"]
  }'

# Photo 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": "Restore and colorize this old family photo"}],
    "model": "eachsense/beta",
    "stream": true,
    "mode": "eco",
    "image_urls": ["https://example.com/family-photo-3.jpg"]
  }'

模式选择

处理前询问用户:

“您想要快速且经济,还是追求最高质量?”

模式最适合速度质量
max最终修复、珍贵的家庭照片、专业档案修复工作较慢最高
eco快速预览、批量处理、初步评估较快良好

最佳实践

获得最佳效果
  • 提供背景信息:说明照片年代、损伤类型,以及最需要保留的内容
  • 先修复损伤:先修复划痕和撕裂,再进行上色
  • 使用多轮会话:对于复杂项目,分阶段逐步完成修复
  • 说明面部修复需求:如果面部很重要,请明确提出面部修复
  • 保留真实性:如有需要,可要求保留复古质感
提示词建议
  1. 描述损伤:划痕、撕裂、褪色、水渍、泛黄
  2. 说明年代:这有助于进行恰当的上色
  3. 说明优先事项:最重要的是面部、整体清晰度还是色彩准确性
  4. 设定预期:自然效果还是最大程度增强
提示词结构示例
"Restore this [era] photo. The damage includes [list damage types].
Focus on [priority areas]. [Additional preferences like colorization,
authenticity preservation, etc.]"

错误处理

错误原因解决方案
Failed to create prediction: HTTP 422余额不足前往 eachlabs.ai 充值
内容政策违规内容被禁止确保照片符合内容政策
超时修复过程复杂将客户端超时时间设为至少 10 分钟
结果质量低输入分辨率不足使用可获得的最高扫描/照片分辨率

相关技能

  • each-sense - 核心 API 文档
  • image-enhancement - 通用图像质量提升
  • face-restoration - 专业人脸增强
  • image-upscaling - 提高图像分辨率

评论

支持 Markdown