name: image-upscale description: AI-powered image upscaling using Real-ESRGAN + LANCZOS. Supports PSD/PNG/JPG input, generates high-resolution PNG with configurable DPI. Use when the user asks to upscale, enlarge, magnify, or increase resolution of images; when working with print-ready images requiring high DPI; when converting PSD to high-resolution PNG; or when image quality enhancement with AI-generated detail is needed.
AI影像放大技能,基於 Real-ESRGAN 神經網路 + LANCZOS 插值。
向用戶確認兩個引數: 1. 放大倍數或目標尺寸 — 預設 10x(即最終尺寸 = 原圖 ×10) 2. 目標 DPI — 預設 300(列印級)
如果使用者提供的是目標長寬畫素,計算所需倍數:scale = ceil(target / original)。
發現更多技能外掛,請訪問7w4.net。
(dpi, dpi) 後設資料{basename}_{scale}x_{dpi}DPI_realesrgan.pngscripts/upscale.py主指令碼,包含完整推理程式碼:
- upscale_image() — 單圖處理
- batch_upscale() — 批次處理
- download_model() — 自動下載模型
- 純 PyTorch 實現,無需額外依賴(只需 torch + Pillow + numpy + requests)
# 單圖
python scripts/upscale.py input.png -o output.png -s 10 -d 300
# 批次
python scripts/upscale.py ./images/ --batch -s 10 -d 300
# CPU 模式
python scripts/upscale.py input.png --device cpu
from scripts.upscale import upscale_image, batch_upscale
# 單圖
result = upscale_image('input.psd', 'output.png', target_scale=10, target_dpi=300)
# 批次
results = batch_upscale('./images/', target_scale=10, target_dpi=300)
scripts/ 目錄scripts/RealESRGAN_x4plus.pth這個影像放大工具質量不錯,操作流程清晰易懂,放大效果有保障。它支援 PSD、PNG、JPG 等常見格式,還能自動下載所需模型。用 AI 生成細節再配合數學插值,放大後的影像質量較好。文件寫得很詳細,小白也能上手。不過首次使用需要下載較大檔案,沒有依賴列表檔案,部分細節功能還需要手動調整。建議準備好網路環境再使用。