关于 image-upscaling
image-upscaling 是一项通过 each::sense 放大并增强图像的技能,系统会按请求自动选择模型。适用于印刷准备、商品图片优化和旧照片修复等图像处理场景。
主要功能
- 01自动选择图像放大模型
- 02提高分辨率并恢复细节
- 03去除噪点和压缩伪影
- 04每次请求可用最多 4 张参考图
- 05支持流式或完整响应
适用场景
- 01将网页图片用于印刷
- 02优化电商商品照片
- 03修复扫描的旧照片
- 04提高 AI 生成图像的分辨率
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ awesome-genmedia/ skills --skill image-upscaling安装后在 Claude Code 中输入/image-upscaling确认已加载。
详细介绍
图像放大
使用 each::sense 提高图像分辨率并通过 AI 增强细节——这款智能 AI Agent 会自动为你的请求选择最佳模型。
快速开始
需要 each::labs API 密钥。请前往 eachlabs.ai 获取。
使用 curl
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Upscale this image to the highest resolution possible. Preserve sharpness and fine detail. Enhance texture without adding artifacts."},
{"type": "image_url", "image_url": {"url": "https://example.com/low-res-photo.jpg"}}
]
}
],
"stream": false
}'
使用 Python(OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="YOUR_EACHLABS_API_KEY",
base_url="https://eachsense-agent.core.eachlabs.run/v1"
)
response = client.chat.completions.create(
model="eachsense/beta",
messages=[{"role": "user", "content": "Upscale this image to the highest resolution possible. Preserve sharpness and fine detail. Enhance texture without adding artifacts."}],
# Images are included in the message content array above
)
print(response.choices[0].message.content)
使用参考图像
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Upscale the first image. Use the second image as a quality reference for the level of detail and sharpness I expect in the output."},
{"type": "image_url", "image_url": {"url": "https://example.com/low-res.jpg"}},
{"type": "image_url", "image_url": {"url": "https://example.com/quality-reference.jpg"}}
]
}
],
"stream": false
}'
图像采用 OpenAI 多模态内容格式,随消息一同发送。每个请求最多支持 4 张图像。
流式传输
设置 "stream": true 可实时接收 SSE 响应,设置 "stream": false 则在单个响应中获取完整结果。流式传输适合在 UI 中显示进度;非流式传输更适合脚本和自动化。
可用模型
| 模型 | 优势 | 最适用场景 |
|---|---|---|
| topaz-upscale-image | 业界领先的放大效果、细节恢复、伪影去除 | 所有图像放大任务、印刷准备、照片修复 |
检测到图像放大请求时,each::sense 会自动选择 topaz-upscale-image。
AI 图像放大能做什么
| 能力 | 说明 |
|---|---|
| 提高分辨率 | 将图像放大 2 倍、4 倍或更多,同时添加逼真的细节 |
| 细节恢复 | 从低分辨率源图中重建纹理、边缘和细微特征 |
| 降噪 | 去除压缩伪影、JPEG 方块效应和噪点 |
| 锐化 | 增强边缘清晰度,避免光晕或过度锐化 |
| 面部增强 | 恢复较小或模糊面部区域的细节 |
| 纹理合成 | 生成原图中不存在、但合理可信的纹理细节 |
图像放大场景
| 场景 | 输入质量 | 预期效果 |
|---|---|---|
| 缩略图放大至全尺寸 | 100-300px | 整体形状良好;细节由模型合成 |
| 网页图像用于印刷 | 600-1200px | 效果出色;大部分细节得以保留和增强 |
| 社交媒体图像放大为海报 | 1080-2000px | 效果卓越;达到可直接印刷的质量 |
| 旧照片修复 | 不固定,通常已有损坏 | 恢复效果良好;可结合降噪使用 |
| AI 生成图像 | 通常为 512-1024px | 效果出色;AI 图像放大处理 AI 图像的效果非常好 |
| 截图转为高分辨率图像 | 不固定 | 对截图中的照片效果良好;文字可能会模糊 |
提示词技巧
基本图像放大
"Upscale this image. Maximize resolution while keeping it sharp and natural."
指定质量方向
"Upscale this image 4x. Prioritize sharpness over smoothness.
Recover fabric texture detail and skin pore detail.
Do not over-smooth or make it look plasticky."
指定使用场景
"Upscale this product photo for a 24x36 inch print at 300 DPI.
Ensure edges remain crisp and colors stay accurate.
Remove any compression artifacts from the original."
结合放大与增强
"Upscale this old family photo. Remove noise and grain.
Sharpen facial features. Correct any color fading.
Output at the highest resolution possible."
示例
普通照片放大
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Upscale this photo to the maximum resolution. Keep it photorealistic, sharp, and detailed. Preserve natural skin texture and fabric detail. Remove any JPEG compression artifacts."},
{"type": "image_url", "image_url": {"url": "https://example.com/vacation-photo-small.jpg"}}
]
}
],
"stream": false
}'
电商产品增强
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Upscale this product image for a high-resolution e-commerce listing. The output should be sharp enough for zoom-in product inspection. Enhance material textures — leather grain, stitching detail, metal hardware shine. Remove any noise or compression artifacts."},
{"type": "image_url", "image_url": {"url": "https://example.com/handbag-thumbnail.jpg"}}
]
}
],
"stream": false
}'
旧照片修复
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Upscale and restore this old scanned photograph. Remove film grain and scanning artifacts. Sharpen facial features while keeping the image natural. Correct any color shifts from aging. Output at the highest possible resolution while maintaining a realistic look."},
{"type": "image_url", "image_url": {"url": "https://example.com/1970s-family-photo.jpg"}}
]
}
],
"stream": false
}'
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" \
-d '{
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Upscale this AI-generated artwork for large-format printing. Enhance the painterly textures and fine brush stroke details. Keep the artistic style intact while increasing resolution. Target print quality at 300 DPI for a 20x30 inch poster."},
{"type": "image_url", "image_url": {"url": "https://example.com/ai-artwork-1024px.png"}}
]
}
],
"stream": false
}'
印刷准备
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [{"role": "user", "content": [
{"type": "text", "text": "Upscale this landscape photograph for large-format printing on canvas. Maximum resolution. Enhance foliage detail, water reflections, and sky gradients. Ensure smooth tonal transitions with no banding. The output will be printed at 40x60 inches, so quality must be exceptional."},
{"type": "image_url", "image_url": {"url": "https://example.com/landscape-web-size.jpg"}}
]
}
],
"stream": false
}'
批量放大
# Upscale a batch of product images
IMAGES=(
"https://example.com/product-a.jpg"
"https://example.com/product-b.jpg"
"https://example.com/product-c.jpg"
)
for IMG in "${IMAGES[@]}"; do
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d "{
\"messages\": [{\"role\": \"user\", \"content\": \"Upscale to maximum resolution. Preserve sharpness and detail. Remove compression artifacts.\"}],
\"image_urls\": [\"$IMG\"],
\"stream\": false
}"
echo "---"
done
分辨率与印刷尺寸指南
| 输入分辨率 | 放大倍数 | 输出分辨率 | 最大印刷尺寸(300 DPI) |
|---|---|---|---|
| 512 x 512 | 4x | 2048 x 2048 | ~7 x 7 inches |
| 1024 x 1024 | 4x | 4096 x 4096 | ~14 x 14 inches |
| 1920 x 1080 | 4x | 7680 x 4320 | ~26 x 14 inches |
| 2048 x 1536 | 2x | 4096 x 3072 | ~14 x 10 inches |
| 3000 x 2000 | 2x | 6000 x 4000 | ~20 x 13 inches |
常见问题
- 分辨率极低(低于 100px)意味着可供处理的数据很少,无论如何结果都会比较模糊。
- 放大过度(例如 16x)会导致收益递减。要获得理想质量,2x-4x 是最佳范围。
- 期望获得新信息:放大可以增强和合成细节,但无法恢复从未采集的信息。
- 图像中的文字在放大时可能会变得模糊或扭曲。与自然图像相比,文字更难重建。
- 源图经过严重 JPEG 压缩会产生伪影,而放大可能会放大这些伪影。请明确要求去除伪影。
- 过度平滑会让图像显得不自然。如果面部看起来过于平滑,请指定“保留纹理,避免塑料质感”。
推荐工作流
- 从最佳来源开始,即分辨率最高、压缩最少的版本
- 先放大,再进行其他编辑
- 说明最终用途(网页、印刷、社交媒体),以便模型进行相应优化
- 结合编辑实现全面增强:先放大,再校正颜色,最后进行调整
相关技能
文档
评论
支持 Markdown