{"id":"ca1d508e-9503-4413-8df3-392fe91c0796","entityType":"agent","slug":"clawhub-harven-droid-local-image-upscaler","name":"Local Image Upscaler","canonicalUrl":"https://www.xpersona.co/agent/clawhub-harven-droid-local-image-upscaler","canonicalPath":"/agent/clawhub-harven-droid-local-image-upscaler","generatedAt":"2026-10-13T19:53:28.473Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-12T00:24:45.553Z","emptyReason":null},"description":"Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-... Skill: Local Image Upscaler Owner: harven-droid Summary: Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-... Tags: latest:1.2.2 Version history: v1.2.2 | 2026-07-22T09:52:12.907Z | user Verify the pinned runtime executable and selected model with SHA-256 before every upscale, including custom cache directories","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 968 downloads reported by the source. Last updated 10/12/2026.","installCommand":"clawhub skill install s17b95kvfzb5cdt2sy8s534dns842jax:local-image-upscaler","sourceUrl":"https://clawhub.ai/harven-droid/local-image-upscaler","homepage":"https://clawhub.ai/harven-droid/skills/local-image-upscaler","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/harven-droid/local-image-upscaler","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/harven-droid/skills/local-image-upscaler","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-12T00:24:45.553Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T00:24:45.553Z","emptyReason":null},"stars":null,"forks":null,"downloads":968,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"1.2.2","tractionLabel":"968 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T00:24:45.539Z","emptyReason":null},"lastUpdatedAt":"2026-10-12T00:24:45.553Z","lastCrawledAt":"2026-10-12T00:24:45.539Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-13T00:24:45.539Z","lastVerifiedAt":null,"highlights":[{"version":"1.2.2","createdAt":"2026-07-22T09:52:12.907Z","changelog":"Verify the pinned runtime executable and selected model with SHA-256 before every upscale, including custom cache directories. Keep absolute Windows PowerShell resolution, lazy algorithm profiles, download-size reporting, and tested conservative portrait routing.","fileCount":13,"zipByteSize":30867},{"version":"1.2.1","createdAt":"2026-07-22T09:48:45.386Z","changelog":"Harden Windows image processing by resolving PowerShell from the absolute SystemRoot path and removing PATH from the child environment. Also refine automatic portrait routing based on same-size visual comparison: clean AI and studio portraits use the balanced default, while portrait mode is reserved for noisy, compressed, or rough natural photos.","fileCount":13,"zipByteSize":30023},{"version":"1.2.0","createdAt":"2026-07-22T09:44:24.535Z","changelog":"Add lazy algorithm profiles for balanced, fast, natural photo, portrait, digital art, and sharp-detail upscaling; show advantages, trade-offs, cache status, and incremental download sizes; improve conservative automatic selection with tested clean-AI-portrait routing; keep heavy PyTorch and diffusion models optional; expand bilingual documentation.","fileCount":13,"zipByteSize":29786},{"version":"1.1.0","createdAt":"2026-07-22T07:09:13.091Z","changelog":"Add 1K and 8K presets, custom long-edge output, strict KB/MB compression, quality-only mode, recursive batch compression, dry-run planning, image inspection reports, bilingual README, and reduced Windows subprocess environment exposure.","fileCount":12,"zipByteSize":22334},{"version":"1.0.0","createdAt":"2026-07-22T06:17:28.244Z","changelog":"Initial release: verified local 4K upscaling for macOS and Windows, high-fidelity and lite models, aspect-ratio preservation, batch mode, offline cache, and mirror fallback.","fileCount":9,"zipByteSize":13464}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17b95kvfzb5cdt2sy8s534dns842jax:local-image-upscaler","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-13T19:53:28.471Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-harven-droid-local-image-upscaler/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-12T00:24:45.553Z","emptyReason":null},"readme":"Skill: Local Image Upscaler\n\nOwner: harven-droid\n\nSummary: Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-...\n\nTags: latest:1.2.2\n\nVersion history:\n\nv1.2.2 | 2026-07-22T09:52:12.907Z | user\n\nVerify the pinned runtime executable and selected model with SHA-256 before every upscale, including custom cache directories. Keep absolute Windows PowerShell resolution, lazy algorithm profiles, download-size reporting, and tested conservative portrait routing.\n\nv1.2.1 | 2026-07-22T09:48:45.386Z | user\n\nHarden Windows image processing by resolving PowerShell from the absolute SystemRoot path and removing PATH from the child environment. Also refine automatic portrait routing based on same-size visual comparison: clean AI and studio portraits use the balanced default, while portrait mode is reserved for noisy, compressed, or rough natural photos.\n\nv1.2.0 | 2026-07-22T09:44:24.535Z | user\n\nAdd lazy algorithm profiles for balanced, fast, natural photo, portrait, digital art, and sharp-detail upscaling; show advantages, trade-offs, cache status, and incremental download sizes; improve conservative automatic selection with tested clean-AI-portrait routing; keep heavy PyTorch and diffusion models optional; expand bilingual documentation.\n\nv1.1.0 | 2026-07-22T07:09:13.091Z | user\n\nAdd 1K and 8K presets, custom long-edge output, strict KB/MB compression, quality-only mode, recursive batch compression, dry-run planning, image inspection reports, bilingual README, and reduced Windows subprocess environment exposure.\n\nv1.0.0 | 2026-07-22T06:17:28.244Z | user\n\nInitial release: verified local 4K upscaling for macOS and Windows, high-fidelity and lite models, aspect-ratio preservation, batch mode, offline cache, and mirror fallback.\n\nArchive index:\n\nArchive v1.2.2: 13 files, 30867 bytes\n\nFiles: agents/openai.yaml (293b), assets/manifest.json (6385b), README.md (12997b), references/algorithms.md (2923b), references/licenses.md (859b), references/platforms.md (2726b), scripts/compress.py (11324b), scripts/inspect.py (2061b), scripts/setup.py (11284b), scripts/upscale.py (15093b), skill-card.md (3017b), SKILL.md (8371b), _meta.json (139b)\n\nFile v1.2.2:SKILL.md\n\n---\nname: image-upscaler\ndescription: Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-detail, balanced, and fast profiles; 1K/2K/4K/8K output; custom long edges; strict target file sizes; batch folders; aspect-ratio preservation; offline reuse; and verified download fallbacks. Use when the user asks to make an image clearer, enlarge AI-generated art, compare enhancement algorithms, inspect image resolution, upscale without stretching, or reduce a larger image to a target such as 200KB.\n---\n\n# Image Upscaler\n\nUse the bundled Python scripts to run Upscayl's Vulkan-based NCNN engine locally. Download models only when selected. Preserve the source aspect ratio by default and never overwrite an input file.\n\n## Workflow\n\n1. Inspect the input path, file type, dimensions, and available disk space.\n2. Inspect the image visually and recommend one profile. If the choice materially affects the result, give the user a compact choice with the advantage, disadvantage, and additional download size. Do not block if the user does not choose; use `default`.\n3. Choose a profile:\n   - `default`: balanced and conservative; use when content is mixed or uncertain. Model download: about 32 MB.\n   - `fast`: smallest and fastest; weaker fine-detail reconstruction. Model download: about 2.5 MB.\n   - `photo`: natural photographic texture; less crisp on text and architecture. Model download: about 32 MB.\n   - `portrait`: use for compressed, noisy, or rough natural portraits that benefit from smoother rendering. It avoids face replacement but can remove fine skin texture. Use `default` for already-clean AI portraits and sharp studio headshots. Model download: about 32 MB, shared with `photo`.\n   - `digital-art`: clean anime, illustration, and icon edges; may oversimplify photographic texture. Model download: about 8.6 MB.\n   - `sharp`: strongest apparent edge detail; may exaggerate noise, halos, skin, or text artifacts. Model download: about 32 MB.\n4. If the selected runtime or model is not cached, explain the download and disk cost, then run setup. Read [platforms.md](references/platforms.md) for compatibility and cache sizes.\n5. Run the upscaler or compressor. Prefer PNG for maximum upscale quality; use JPEG for strict file-size targets.\n6. Verify that the output exists, has the requested dimensions, and keeps the source ratio. Report the selected profile, output path, dimensions, and file size.\n\nThe agent performs the meaningful automatic selection after visually inspecting the image. CLI `--profile auto` uses filename hints only and otherwise falls back conservatively to `default`; it does not claim reliable face or scene classification without an extra vision package. Read [algorithms.md](references/algorithms.md) when comparing profiles or discussing heavier optional algorithms.\n\nFor portraits, inspect source quality before selecting by subject alone: choose `default` for clean AI-generated or studio portraits; choose `portrait` only when a natural portrait is noisy, compressed, or visually rough. This rule is based on same-size comparison testing, where `portrait` produced smoother skin but removed detail from an already-clean AI portrait.\n\n## Prepare the Runtime\n\nRun from this skill directory:\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\nList choices, trade-offs, cache status, and incremental downloads without installing anything:\n\n```bash\npython scripts/setup.py --list-models\n```\n\nPrepare only the selected profile:\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\nThe downloader tries the local cache, configured mirrors, a verified GitHub acceleration endpoint, and the official source. Every downloaded artifact must match the pinned SHA-256 digest. The upscaler re-verifies the cached executable and selected model before every execution, including when `IMAGE_UPSCALER_CACHE` overrides the cache directory. To use an organization or domestic mirror, set `IMAGE_UPSCALER_MIRRORS` to one or more comma-separated URL prefixes before setup. Each prefix is prepended to the official URL. Example:\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\nUse `--offline` to forbid all network access. Use `--platform windows-x64 --download-only` to prefetch Windows files from another machine.\n\n## Upscale Images\n\nCreate a 4K image whose long edge is 3840 pixels while preserving the original ratio:\n\n```bash\npython scripts/upscale.py INPUT --output OUTPUT.png --target 4k\n```\n\nUseful variants:\n\n```bash\npython scripts/upscale.py INPUT --target 1k\npython scripts/upscale.py INPUT --target 2k --profile fast\npython scripts/upscale.py INPUT --target 4k --profile portrait\npython scripts/upscale.py INPUT --target 4k --profile digital-art\npython scripts/upscale.py INPUT --target 4k --profile sharp\npython scripts/upscale.py INPUT --target 8k --profile photo --tile 256\npython scripts/upscale.py INPUT --target scale4 --format png\npython scripts/upscale.py INPUT_FOLDER --output OUTPUT_FOLDER --target 4k\npython scripts/upscale.py INPUT --target 4k --format jpg --compression 92\n```\n\nThe screen-oriented presets use long edges: `1k=1920`, `2k=2560`, `4k=3840`, and `8k=7680`. A 16:9 4K landscape becomes 3840×2160; portraits and squares retain their own ratios. `scale4` keeps the model's native 4× output. Use `--max-edge N` for an exact custom long edge. Current local models are native 4× models; an 8K preset beyond the native result uses exact high-quality resizing and must not be described as recovered factual detail. For 8K, expect high memory and temporary-disk use; start with `--tile 256` if automatic tiling fails.\n\nExact 2K/4K output supports PNG and JPEG without extra dependencies. WebP is supported with `--target scale4`; use PNG when an exact target and transparency both matter.\n\n## Compress to a Target Size\n\nCompress a roughly 1MB image to no more than 200KiB:\n\n```bash\npython scripts/compress.py INPUT --output OUTPUT.jpg --target-kb 200\npython scripts/compress.py INPUT --target-mb 1.5 --keep-dimensions\npython scripts/compress.py INPUT_FOLDER --output OUTPUT_FOLDER --target-kb 200 --recursive\n```\n\nThe compressor first finds the highest JPEG quality that fits. If quality alone is insufficient, it reduces dimensions proportionally while respecting `--min-edge` (default 640px). It never stretches or overwrites the source. JPEG does not preserve transparency; convert the background explicitly before compression when its color matters.\n\nUse `--keep-dimensions` when reducing resolution is forbidden. Existing output files receive a `-v2`, `-v3`, and so on suffix unless `--overwrite` is explicitly supplied. Use `--dry-run` before a large folder job.\n\n## Inspect Before Processing\n\nInspect one file or a folder before choosing an upscale or compression target:\n\n```bash\npython scripts/inspect.py INPUT\npython scripts/inspect.py INPUT_FOLDER --recursive --json\n```\n\nThe report includes dimensions, simplified aspect ratio, megapixels, and file size.\n\n## Safety and Quality Rules\n\n- Never delete or replace source images.\n- Do not install GPU drivers, package managers, or system dependencies automatically.\n- Do not bypass SHA-256 verification, even when using a mirror.\n- Treat `IMAGE_UPSCALER_CACHE` and `IMAGE_UPSCALER_MIRRORS` as trusted configuration; execution-time hashes still reject modified runtime or model files.\n- Do not upload user images; processing must stay local.\n- Avoid TTA unless the user explicitly accepts a roughly 8× processing slowdown.\n- On GPU-memory errors, retry with `--tile 256`, then `--tile 128`.\n- If Vulkan is unavailable, stop and explain the platform limitation; do not silently switch to an unrelated cloud service.\n- Treat visual enhancement as reconstruction, not recovery of factual detail. Do not claim that invented texture is original information.\n\n## References\n\n- Read [platforms.md](references/platforms.md) for supported systems, storage, cache, mirror, and troubleshooting details.\n- Read [algorithms.md](references/algorithms.md) for profile selection, benefits, limitations, and optional heavy algorithms.\n- Read [licenses.md](references/licenses.md) before redistributing the engine or model files.\n\nFile v1.2.2:README.md\n\n# Local Image Upscaler / 本地图像增强工具\n\n## 中文\n\n### 简介\n\nLocal Image Upscaler 是一个面向 macOS 和 Windows x64 的本地图像增强 Skill。它可以使用本地 AI 模型放大图片、按指定分辨率输出、将图片压缩到目标体积，并在处理前检查图片信息。图片不会上传到云端，源文件默认不会被覆盖。\n\n### 主要功能\n\n- AI 高保真放大，适合照片、截图和 AI 生成图片\n- 根据图片自动推荐算法，也可由用户选择默认、快速、照片、人像、插画或锐利细节模式\n- 每种算法在下载前说明优点、缺点和新增空间，模型按需下载\n- `1K`、`2K`、`4K`、`8K` 分辨率预设\n- 自定义长边尺寸，不拉伸原图\n- 原生 4× 放大\n- 严格控制目标体积，例如将约 1MB 图片压缩到 200KB 以内\n- 压缩时优先保留尺寸和画质，必要时才等比例缩小\n- 单张图片与文件夹批量处理\n- 图片尺寸、比例、像素和体积检查\n- macOS 与 Windows x64 支持\n- 国内网络镜像回退、离线缓存和 SHA-256 完整性校验\n\n### 支持格式\n\n- 输入：JPG、JPEG、PNG、WebP\n- 放大输出：PNG、JPG、WebP（WebP 精确尺寸存在平台限制）\n- 目标体积压缩输出：JPEG\n\n### 算法怎么选\n\n如果用户没有指定，Skill 会先观察图片并推荐模式；用户不想选择时使用保守的默认模式。人脸生成式修复不会自动开启。\n\n| 模式 | 适合 | 优点 | 缺点 | 首次下载 |\n| --- | --- | --- | --- | ---: |\n| `default` | 类型不确定或混合图片 | 均衡、保守 | 不追求最强锐度 | 约 32MB |\n| `fast` | 预览、批处理、低配置设备 | 最快、最小 | 细节重建较弱 | 约 2.5MB |\n| `photo` | 自然照片 | 质感和明暗过渡自然 | 硬边不如锐利模式 | 约 32MB |\n| `portrait` | 有噪点、压缩或较粗糙的真实人像 | 不替换五官，过渡更柔和 | 会抹掉清晰AI人像的部分皮肤细节 | 与照片模式共用 |\n| `digital-art` | 动漫、插画、图标 | 线条干净、模型小 | 可能简化照片纹理 | 约 8.6MB |\n| `sharp` | 建筑、商品、游戏素材 | 视觉锐度最强 | 可能放大噪点、光晕和皮肤纹理 | 约 32MB |\n\n查看模型、缓存状态和增量下载空间，不会安装任何内容：\n\n```bash\npython scripts/setup.py --list-models\n```\n\n不要仅因为画面中有人就选择人像模式：清晰AI人像和棚拍头像优先用 `default`；只有真实人像存在噪点、压缩或纹理粗糙时才推荐 `portrait`。\n\n### 准备运行环境\n\n进入 Skill 目录后运行：\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\n快速预览或低配置设备可以使用轻量模型：\n\n```bash\npython scripts/setup.py --model lite\n```\n\n也可以只准备选中的模式：\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\n首次运行会下载固定版本的 Upscayl NCNN 运行时和模型，并进行 SHA-256 校验。每次执行放大前还会重新校验缓存中的可执行文件和所选模型，后续可以安全地离线复用缓存。\n\n### 放大到指定分辨率\n\n```bash\npython scripts/upscale.py input.png --target 1k\npython scripts/upscale.py input.png --target 2k\npython scripts/upscale.py input.png --target 4k\npython scripts/upscale.py input.png --target 8k --tile 256\n```\n\n指定算法模式：\n\n```bash\npython scripts/upscale.py input.png --target 4k --profile portrait\npython scripts/upscale.py input.png --target 4k --profile digital-art\npython scripts/upscale.py input.png --target 4k --profile sharp\n```\n\n分辨率预设指图片长边：\n\n- 1K：1920 像素\n- 2K：2560 像素\n- 4K：3840 像素\n- 8K：7680 像素\n\n原图比例始终保留。例如，16:9 图片输出为 4K 时是 3840×2160；正方形图片则是 3840×3840。\n\n自定义长边：\n\n```bash\npython scripts/upscale.py input.png --max-edge 3000\n```\n\n保留模型原生 4×结果：\n\n```bash\npython scripts/upscale.py input.png --target scale4\n```\n\n### 压缩到目标体积\n\n将图片压缩到不超过 200KB：\n\n```bash\npython scripts/compress.py input.png --output output.jpg --target-kb 200\n```\n\n将图片压缩到不超过 1.5MB：\n\n```bash\npython scripts/compress.py input.png --target-mb 1.5\n```\n\n只调整质量，不允许降低尺寸：\n\n```bash\npython scripts/compress.py input.png --target-kb 200 --keep-dimensions\n```\n\n如果保持原尺寸无法达到目标体积，命令会直接报错。\n\n### 批量处理\n\n批量放大：\n\n```bash\npython scripts/upscale.py input-folder --output output-folder --target 4k\n```\n\n批量压缩，包括子目录：\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive\n```\n\n先预览批量任务，不写入文件：\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive --dry-run\n```\n\n### 检查图片信息\n\n```bash\npython scripts/inspect.py input.png\npython scripts/inspect.py input-folder --recursive --json\n```\n\n检查结果包括尺寸、宽高比、百万像素和文件体积。\n\n### 国内镜像与离线模式\n\n可以通过环境变量指定一个或多个镜像前缀：\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\n即使使用镜像或自定义缓存目录，下载以及每次执行时都必须通过固定 SHA-256 校验。请只把镜像和缓存环境变量指向可信位置。禁止网络访问时使用：\n\n```bash\npython scripts/setup.py --offline\n```\n\n### 注意事项\n\n- AI 增强会重建纹理，不代表恢复了原始图片中不存在的真实信息。\n- 8K 处理需要较多显存、内存和临时磁盘空间。\n- 当前模型原生放大倍率为 4×；当目标 8K 超过原生 4×尺寸时，额外像素来自高质量缩放，不代表恢复了新的真实细节。\n- 显存不足时依次尝试 `--tile 256` 和 `--tile 128`。\n- JPEG 压缩不保留透明通道；如果背景颜色很重要，请先明确转换背景。\n- 除非明确传入 `--overwrite`，压缩工具不会覆盖已有输出。\n\n### 联系方式\n\n更多 Skill 定制或功能需求，可以联系大瑜：`helloaigc2023`。\n\n---\n\n## English\n\n### Overview\n\nLocal Image Upscaler is a local image-enhancement Skill for macOS and Windows x64. It uses local AI models to upscale images, export resolution presets, compress images to strict file-size targets, and inspect image properties before processing. Images are never uploaded, and source files are not overwritten by default.\n\n### Features\n\n- High-fidelity AI upscaling for photos, screenshots, and AI-generated artwork\n- Automatic profile recommendations with user-selectable default, fast, photo, portrait, digital-art, and sharp-detail modes\n- Clear advantages, limitations, and incremental storage before each optional model download\n- `1K`, `2K`, `4K`, and `8K` presets\n- Custom long-edge sizes without stretching\n- Native 4× model output\n- Strict file-size targets, such as compressing an approximately 1MB image to 200KB or less\n- Quality-first compression with proportional resizing only when necessary\n- Single-image and folder batch processing\n- Image dimension, aspect-ratio, megapixel, and file-size inspection\n- macOS and Windows x64 support\n- Mirror fallback for restricted networks, offline caching, and SHA-256 verification\n\n### Supported Formats\n\n- Input: JPG, JPEG, PNG, WebP\n- Upscale output: PNG, JPG, WebP (exact-size WebP has platform limitations)\n- Target-size compression output: JPEG\n\n### Choose an Algorithm\n\nWhen the user does not specify an algorithm, the Skill visually inspects the image and recommends a profile. If the user declines to choose, it uses the conservative default. Generative face restoration is never enabled silently.\n\n| Profile | Best for | Advantage | Limitation | First download |\n| --- | --- | --- | --- | ---: |\n| `default` | Unknown or mixed images | Balanced and conservative | Does not maximize sharpness | ~32MB |\n| `fast` | Previews, batches, low-spec devices | Fastest and smallest | Reconstructs less detail | ~2.5MB |\n| `photo` | Natural photographs | Natural texture and tonal transitions | Softer hard edges | ~32MB |\n| `portrait` | Noisy, compressed, or rough natural portraits | Avoids face replacement and renders smoother transitions | Can remove fine detail from clean AI portraits | Shared with photo |\n| `digital-art` | Anime, illustration, icons | Clean edges and compact model | Can simplify photographic texture | ~8.6MB |\n| `sharp` | Architecture, products, game assets | Strongest apparent sharpness | Can amplify noise, halos, and skin texture | ~32MB |\n\nList models, trade-offs, cache state, and incremental downloads without installing anything:\n\n```bash\npython scripts/setup.py --list-models\n```\n\nDo not select the portrait profile merely because a person is present. Prefer `default` for clean AI portraits and studio headshots; recommend `portrait` only when a natural portrait is noisy, compressed, or texturally rough.\n\n### Prepare the Runtime\n\nRun this command from the Skill directory:\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\nUse the smaller model for previews or lower-spec devices:\n\n```bash\npython scripts/setup.py --model lite\n```\n\nPrepare only a selected profile:\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\nThe first setup downloads a pinned Upscayl NCNN runtime and model files and verifies every artifact with SHA-256. Every upscale also re-verifies the cached executable and selected model before execution, allowing safer offline reuse.\n\n### Upscale to a Resolution Preset\n\n```bash\npython scripts/upscale.py input.png --target 1k\npython scripts/upscale.py input.png --target 2k\npython scripts/upscale.py input.png --target 4k\npython scripts/upscale.py input.png --target 8k --tile 256\n```\n\nChoose an algorithm profile explicitly:\n\n```bash\npython scripts/upscale.py input.png --target 4k --profile portrait\npython scripts/upscale.py input.png --target 4k --profile digital-art\npython scripts/upscale.py input.png --target 4k --profile sharp\n```\n\nPresets refer to the image's long edge:\n\n- 1K: 1920 pixels\n- 2K: 2560 pixels\n- 4K: 3840 pixels\n- 8K: 7680 pixels\n\nThe source aspect ratio is always preserved. A 16:9 image becomes 3840×2160 at 4K, while a square image becomes 3840×3840.\n\nUse a custom long edge:\n\n```bash\npython scripts/upscale.py input.png --max-edge 3000\n```\n\nKeep the model's native 4× output:\n\n```bash\npython scripts/upscale.py input.png --target scale4\n```\n\n### Compress to a Target File Size\n\nCompress an image to 200KB or less:\n\n```bash\npython scripts/compress.py input.png --output output.jpg --target-kb 200\n```\n\nCompress an image to 1.5MB or less:\n\n```bash\npython scripts/compress.py input.png --target-mb 1.5\n```\n\nAdjust quality only and keep the original dimensions:\n\n```bash\npython scripts/compress.py input.png --target-kb 200 --keep-dimensions\n```\n\nThe command fails clearly if the target cannot be reached at the original dimensions.\n\n### Batch Processing\n\nBatch upscale a folder:\n\n```bash\npython scripts/upscale.py input-folder --output output-folder --target 4k\n```\n\nRecursively compress a folder:\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive\n```\n\nPreview a batch job without writing files:\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive --dry-run\n```\n\n### Inspect Images\n\n```bash\npython scripts/inspect.py input.png\npython scripts/inspect.py input-folder --recursive --json\n```\n\nThe report includes dimensions, simplified aspect ratio, megapixels, and file size.\n\n### Mirrors and Offline Mode\n\nConfigure one or more mirror prefixes through an environment variable:\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\nArtifacts from mirrors and custom cache directories must pass the same pinned SHA-256 checks both at download and execution time. Point mirror and cache environment variables only to trusted locations. To forbid network access:\n\n```bash\npython scripts/setup.py --offline\n```\n\n### Notes\n\n- AI enhancement reconstructs texture; it cannot recover factual detail that was absent from the source.\n- 8K processing requires substantial GPU memory, system memory, and temporary disk space.\n- Bundled models are native 4× upscalers. When an 8K target exceeds native 4× output, the extra pixels come from high-quality resizing and are not newly recovered factual detail.\n- On GPU-memory errors, try `--tile 256`, then `--tile 128`.\n- JPEG compression does not preserve transparency; convert the background explicitly first when its color matters.\n- Existing outputs are not overwritten unless `--overwrite` is explicitly supplied.\n\n### Contact\n\nFor more Skill customization or feature requests, contact Dayu: `helloaigc2023`.\n\nFile v1.2.2:_meta.json\n\n{\n  \"ownerId\": \"kn72j0qng9f6mm49z983cyzw1982naag\",\n  \"slug\": \"local-image-upscaler\",\n  \"version\": \"1.2.2\",\n  \"publishedAt\": 1784713932907\n}\n\nFile v1.2.2:references/algorithms.md\n\n# Algorithm Profiles\n\n## Selection policy\n\nInspect the image visually before invoking the script. Recommend a profile and state its advantage, disadvantage, and uncached download size. If the user does not choose, use `default`. Never enable generative face restoration silently.\n\n| Profile | Model | Best use | Advantage | Limitation | Download |\n| --- | --- | --- | --- | --- | ---: |\n| `default` | high-fidelity-4x | Unknown or mixed images | Balanced and conservative | Does not maximize any one content type | ~32 MB |\n| `fast` | upscayl-lite-4x | Preview and batch processing | Fastest and smallest | Less reconstructed detail | ~2.5 MB |\n| `photo` | remacri-4x | Natural photographs | Smooth tonal transitions and natural texture | Softer than `sharp` on hard edges | ~32 MB |\n| `portrait` | remacri-4x | Noisy, compressed, or rough natural portraits | Avoids generative face replacement and smooths transitions | Can remove skin and eyelash detail from clean AI portraits | Shared with `photo` |\n| `digital-art` | digital-art-4x | Anime, illustration, icons | Clean synthetic edges, compact model | Can flatten photographic texture | ~8.6 MB |\n| `sharp` | ultrasharp-4x | Architecture, products, game assets | Strongest apparent edge detail | Can amplify noise, halos, pores, and text artifacts | ~32 MB |\n\n`auto` means the agent selects a profile after visual inspection. The standalone CLI has no bundled vision classifier; it uses explicit filename hints for digital art and otherwise falls back to `default`.\n\nDo not route by subject alone. A same-size comparison on a clean AI portrait showed that `default` retained more eyelashes, eyebrows, and skin texture, while `portrait` produced smoother skin and a smaller output. Route clean AI and studio portraits to `default`; reserve `portrait` for degraded natural portraits.\n\n## 8K behavior\n\nThe bundled models produce a native 4× result. Exact 1K/2K/4K/8K presets then resize that result to the requested long edge. If the requested 8K dimensions exceed native 4× output, the extra pixels are interpolation rather than newly recovered factual detail. Prefer a clearly labeled comparison crop when evaluating results.\n\n## Heavy optional algorithms\n\nDo not install these by default:\n\n- SwinIR or HAT: transformer restoration with stronger benchmark reconstruction, but requires a substantially larger PyTorch environment and slower inference.\n- CodeFormer or GFPGAN: face restoration that can improve damaged portraits, but may change identity. Require explicit user consent and expose fidelity controls.\n- SUPIR: diffusion restoration with strong perceived detail, but high GPU-memory use, slow inference, generative hallucination risk, and non-commercial-use restrictions in the upstream project.\n\nKeep heavy algorithms in separate optional adapters and report their complete environment, model, temporary-file, and output storage costs before installation.\n\nFile v1.2.2:references/licenses.md\n\n# Upstream Licenses and Attribution\n\nThis Skill's scripts and instructions do not bundle third-party executables or model weights. Setup downloads the following pinned upstream artifacts on demand:\n\n- Upscayl NCNN command-line runtime: <https://github.com/upscayl/upscayl-ncnn>\n- Upscayl model files, including High Fidelity, Lite, Digital Art, Remacri, and Ultrasharp profiles: <https://github.com/upscayl/upscayl/tree/main/resources/models>\n\nUpscayl is distributed under the GNU Affero General Public License v3.0. Review the upstream license and each model's provenance before redistributing downloaded runtime or model files; model availability in the upstream repository does not erase separate upstream model terms. Keep all applicable notices with redistributed copies. This Skill downloads models on demand and does not change upstream license terms.\n\nFile v1.2.2:references/platforms.md\n\n# Platform and Storage Reference\n\n## Supported systems\n\n- macOS 12 or newer on Apple Silicon or Intel. The runtime is a universal binary and uses Metal through MoltenVK.\n- Windows 10/11 x64 with a Vulkan-capable GPU and current graphics driver.\n- Windows ARM is not supported by the pinned runtime. x64 emulation does not guarantee Vulkan compatibility.\n- Linux is intentionally omitted from version 1.0 to keep the tested support surface focused.\n\n## Approximate storage\n\nThe Skill itself is under 1 MB. Cached components use approximately:\n\n- macOS runtime: 9 MB download plus 28 MB extracted.\n- Windows runtime: 2.5 MB download plus 8 MB extracted.\n- High-fidelity model: 34 MB.\n- Lite model: 2.5 MB.\n- Digital-art model: 8.6 MB.\n- Natural photo/portrait model: 32 MB (one shared model for both profiles).\n- Sharp-detail model: 32 MB.\n- Installing every bundled model adds about 100 MB of model data; models are downloaded individually by default.\n- Output images: varies; lossless 4K PNG files are commonly 5–30 MB each.\n\nThe cache is stored in `~/.cache/image-upscaler` on macOS and `%LOCALAPPDATA%\\image-upscaler` on Windows. Override it with `IMAGE_UPSCALER_CACHE`.\n\n## Download order\n\n1. Existing verified cache.\n2. Prefixes in `IMAGE_UPSCALER_MIRRORS`, in the supplied order.\n3. The bundled GitHub acceleration prefix.\n4. Official GitHub or raw GitHub URL.\n\nAll paths use the same pinned SHA-256 digests. Setup verifies downloads and extracted executables; every upscale re-verifies the cached executable and selected model before execution. A mirror or replaced cache file cannot substitute a modified binary or model without being rejected.\n\nFor a private mirror, mirror the exact upstream URL hierarchy and set a prefix, or use a prefix containing `{url}`. Example: `https://mirror.example/fetch?url={url}`.\n\n## Troubleshooting\n\n- `Unsupported platform`: use macOS or Windows x64.\n- `All download sources failed`: set `IMAGE_UPSCALER_MIRRORS` to a reachable internal/domestic proxy, or prefill the cache on a connected machine.\n- `SHA-256 mismatch`: do not continue. Remove only the named `.part` or cached artifact and retry from another source.\n- Vulkan or GPU error: update the graphics driver and verify Vulkan support. Virtual machines often lack sufficient Vulkan passthrough.\n- Out of GPU memory: retry `upscale.py` with `--tile 256`, then `--tile 128`.\n- Slow processing: use `--model lite`, avoid `--tta`, and process files one at a time.\n- Unsure which model is cached or how large it is: run `python scripts/setup.py --list-models` before downloading.\n- Exact WebP resizing is intentionally not performed through platform APIs. Use PNG/JPEG for exact 2K/4K dimensions, or WebP with `--target scale4`.\n\nFile v1.2.2:skill-card.md\n\n## Description:\n\nUpscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-detail, balanced, and fast profiles; 1K/2K/4K/8K output; custom long edges; strict target file sizes; batch folders; aspect-ratio preservation; offline reuse; and verified download fallbacks.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[harven-droid](https://clawhub.ai/user/harven-droid)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users and developers use this skill to inspect local images, select an enhancement profile, upscale images to resolution presets or custom long edges, batch process folders, and compress images to target file sizes while keeping processing local.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill downloads and runs a pinned native image-processing runtime and model files.\n\nMitigation: Use trusted cache and mirror locations only, keep SHA-256 verification enabled, and prefer offline mode after setup when downloads are no longer needed.\n\nRisk: Batch image processing can affect many local files if pointed at the wrong folder.\n\nMitigation: Run it only on intended image folders, use dry-run for compression batches, and rely on the default non-overwrite behavior unless replacement is explicitly intended.\n\nRisk: AI upscaling reconstructs texture and can create plausible-looking detail that was not present in the source image.\n\nMitigation: Describe enhanced results as reconstruction, not factual recovery, and use comparison crops when quality claims matter.\n\nRisk: Large 8K jobs may fail or consume substantial GPU memory, system memory, and temporary disk space.\n\nMitigation: Check platform support and available storage before processing, then retry GPU-memory failures with smaller tile sizes such as 256 or 128.\n\n## Reference(s):\n\n- [Algorithm Profiles](references/algorithms.md)\n- [Platform and Storage Reference](references/platforms.md)\n- [Upstream Licenses and Attribution](references/licenses.md)\n- [Upscayl NCNN command-line runtime](https://github.com/upscayl/upscayl-ncnn)\n- [Upscayl model files](https://github.com/upscayl/upscayl/tree/main/resources/models)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, shell commands, files, configuration]\n\n**Output Format:** [Markdown guidance with bash commands; generated image files and optional JSON inspection reports]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Processes local JPG, PNG, and WebP inputs; writes PNG, JPG, or WebP upscales and JPEG compressed outputs without overwriting by default.]\n\n## Skill Version(s):\n\n1.2.2 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.2.2:assets/manifest.json\n\n{\n  \"schema_version\": 1,\n  \"runtime_version\": \"20251207-174704\",\n  \"default_mirror_prefixes\": [\n    \"https://ghfast.top/\"\n  ],\n  \"platforms\": {\n    \"darwin-universal\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-macos.zip\",\n      \"sha256\": \"277419791281a56eae0c739c70120b974d7267cf7c2de8e86dc09798d4b314db\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-macos\",\n      \"executable\": \"upscayl-bin\",\n      \"executable_sha256\": \"b7f54f362fc10d5f334e587fb90917e95a5557ec1cfefbddce78657dd3fee055\"\n    },\n    \"windows-x64\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-windows.zip\",\n      \"sha256\": \"1f0f65c5d2ade866555e2ac467d35952c35a47080a4060fe56a1ab028f67258a\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-windows\",\n      \"executable\": \"upscayl-bin.exe\",\n      \"executable_sha256\": \"294d31be8f29d047c0d91a8dcd5e739616ece56bce3188ac688f9a52d70abe60\"\n    }\n  },\n  \"models\": {\n    \"high-fidelity\": {\n      \"engine_name\": \"high-fidelity-4x\",\n      \"download_bytes\": 33532559,\n      \"label\": \"Balanced / Default\",\n      \"best_for\": \"general photos, AI-generated images, and conservative enhancement\",\n      \"tradeoff\": \"balanced output; less aggressive than the sharp profile\",\n      \"files\": [\n        {\n          \"name\": \"high-fidelity-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.bin\",\n          \"sha256\": \"8a135402b4f39286121b76abb47601a6b7b7e8d4f3e999a5aaa45ed277824fb4\"\n        },\n        {\n          \"name\": \"high-fidelity-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.param\",\n          \"sha256\": \"4576ed5c2fc5fa250d3c3d585ef02248f26abdfc1867088078f501fe71e5d61e\"\n        }\n      ]\n    },\n    \"lite\": {\n      \"engine_name\": \"upscayl-lite-4x\",\n      \"download_bytes\": 2440291,\n      \"label\": \"Fast / Lite\",\n      \"best_for\": \"previews, batch work, and low-memory devices\",\n      \"tradeoff\": \"smallest download and fastest processing, but reconstructs less fine detail\",\n      \"files\": [\n        {\n          \"name\": \"upscayl-lite-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.bin\",\n          \"sha256\": \"85ee266b632a765a725425ba6a5620c088c8aa2939a03063b2d83b3462724cc1\"\n        },\n        {\n          \"name\": \"upscayl-lite-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.param\",\n          \"sha256\": \"22174924330297357434ad21ed0af7f4b820008d2a502b492754d130d4142714\"\n        }\n      ]\n    },\n    \"digital-art\": {\n      \"engine_name\": \"digital-art-4x\",\n      \"download_bytes\": 8973790,\n      \"label\": \"Digital Art\",\n      \"best_for\": \"anime, illustrations, icons, and clean synthetic edges\",\n      \"tradeoff\": \"compact and clean on artwork, but may oversimplify photographic texture\",\n      \"files\": [\n        {\n          \"name\": \"digital-art-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/digital-art-4x.bin\",\n          \"sha256\": \"fe01c269cfd10cdef8e018ab66ebe750cf79c7af4d1f9c16c737e1295229bacc\"\n        },\n        {\n          \"name\": \"digital-art-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/digital-art-4x.param\",\n          \"sha256\": \"2b8fb6e0ae4d2d85704ca08c119a2f5ea40add4f2ecd512eb7f4cd44b6127ed4\"\n        }\n      ]\n    },\n    \"remacri\": {\n      \"engine_name\": \"remacri-4x\",\n      \"download_bytes\": 33564815,\n      \"label\": \"Natural Photo / Portrait\",\n      \"best_for\": \"natural photos and portraits where identity and smooth tonal transitions matter\",\n      \"tradeoff\": \"more natural rendering, but less crisp than the sharp profile on text and architecture\",\n      \"files\": [\n        {\n          \"name\": \"remacri-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/remacri-4x.bin\",\n          \"sha256\": \"a43be595c0d743314c30b50fe7ef188be0c61cc55c46ce81adb79ba4b3c3fb7a\"\n        },\n        {\n          \"name\": \"remacri-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/remacri-4x.param\",\n          \"sha256\": \"859ecba5b3592ecf3e76c93bed65e9f627b5236dd696aae5a84ecf8c93ab65ce\"\n        }\n      ]\n    },\n    \"ultrasharp\": {\n      \"engine_name\": \"ultrasharp-4x\",\n      \"download_bytes\": 33540549,\n      \"label\": \"Sharp Detail\",\n      \"best_for\": \"architecture, products, game assets, and images that benefit from strong edge detail\",\n      \"tradeoff\": \"strongest apparent sharpness, but can exaggerate halos, noise, skin texture, and text artifacts\",\n      \"files\": [\n        {\n          \"name\": \"ultrasharp-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/ultrasharp-4x.bin\",\n          \"sha256\": \"fb3e279d40d4cddb44db4e684d59e68d0aa39852c8cc14dc3f23ccc7e6eee9c1\"\n        },\n        {\n          \"name\": \"ultrasharp-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/ultrasharp-4x.param\",\n          \"sha256\": \"0136ca83686809a8f17f7111f11b951e8db93610e24b7f4137c9ffe4dbc4a806\"\n        }\n      ]\n    }\n  },\n  \"profiles\": {\n    \"auto\": {\n      \"model\": \"high-fidelity\",\n      \"description\": \"Agent-inspected automatic recommendation; conservatively falls back to the balanced model\"\n    },\n    \"default\": {\n      \"model\": \"high-fidelity\",\n      \"description\": \"Balanced, conservative output for unknown or mixed content\"\n    },\n    \"fast\": {\n      \"model\": \"lite\",\n      \"description\": \"Lowest download, memory use, and processing time\"\n    },\n    \"photo\": {\n      \"model\": \"remacri\",\n      \"description\": \"Natural photographic texture and tonal transitions\"\n    },\n    \"portrait\": {\n      \"model\": \"remacri\",\n      \"description\": \"Smoother rendering for noisy, compressed, or rough natural portraits without generative face replacement; use default for clean AI portraits\"\n    },\n    \"digital-art\": {\n      \"model\": \"digital-art\",\n      \"description\": \"Clean edges for anime, illustrations, and icons\"\n    },\n    \"sharp\": {\n      \"model\": \"ultrasharp\",\n      \"description\": \"Aggressive apparent detail for architecture and products\"\n    }\n  }\n}\n\nFile v1.2.2:agents/openai.yaml\n\ninterface:\n  display_name: \"Local Image Upscaler\"\n  short_description: \"Choose local AI models, upscale to 8K, and compress images\"\n  default_prompt: \"Use $image-upscaler to recommend a local enhancement profile, explain its trade-offs and download size, then upscale or compress this image.\"\n\nArchive v1.2.1: 13 files, 30023 bytes\n\nFiles: agents/openai.yaml (293b), assets/manifest.json (6195b), README.md (12587b), references/algorithms.md (2923b), references/licenses.md (859b), references/platforms.md (2566b), scripts/compress.py (11324b), scripts/inspect.py (2061b), scripts/setup.py (10818b), scripts/upscale.py (14072b), skill-card.md (3111b), SKILL.md (8058b), _meta.json (139b)\n\nFile v1.2.1:SKILL.md\n\n---\nname: image-upscaler\ndescription: Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-detail, balanced, and fast profiles; 1K/2K/4K/8K output; custom long edges; strict target file sizes; batch folders; aspect-ratio preservation; offline reuse; and verified download fallbacks. Use when the user asks to make an image clearer, enlarge AI-generated art, compare enhancement algorithms, inspect image resolution, upscale without stretching, or reduce a larger image to a target such as 200KB.\n---\n\n# Image Upscaler\n\nUse the bundled Python scripts to run Upscayl's Vulkan-based NCNN engine locally. Download models only when selected. Preserve the source aspect ratio by default and never overwrite an input file.\n\n## Workflow\n\n1. Inspect the input path, file type, dimensions, and available disk space.\n2. Inspect the image visually and recommend one profile. If the choice materially affects the result, give the user a compact choice with the advantage, disadvantage, and additional download size. Do not block if the user does not choose; use `default`.\n3. Choose a profile:\n   - `default`: balanced and conservative; use when content is mixed or uncertain. Model download: about 32 MB.\n   - `fast`: smallest and fastest; weaker fine-detail reconstruction. Model download: about 2.5 MB.\n   - `photo`: natural photographic texture; less crisp on text and architecture. Model download: about 32 MB.\n   - `portrait`: use for compressed, noisy, or rough natural portraits that benefit from smoother rendering. It avoids face replacement but can remove fine skin texture. Use `default` for already-clean AI portraits and sharp studio headshots. Model download: about 32 MB, shared with `photo`.\n   - `digital-art`: clean anime, illustration, and icon edges; may oversimplify photographic texture. Model download: about 8.6 MB.\n   - `sharp`: strongest apparent edge detail; may exaggerate noise, halos, skin, or text artifacts. Model download: about 32 MB.\n4. If the selected runtime or model is not cached, explain the download and disk cost, then run setup. Read [platforms.md](references/platforms.md) for compatibility and cache sizes.\n5. Run the upscaler or compressor. Prefer PNG for maximum upscale quality; use JPEG for strict file-size targets.\n6. Verify that the output exists, has the requested dimensions, and keeps the source ratio. Report the selected profile, output path, dimensions, and file size.\n\nThe agent performs the meaningful automatic selection after visually inspecting the image. CLI `--profile auto` uses filename hints only and otherwise falls back conservatively to `default`; it does not claim reliable face or scene classification without an extra vision package. Read [algorithms.md](references/algorithms.md) when comparing profiles or discussing heavier optional algorithms.\n\nFor portraits, inspect source quality before selecting by subject alone: choose `default` for clean AI-generated or studio portraits; choose `portrait` only when a natural portrait is noisy, compressed, or visually rough. This rule is based on same-size comparison testing, where `portrait` produced smoother skin but removed detail from an already-clean AI portrait.\n\n## Prepare the Runtime\n\nRun from this skill directory:\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\nList choices, trade-offs, cache status, and incremental downloads without installing anything:\n\n```bash\npython scripts/setup.py --list-models\n```\n\nPrepare only the selected profile:\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\nThe downloader tries the local cache, configured mirrors, a verified GitHub acceleration endpoint, and the official source. Every downloaded artifact must match the pinned SHA-256 digest. To use an organization or domestic mirror, set `IMAGE_UPSCALER_MIRRORS` to one or more comma-separated URL prefixes before setup. Each prefix is prepended to the official URL. Example:\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\nUse `--offline` to forbid all network access. Use `--platform windows-x64 --download-only` to prefetch Windows files from another machine.\n\n## Upscale Images\n\nCreate a 4K image whose long edge is 3840 pixels while preserving the original ratio:\n\n```bash\npython scripts/upscale.py INPUT --output OUTPUT.png --target 4k\n```\n\nUseful variants:\n\n```bash\npython scripts/upscale.py INPUT --target 1k\npython scripts/upscale.py INPUT --target 2k --profile fast\npython scripts/upscale.py INPUT --target 4k --profile portrait\npython scripts/upscale.py INPUT --target 4k --profile digital-art\npython scripts/upscale.py INPUT --target 4k --profile sharp\npython scripts/upscale.py INPUT --target 8k --profile photo --tile 256\npython scripts/upscale.py INPUT --target scale4 --format png\npython scripts/upscale.py INPUT_FOLDER --output OUTPUT_FOLDER --target 4k\npython scripts/upscale.py INPUT --target 4k --format jpg --compression 92\n```\n\nThe screen-oriented presets use long edges: `1k=1920`, `2k=2560`, `4k=3840`, and `8k=7680`. A 16:9 4K landscape becomes 3840×2160; portraits and squares retain their own ratios. `scale4` keeps the model's native 4× output. Use `--max-edge N` for an exact custom long edge. Current local models are native 4× models; an 8K preset beyond the native result uses exact high-quality resizing and must not be described as recovered factual detail. For 8K, expect high memory and temporary-disk use; start with `--tile 256` if automatic tiling fails.\n\nExact 2K/4K output supports PNG and JPEG without extra dependencies. WebP is supported with `--target scale4`; use PNG when an exact target and transparency both matter.\n\n## Compress to a Target Size\n\nCompress a roughly 1MB image to no more than 200KiB:\n\n```bash\npython scripts/compress.py INPUT --output OUTPUT.jpg --target-kb 200\npython scripts/compress.py INPUT --target-mb 1.5 --keep-dimensions\npython scripts/compress.py INPUT_FOLDER --output OUTPUT_FOLDER --target-kb 200 --recursive\n```\n\nThe compressor first finds the highest JPEG quality that fits. If quality alone is insufficient, it reduces dimensions proportionally while respecting `--min-edge` (default 640px). It never stretches or overwrites the source. JPEG does not preserve transparency; convert the background explicitly before compression when its color matters.\n\nUse `--keep-dimensions` when reducing resolution is forbidden. Existing output files receive a `-v2`, `-v3`, and so on suffix unless `--overwrite` is explicitly supplied. Use `--dry-run` before a large folder job.\n\n## Inspect Before Processing\n\nInspect one file or a folder before choosing an upscale or compression target:\n\n```bash\npython scripts/inspect.py INPUT\npython scripts/inspect.py INPUT_FOLDER --recursive --json\n```\n\nThe report includes dimensions, simplified aspect ratio, megapixels, and file size.\n\n## Safety and Quality Rules\n\n- Never delete or replace source images.\n- Do not install GPU drivers, package managers, or system dependencies automatically.\n- Do not bypass SHA-256 verification, even when using a mirror.\n- Do not upload user images; processing must stay local.\n- Avoid TTA unless the user explicitly accepts a roughly 8× processing slowdown.\n- On GPU-memory errors, retry with `--tile 256`, then `--tile 128`.\n- If Vulkan is unavailable, stop and explain the platform limitation; do not silently switch to an unrelated cloud service.\n- Treat visual enhancement as reconstruction, not recovery of factual detail. Do not claim that invented texture is original information.\n\n## References\n\n- Read [platforms.md](references/platforms.md) for supported systems, storage, cache, mirror, and troubleshooting details.\n- Read [algorithms.md](references/algorithms.md) for profile selection, benefits, limitations, and optional heavy algorithms.\n- Read [licenses.md](references/licenses.md) before redistributing the engine or model files.\n\nFile v1.2.1:README.md\n\n# Local Image Upscaler / 本地图像增强工具\n\n## 中文\n\n### 简介\n\nLocal Image Upscaler 是一个面向 macOS 和 Windows x64 的本地图像增强 Skill。它可以使用本地 AI 模型放大图片、按指定分辨率输出、将图片压缩到目标体积，并在处理前检查图片信息。图片不会上传到云端，源文件默认不会被覆盖。\n\n### 主要功能\n\n- AI 高保真放大，适合照片、截图和 AI 生成图片\n- 根据图片自动推荐算法，也可由用户选择默认、快速、照片、人像、插画或锐利细节模式\n- 每种算法在下载前说明优点、缺点和新增空间，模型按需下载\n- `1K`、`2K`、`4K`、`8K` 分辨率预设\n- 自定义长边尺寸，不拉伸原图\n- 原生 4× 放大\n- 严格控制目标体积，例如将约 1MB 图片压缩到 200KB 以内\n- 压缩时优先保留尺寸和画质，必要时才等比例缩小\n- 单张图片与文件夹批量处理\n- 图片尺寸、比例、像素和体积检查\n- macOS 与 Windows x64 支持\n- 国内网络镜像回退、离线缓存和 SHA-256 完整性校验\n\n### 支持格式\n\n- 输入：JPG、JPEG、PNG、WebP\n- 放大输出：PNG、JPG、WebP（WebP 精确尺寸存在平台限制）\n- 目标体积压缩输出：JPEG\n\n### 算法怎么选\n\n如果用户没有指定，Skill 会先观察图片并推荐模式；用户不想选择时使用保守的默认模式。人脸生成式修复不会自动开启。\n\n| 模式 | 适合 | 优点 | 缺点 | 首次下载 |\n| --- | --- | --- | --- | ---: |\n| `default` | 类型不确定或混合图片 | 均衡、保守 | 不追求最强锐度 | 约 32MB |\n| `fast` | 预览、批处理、低配置设备 | 最快、最小 | 细节重建较弱 | 约 2.5MB |\n| `photo` | 自然照片 | 质感和明暗过渡自然 | 硬边不如锐利模式 | 约 32MB |\n| `portrait` | 有噪点、压缩或较粗糙的真实人像 | 不替换五官，过渡更柔和 | 会抹掉清晰AI人像的部分皮肤细节 | 与照片模式共用 |\n| `digital-art` | 动漫、插画、图标 | 线条干净、模型小 | 可能简化照片纹理 | 约 8.6MB |\n| `sharp` | 建筑、商品、游戏素材 | 视觉锐度最强 | 可能放大噪点、光晕和皮肤纹理 | 约 32MB |\n\n查看模型、缓存状态和增量下载空间，不会安装任何内容：\n\n```bash\npython scripts/setup.py --list-models\n```\n\n不要仅因为画面中有人就选择人像模式：清晰AI人像和棚拍头像优先用 `default`；只有真实人像存在噪点、压缩或纹理粗糙时才推荐 `portrait`。\n\n### 准备运行环境\n\n进入 Skill 目录后运行：\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\n快速预览或低配置设备可以使用轻量模型：\n\n```bash\npython scripts/setup.py --model lite\n```\n\n也可以只准备选中的模式：\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\n首次运行会下载固定版本的 Upscayl NCNN 运行时和模型，并进行 SHA-256 校验。后续可以离线复用缓存。\n\n### 放大到指定分辨率\n\n```bash\npython scripts/upscale.py input.png --target 1k\npython scripts/upscale.py input.png --target 2k\npython scripts/upscale.py input.png --target 4k\npython scripts/upscale.py input.png --target 8k --tile 256\n```\n\n指定算法模式：\n\n```bash\npython scripts/upscale.py input.png --target 4k --profile portrait\npython scripts/upscale.py input.png --target 4k --profile digital-art\npython scripts/upscale.py input.png --target 4k --profile sharp\n```\n\n分辨率预设指图片长边：\n\n- 1K：1920 像素\n- 2K：2560 像素\n- 4K：3840 像素\n- 8K：7680 像素\n\n原图比例始终保留。例如，16:9 图片输出为 4K 时是 3840×2160；正方形图片则是 3840×3840。\n\n自定义长边：\n\n```bash\npython scripts/upscale.py input.png --max-edge 3000\n```\n\n保留模型原生 4×结果：\n\n```bash\npython scripts/upscale.py input.png --target scale4\n```\n\n### 压缩到目标体积\n\n将图片压缩到不超过 200KB：\n\n```bash\npython scripts/compress.py input.png --output output.jpg --target-kb 200\n```\n\n将图片压缩到不超过 1.5MB：\n\n```bash\npython scripts/compress.py input.png --target-mb 1.5\n```\n\n只调整质量，不允许降低尺寸：\n\n```bash\npython scripts/compress.py input.png --target-kb 200 --keep-dimensions\n```\n\n如果保持原尺寸无法达到目标体积，命令会直接报错。\n\n### 批量处理\n\n批量放大：\n\n```bash\npython scripts/upscale.py input-folder --output output-folder --target 4k\n```\n\n批量压缩，包括子目录：\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive\n```\n\n先预览批量任务，不写入文件：\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive --dry-run\n```\n\n### 检查图片信息\n\n```bash\npython scripts/inspect.py input.png\npython scripts/inspect.py input-folder --recursive --json\n```\n\n检查结果包括尺寸、宽高比、百万像素和文件体积。\n\n### 国内镜像与离线模式\n\n可以通过环境变量指定一个或多个镜像前缀：\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\n即使使用镜像，所有文件仍必须通过固定 SHA-256 校验。禁止网络访问时使用：\n\n```bash\npython scripts/setup.py --offline\n```\n\n### 注意事项\n\n- AI 增强会重建纹理，不代表恢复了原始图片中不存在的真实信息。\n- 8K 处理需要较多显存、内存和临时磁盘空间。\n- 当前模型原生放大倍率为 4×；当目标 8K 超过原生 4×尺寸时，额外像素来自高质量缩放，不代表恢复了新的真实细节。\n- 显存不足时依次尝试 `--tile 256` 和 `--tile 128`。\n- JPEG 压缩不保留透明通道；如果背景颜色很重要，请先明确转换背景。\n- 除非明确传入 `--overwrite`，压缩工具不会覆盖已有输出。\n\n### 联系方式\n\n更多 Skill 定制或功能需求，可以联系大瑜：`helloaigc2023`。\n\n---\n\n## English\n\n### Overview\n\nLocal Image Upscaler is a local image-enhancement Skill for macOS and Windows x64. It uses local AI models to upscale images, export resolution presets, compress images to strict file-size targets, and inspect image properties before processing. Images are never uploaded, and source files are not overwritten by default.\n\n### Features\n\n- High-fidelity AI upscaling for photos, screenshots, and AI-generated artwork\n- Automatic profile recommendations with user-selectable default, fast, photo, portrait, digital-art, and sharp-detail modes\n- Clear advantages, limitations, and incremental storage before each optional model download\n- `1K`, `2K`, `4K`, and `8K` presets\n- Custom long-edge sizes without stretching\n- Native 4× model output\n- Strict file-size targets, such as compressing an approximately 1MB image to 200KB or less\n- Quality-first compression with proportional resizing only when necessary\n- Single-image and folder batch processing\n- Image dimension, aspect-ratio, megapixel, and file-size inspection\n- macOS and Windows x64 support\n- Mirror fallback for restricted networks, offline caching, and SHA-256 verification\n\n### Supported Formats\n\n- Input: JPG, JPEG, PNG, WebP\n- Upscale output: PNG, JPG, WebP (exact-size WebP has platform limitations)\n- Target-size compression output: JPEG\n\n### Choose an Algorithm\n\nWhen the user does not specify an algorithm, the Skill visually inspects the image and recommends a profile. If the user declines to choose, it uses the conservative default. Generative face restoration is never enabled silently.\n\n| Profile | Best for | Advantage | Limitation | First download |\n| --- | --- | --- | --- | ---: |\n| `default` | Unknown or mixed images | Balanced and conservative | Does not maximize sharpness | ~32MB |\n| `fast` | Previews, batches, low-spec devices | Fastest and smallest | Reconstructs less detail | ~2.5MB |\n| `photo` | Natural photographs | Natural texture and tonal transitions | Softer hard edges | ~32MB |\n| `portrait` | Noisy, compressed, or rough natural portraits | Avoids face replacement and renders smoother transitions | Can remove fine detail from clean AI portraits | Shared with photo |\n| `digital-art` | Anime, illustration, icons | Clean edges and compact model | Can simplify photographic texture | ~8.6MB |\n| `sharp` | Architecture, products, game assets | Strongest apparent sharpness | Can amplify noise, halos, and skin texture | ~32MB |\n\nList models, trade-offs, cache state, and incremental downloads without installing anything:\n\n```bash\npython scripts/setup.py --list-models\n```\n\nDo not select the portrait profile merely because a person is present. Prefer `default` for clean AI portraits and studio headshots; recommend `portrait` only when a natural portrait is noisy, compressed, or texturally rough.\n\n### Prepare the Runtime\n\nRun this command from the Skill directory:\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\nUse the smaller model for previews or lower-spec devices:\n\n```bash\npython scripts/setup.py --model lite\n```\n\nPrepare only a selected profile:\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\nThe first setup downloads a pinned Upscayl NCNN runtime and model files, verifies every artifact with SHA-256, and caches them for later offline use.\n\n### Upscale to a Resolution Preset\n\n```bash\npython scripts/upscale.py input.png --target 1k\npython scripts/upscale.py input.png --target 2k\npython scripts/upscale.py input.png --target 4k\npython scripts/upscale.py input.png --target 8k --tile 256\n```\n\nChoose an algorithm profile explicitly:\n\n```bash\npython scripts/upscale.py input.png --target 4k --profile portrait\npython scripts/upscale.py input.png --target 4k --profile digital-art\npython scripts/upscale.py input.png --target 4k --profile sharp\n```\n\nPresets refer to the image's long edge:\n\n- 1K: 1920 pixels\n- 2K: 2560 pixels\n- 4K: 3840 pixels\n- 8K: 7680 pixels\n\nThe source aspect ratio is always preserved. A 16:9 image becomes 3840×2160 at 4K, while a square image becomes 3840×3840.\n\nUse a custom long edge:\n\n```bash\npython scripts/upscale.py input.png --max-edge 3000\n```\n\nKeep the model's native 4× output:\n\n```bash\npython scripts/upscale.py input.png --target scale4\n```\n\n### Compress to a Target File Size\n\nCompress an image to 200KB or less:\n\n```bash\npython scripts/compress.py input.png --output output.jpg --target-kb 200\n```\n\nCompress an image to 1.5MB or less:\n\n```bash\npython scripts/compress.py input.png --target-mb 1.5\n```\n\nAdjust quality only and keep the original dimensions:\n\n```bash\npython scripts/compress.py input.png --target-kb 200 --keep-dimensions\n```\n\nThe command fails clearly if the target cannot be reached at the original dimensions.\n\n### Batch Processing\n\nBatch upscale a folder:\n\n```bash\npython scripts/upscale.py input-folder --output output-folder --target 4k\n```\n\nRecursively compress a folder:\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive\n```\n\nPreview a batch job without writing files:\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive --dry-run\n```\n\n### Inspect Images\n\n```bash\npython scripts/inspect.py input.png\npython scripts/inspect.py input-folder --recursive --json\n```\n\nThe report includes dimensions, simplified aspect ratio, megapixels, and file size.\n\n### Mirrors and Offline Mode\n\nConfigure one or more mirror prefixes through an environment variable:\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\nArtifacts from mirrors must pass the same pinned SHA-256 checks. To forbid network access:\n\n```bash\npython scripts/setup.py --offline\n```\n\n### Notes\n\n- AI enhancement reconstructs texture; it cannot recover factual detail that was absent from the source.\n- 8K processing requires substantial GPU memory, system memory, and temporary disk space.\n- Bundled models are native 4× upscalers. When an 8K target exceeds native 4× output, the extra pixels come from high-quality resizing and are not newly recovered factual detail.\n- On GPU-memory errors, try `--tile 256`, then `--tile 128`.\n- JPEG compression does not preserve transparency; convert the background explicitly first when its color matters.\n- Existing outputs are not overwritten unless `--overwrite` is explicitly supplied.\n\n### Contact\n\nFor more Skill customization or feature requests, contact Dayu: `helloaigc2023`.\n\nFile v1.2.1:_meta.json\n\n{\n  \"ownerId\": \"kn72j0qng9f6mm49z983cyzw1982naag\",\n  \"slug\": \"local-image-upscaler\",\n  \"version\": \"1.2.1\",\n  \"publishedAt\": 1784713725386\n}\n\nFile v1.2.1:references/algorithms.md\n\n# Algorithm Profiles\n\n## Selection policy\n\nInspect the image visually before invoking the script. Recommend a profile and state its advantage, disadvantage, and uncached download size. If the user does not choose, use `default`. Never enable generative face restoration silently.\n\n| Profile | Model | Best use | Advantage | Limitation | Download |\n| --- | --- | --- | --- | --- | ---: |\n| `default` | high-fidelity-4x | Unknown or mixed images | Balanced and conservative | Does not maximize any one content type | ~32 MB |\n| `fast` | upscayl-lite-4x | Preview and batch processing | Fastest and smallest | Less reconstructed detail | ~2.5 MB |\n| `photo` | remacri-4x | Natural photographs | Smooth tonal transitions and natural texture | Softer than `sharp` on hard edges | ~32 MB |\n| `portrait` | remacri-4x | Noisy, compressed, or rough natural portraits | Avoids generative face replacement and smooths transitions | Can remove skin and eyelash detail from clean AI portraits | Shared with `photo` |\n| `digital-art` | digital-art-4x | Anime, illustration, icons | Clean synthetic edges, compact model | Can flatten photographic texture | ~8.6 MB |\n| `sharp` | ultrasharp-4x | Architecture, products, game assets | Strongest apparent edge detail | Can amplify noise, halos, pores, and text artifacts | ~32 MB |\n\n`auto` means the agent selects a profile after visual inspection. The standalone CLI has no bundled vision classifier; it uses explicit filename hints for digital art and otherwise falls back to `default`.\n\nDo not route by subject alone. A same-size comparison on a clean AI portrait showed that `default` retained more eyelashes, eyebrows, and skin texture, while `portrait` produced smoother skin and a smaller output. Route clean AI and studio portraits to `default`; reserve `portrait` for degraded natural portraits.\n\n## 8K behavior\n\nThe bundled models produce a native 4× result. Exact 1K/2K/4K/8K presets then resize that result to the requested long edge. If the requested 8K dimensions exceed native 4× output, the extra pixels are interpolation rather than newly recovered factual detail. Prefer a clearly labeled comparison crop when evaluating results.\n\n## Heavy optional algorithms\n\nDo not install these by default:\n\n- SwinIR or HAT: transformer restoration with stronger benchmark reconstruction, but requires a substantially larger PyTorch environment and slower inference.\n- CodeFormer or GFPGAN: face restoration that can improve damaged portraits, but may change identity. Require explicit user consent and expose fidelity controls.\n- SUPIR: diffusion restoration with strong perceived detail, but high GPU-memory use, slow inference, generative hallucination risk, and non-commercial-use restrictions in the upstream project.\n\nKeep heavy algorithms in separate optional adapters and report their complete environment, model, temporary-file, and output storage costs before installation.\n\nFile v1.2.1:references/licenses.md\n\n# Upstream Licenses and Attribution\n\nThis Skill's scripts and instructions do not bundle third-party executables or model weights. Setup downloads the following pinned upstream artifacts on demand:\n\n- Upscayl NCNN command-line runtime: <https://github.com/upscayl/upscayl-ncnn>\n- Upscayl model files, including High Fidelity, Lite, Digital Art, Remacri, and Ultrasharp profiles: <https://github.com/upscayl/upscayl/tree/main/resources/models>\n\nUpscayl is distributed under the GNU Affero General Public License v3.0. Review the upstream license and each model's provenance before redistributing downloaded runtime or model files; model availability in the upstream repository does not erase separate upstream model terms. Keep all applicable notices with redistributed copies. This Skill downloads models on demand and does not change upstream license terms.\n\nFile v1.2.1:references/platforms.md\n\n# Platform and Storage Reference\n\n## Supported systems\n\n- macOS 12 or newer on Apple Silicon or Intel. The runtime is a universal binary and uses Metal through MoltenVK.\n- Windows 10/11 x64 with a Vulkan-capable GPU and current graphics driver.\n- Windows ARM is not supported by the pinned runtime. x64 emulation does not guarantee Vulkan compatibility.\n- Linux is intentionally omitted from version 1.0 to keep the tested support surface focused.\n\n## Approximate storage\n\nThe Skill itself is under 1 MB. Cached components use approximately:\n\n- macOS runtime: 9 MB download plus 28 MB extracted.\n- Windows runtime: 2.5 MB download plus 8 MB extracted.\n- High-fidelity model: 34 MB.\n- Lite model: 2.5 MB.\n- Digital-art model: 8.6 MB.\n- Natural photo/portrait model: 32 MB (one shared model for both profiles).\n- Sharp-detail model: 32 MB.\n- Installing every bundled model adds about 100 MB of model data; models are downloaded individually by default.\n- Output images: varies; lossless 4K PNG files are commonly 5–30 MB each.\n\nThe cache is stored in `~/.cache/image-upscaler` on macOS and `%LOCALAPPDATA%\\image-upscaler` on Windows. Override it with `IMAGE_UPSCALER_CACHE`.\n\n## Download order\n\n1. Existing verified cache.\n2. Prefixes in `IMAGE_UPSCALER_MIRRORS`, in the supplied order.\n3. The bundled GitHub acceleration prefix.\n4. Official GitHub or raw GitHub URL.\n\nAll paths use the same pinned SHA-256 digests. A mirror cannot substitute a modified binary or model without being rejected.\n\nFor a private mirror, mirror the exact upstream URL hierarchy and set a prefix, or use a prefix containing `{url}`. Example: `https://mirror.example/fetch?url={url}`.\n\n## Troubleshooting\n\n- `Unsupported platform`: use macOS or Windows x64.\n- `All download sources failed`: set `IMAGE_UPSCALER_MIRRORS` to a reachable internal/domestic proxy, or prefill the cache on a connected machine.\n- `SHA-256 mismatch`: do not continue. Remove only the named `.part` or cached artifact and retry from another source.\n- Vulkan or GPU error: update the graphics driver and verify Vulkan support. Virtual machines often lack sufficient Vulkan passthrough.\n- Out of GPU memory: retry `upscale.py` with `--tile 256`, then `--tile 128`.\n- Slow processing: use `--model lite`, avoid `--tta`, and process files one at a time.\n- Unsure which model is cached or how large it is: run `python scripts/setup.py --list-models` before downloading.\n- Exact WebP resizing is intentionally not performed through platform APIs. Use PNG/JPEG for exact 2K/4K dimensions, or WebP with `--target scale4`.\n\nFile v1.2.1:skill-card.md\n\n## Description: <br>\nLocal Image Upscaler helps agents inspect, upscale, resize, batch-process, and compress JPG, PNG, and WebP images locally on macOS or Windows while preserving aspect ratio and using verified download fallbacks. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[harven-droid](https://clawhub.ai/user/harven-droid) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, designers, and content teams use this skill to inspect image properties, choose an upscaling profile, create resolution-targeted outputs, compress images to strict file-size targets, and process folders without uploading source images. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Initial setup downloads a local runtime and selected model files into a cache. <br>\nMitigation: Use trusted mirrors only when configuring IMAGE_UPSCALER_MIRRORS, keep SHA-256 verification enabled, and use offline mode or a prefilled cache when network access is not allowed. <br>\nRisk: Image processing writes output files and can overwrite only when explicitly requested. <br>\nMitigation: Keep the default non-overwrite behavior for routine use, use dry runs for large folder jobs, and pass overwrite options only when replacement is intentional. <br>\nRisk: AI upscaling reconstructs texture and may create plausible detail that was not present in the source image. <br>\nMitigation: Describe enhanced detail as reconstruction, prefer conservative profiles when uncertain, and avoid claiming factual recovery beyond the original image. <br>\nRisk: Large 8K or high-detail jobs may exceed GPU memory or temporary storage. <br>\nMitigation: Start with documented platform requirements, retry memory failures with smaller tile sizes, and choose lighter profiles for constrained devices. <br>\n\n\n## Reference(s): <br>\n- [Algorithm Profiles](references/algorithms.md) <br>\n- [Platform and Storage Reference](references/platforms.md) <br>\n- [Upstream Licenses and Attribution](references/licenses.md) <br>\n- [Upscayl NCNN runtime](https://github.com/upscayl/upscayl-ncnn) <br>\n- [Upscayl model files](https://github.com/upscayl/upscayl/tree/main/resources/models) <br>\n- [ClawHub skill page](https://clawhub.ai/harven-droid/skills/local-image-upscaler) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Shell commands, Configuration, Guidance, Files] <br>\n**Output Format:** [Markdown guidance with shell commands and local image or JSON file outputs] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Outputs stay local by default; dimensions, file size, and format depend on the selected target, profile, and compression settings.] <br>\n\n## Skill Version(s): <br>\n1.2.1 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.2.1:assets/manifest.json\n\n{\n  \"schema_version\": 1,\n  \"runtime_version\": \"20251207-174704\",\n  \"default_mirror_prefixes\": [\n    \"https://ghfast.top/\"\n  ],\n  \"platforms\": {\n    \"darwin-universal\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-macos.zip\",\n      \"sha256\": \"277419791281a56eae0c739c70120b974d7267cf7c2de8e86dc09798d4b314db\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-macos\",\n      \"executable\": \"upscayl-bin\"\n    },\n    \"windows-x64\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-windows.zip\",\n      \"sha256\": \"1f0f65c5d2ade866555e2ac467d35952c35a47080a4060fe56a1ab028f67258a\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-windows\",\n      \"executable\": \"upscayl-bin.exe\"\n    }\n  },\n  \"models\": {\n    \"high-fidelity\": {\n      \"engine_name\": \"high-fidelity-4x\",\n      \"download_bytes\": 33532559,\n      \"label\": \"Balanced / Default\",\n      \"best_for\": \"general photos, AI-generated images, and conservative enhancement\",\n      \"tradeoff\": \"balanced output; less aggressive than the sharp profile\",\n      \"files\": [\n        {\n          \"name\": \"high-fidelity-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.bin\",\n          \"sha256\": \"8a135402b4f39286121b76abb47601a6b7b7e8d4f3e999a5aaa45ed277824fb4\"\n        },\n        {\n          \"name\": \"high-fidelity-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.param\",\n          \"sha256\": \"4576ed5c2fc5fa250d3c3d585ef02248f26abdfc1867088078f501fe71e5d61e\"\n        }\n      ]\n    },\n    \"lite\": {\n      \"engine_name\": \"upscayl-lite-4x\",\n      \"download_bytes\": 2440291,\n      \"label\": \"Fast / Lite\",\n      \"best_for\": \"previews, batch work, and low-memory devices\",\n      \"tradeoff\": \"smallest download and fastest processing, but reconstructs less fine detail\",\n      \"files\": [\n        {\n          \"name\": \"upscayl-lite-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.bin\",\n          \"sha256\": \"85ee266b632a765a725425ba6a5620c088c8aa2939a03063b2d83b3462724cc1\"\n        },\n        {\n          \"name\": \"upscayl-lite-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.param\",\n          \"sha256\": \"22174924330297357434ad21ed0af7f4b820008d2a502b492754d130d4142714\"\n        }\n      ]\n    },\n    \"digital-art\": {\n      \"engine_name\": \"digital-art-4x\",\n      \"download_bytes\": 8973790,\n      \"label\": \"Digital Art\",\n      \"best_for\": \"anime, illustrations, icons, and clean synthetic edges\",\n      \"tradeoff\": \"compact and clean on artwork, but may oversimplify photographic texture\",\n      \"files\": [\n        {\n          \"name\": \"digital-art-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/digital-art-4x.bin\",\n          \"sha256\": \"fe01c269cfd10cdef8e018ab66ebe750cf79c7af4d1f9c16c737e1295229bacc\"\n        },\n        {\n          \"name\": \"digital-art-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/digital-art-4x.param\",\n          \"sha256\": \"2b8fb6e0ae4d2d85704ca08c119a2f5ea40add4f2ecd512eb7f4cd44b6127ed4\"\n        }\n      ]\n    },\n    \"remacri\": {\n      \"engine_name\": \"remacri-4x\",\n      \"download_bytes\": 33564815,\n      \"label\": \"Natural Photo / Portrait\",\n      \"best_for\": \"natural photos and portraits where identity and smooth tonal transitions matter\",\n      \"tradeoff\": \"more natural rendering, but less crisp than the sharp profile on text and architecture\",\n      \"files\": [\n        {\n          \"name\": \"remacri-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/remacri-4x.bin\",\n          \"sha256\": \"a43be595c0d743314c30b50fe7ef188be0c61cc55c46ce81adb79ba4b3c3fb7a\"\n        },\n        {\n          \"name\": \"remacri-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/remacri-4x.param\",\n          \"sha256\": \"859ecba5b3592ecf3e76c93bed65e9f627b5236dd696aae5a84ecf8c93ab65ce\"\n        }\n      ]\n    },\n    \"ultrasharp\": {\n      \"engine_name\": \"ultrasharp-4x\",\n      \"download_bytes\": 33540549,\n      \"label\": \"Sharp Detail\",\n      \"best_for\": \"architecture, products, game assets, and images that benefit from strong edge detail\",\n      \"tradeoff\": \"strongest apparent sharpness, but can exaggerate halos, noise, skin texture, and text artifacts\",\n      \"files\": [\n        {\n          \"name\": \"ultrasharp-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/ultrasharp-4x.bin\",\n          \"sha256\": \"fb3e279d40d4cddb44db4e684d59e68d0aa39852c8cc14dc3f23ccc7e6eee9c1\"\n        },\n        {\n          \"name\": \"ultrasharp-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/ultrasharp-4x.param\",\n          \"sha256\": \"0136ca83686809a8f17f7111f11b951e8db93610e24b7f4137c9ffe4dbc4a806\"\n        }\n      ]\n    }\n  },\n  \"profiles\": {\n    \"auto\": {\n      \"model\": \"high-fidelity\",\n      \"description\": \"Agent-inspected automatic recommendation; conservatively falls back to the balanced model\"\n    },\n    \"default\": {\n      \"model\": \"high-fidelity\",\n      \"description\": \"Balanced, conservative output for unknown or mixed content\"\n    },\n    \"fast\": {\n      \"model\": \"lite\",\n      \"description\": \"Lowest download, memory use, and processing time\"\n    },\n    \"photo\": {\n      \"model\": \"remacri\",\n      \"description\": \"Natural photographic texture and tonal transitions\"\n    },\n    \"portrait\": {\n      \"model\": \"remacri\",\n      \"description\": \"Smoother rendering for noisy, compressed, or rough natural portraits without generative face replacement; use default for clean AI portraits\"\n    },\n    \"digital-art\": {\n      \"model\": \"digital-art\",\n      \"description\": \"Clean edges for anime, illustrations, and icons\"\n    },\n    \"sharp\": {\n      \"model\": \"ultrasharp\",\n      \"description\": \"Aggressive apparent detail for architecture and products\"\n    }\n  }\n}\n\nFile v1.2.1:agents/openai.yaml\n\ninterface:\n  display_name: \"Local Image Upscaler\"\n  short_description: \"Choose local AI models, upscale to 8K, and compress images\"\n  default_prompt: \"Use $image-upscaler to recommend a local enhancement profile, explain its trade-offs and download size, then upscale or compress this image.\"\n\nArchive v1.2.0: 13 files, 29786 bytes\n\nFiles: agents/openai.yaml (293b), assets/manifest.json (6195b), README.md (12587b), references/algorithms.md (2923b), references/licenses.md (859b), references/platforms.md (2566b), scripts/compress.py (10686b), scripts/inspect.py (2061b), scripts/setup.py (10818b), scripts/upscale.py (13434b), skill-card.md (3384b), SKILL.md (8058b), _meta.json (139b)\n\nFile v1.2.0:SKILL.md\n\n---\nname: image-upscaler\ndescription: Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-detail, balanced, and fast profiles; 1K/2K/4K/8K output; custom long edges; strict target file sizes; batch folders; aspect-ratio preservation; offline reuse; and verified download fallbacks. Use when the user asks to make an image clearer, enlarge AI-generated art, compare enhancement algorithms, inspect image resolution, upscale without stretching, or reduce a larger image to a target such as 200KB.\n---\n\n# Image Upscaler\n\nUse the bundled Python scripts to run Upscayl's Vulkan-based NCNN engine locally. Download models only when selected. Preserve the source aspect ratio by default and never overwrite an input file.\n\n## Workflow\n\n1. Inspect the input path, file type, dimensions, and available disk space.\n2. Inspect the image visually and recommend one profile. If the choice materially affects the result, give the user a compact choice with the advantage, disadvantage, and additional download size. Do not block if the user does not choose; use `default`.\n3. Choose a profile:\n   - `default`: balanced and conservative; use when content is mixed or uncertain. Model download: about 32 MB.\n   - `fast`: smallest and fastest; weaker fine-detail reconstruction. Model download: about 2.5 MB.\n   - `photo`: natural photographic texture; less crisp on text and architecture. Model download: about 32 MB.\n   - `portrait`: use for compressed, noisy, or rough natural portraits that benefit from smoother rendering. It avoids face replacement but can remove fine skin texture. Use `default` for already-clean AI portraits and sharp studio headshots. Model download: about 32 MB, shared with `photo`.\n   - `digital-art`: clean anime, illustration, and icon edges; may oversimplify photographic texture. Model download: about 8.6 MB.\n   - `sharp`: strongest apparent edge detail; may exaggerate noise, halos, skin, or text artifacts. Model download: about 32 MB.\n4. If the selected runtime or model is not cached, explain the download and disk cost, then run setup. Read [platforms.md](references/platforms.md) for compatibility and cache sizes.\n5. Run the upscaler or compressor. Prefer PNG for maximum upscale quality; use JPEG for strict file-size targets.\n6. Verify that the output exists, has the requested dimensions, and keeps the source ratio. Report the selected profile, output path, dimensions, and file size.\n\nThe agent performs the meaningful automatic selection after visually inspecting the image. CLI `--profile auto` uses filename hints only and otherwise falls back conservatively to `default`; it does not claim reliable face or scene classification without an extra vision package. Read [algorithms.md](references/algorithms.md) when comparing profiles or discussing heavier optional algorithms.\n\nFor portraits, inspect source quality before selecting by subject alone: choose `default` for clean AI-generated or studio portraits; choose `portrait` only when a natural portrait is noisy, compressed, or visually rough. This rule is based on same-size comparison testing, where `portrait` produced smoother skin but removed detail from an already-clean AI portrait.\n\n## Prepare the Runtime\n\nRun from this skill directory:\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\nList choices, trade-offs, cache status, and incremental downloads without installing anything:\n\n```bash\npython scripts/setup.py --list-models\n```\n\nPrepare only the selected profile:\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\nThe downloader tries the local cache, configured mirrors, a verified GitHub acceleration endpoint, and the official source. Every downloaded artifact must match the pinned SHA-256 digest. To use an organization or domestic mirror, set `IMAGE_UPSCALER_MIRRORS` to one or more comma-separated URL prefixes before setup. Each prefix is prepended to the official URL. Example:\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\nUse `--offline` to forbid all network access. Use `--platform windows-x64 --download-only` to prefetch Windows files from another machine.\n\n## Upscale Images\n\nCreate a 4K image whose long edge is 3840 pixels while preserving the original ratio:\n\n```bash\npython scripts/upscale.py INPUT --output OUTPUT.png --target 4k\n```\n\nUseful variants:\n\n```bash\npython scripts/upscale.py INPUT --target 1k\npython scripts/upscale.py INPUT --target 2k --profile fast\npython scripts/upscale.py INPUT --target 4k --profile portrait\npython scripts/upscale.py INPUT --target 4k --profile digital-art\npython scripts/upscale.py INPUT --target 4k --profile sharp\npython scripts/upscale.py INPUT --target 8k --profile photo --tile 256\npython scripts/upscale.py INPUT --target scale4 --format png\npython scripts/upscale.py INPUT_FOLDER --output OUTPUT_FOLDER --target 4k\npython scripts/upscale.py INPUT --target 4k --format jpg --compression 92\n```\n\nThe screen-oriented presets use long edges: `1k=1920`, `2k=2560`, `4k=3840`, and `8k=7680`. A 16:9 4K landscape becomes 3840×2160; portraits and squares retain their own ratios. `scale4` keeps the model's native 4× output. Use `--max-edge N` for an exact custom long edge. Current local models are native 4× models; an 8K preset beyond the native result uses exact high-quality resizing and must not be described as recovered factual detail. For 8K, expect high memory and temporary-disk use; start with `--tile 256` if automatic tiling fails.\n\nExact 2K/4K output supports PNG and JPEG without extra dependencies. WebP is supported with `--target scale4`; use PNG when an exact target and transparency both matter.\n\n## Compress to a Target Size\n\nCompress a roughly 1MB image to no more than 200KiB:\n\n```bash\npython scripts/compress.py INPUT --output OUTPUT.jpg --target-kb 200\npython scripts/compress.py INPUT --target-mb 1.5 --keep-dimensions\npython scripts/compress.py INPUT_FOLDER --output OUTPUT_FOLDER --target-kb 200 --recursive\n```\n\nThe compressor first finds the highest JPEG quality that fits. If quality alone is insufficient, it reduces dimensions proportionally while respecting `--min-edge` (default 640px). It never stretches or overwrites the source. JPEG does not preserve transparency; convert the background explicitly before compression when its color matters.\n\nUse `--keep-dimensions` when reducing resolution is forbidden. Existing output files receive a `-v2`, `-v3`, and so on suffix unless `--overwrite` is explicitly supplied. Use `--dry-run` before a large folder job.\n\n## Inspect Before Processing\n\nInspect one file or a folder before choosing an upscale or compression target:\n\n```bash\npython scripts/inspect.py INPUT\npython scripts/inspect.py INPUT_FOLDER --recursive --json\n```\n\nThe report includes dimensions, simplified aspect ratio, megapixels, and file size.\n\n## Safety and Quality Rules\n\n- Never delete or replace source images.\n- Do not install GPU drivers, package managers, or system dependencies automatically.\n- Do not bypass SHA-256 verification, even when using a mirror.\n- Do not upload user images; processing must stay local.\n- Avoid TTA unless the user explicitly accepts a roughly 8× processing slowdown.\n- On GPU-memory errors, retry with `--tile 256`, then `--tile 128`.\n- If Vulkan is unavailable, stop and explain the platform limitation; do not silently switch to an unrelated cloud service.\n- Treat visual enhancement as reconstruction, not recovery of factual detail. Do not claim that invented texture is original information.\n\n## References\n\n- Read [platforms.md](references/platforms.md) for supported systems, storage, cache, mirror, and troubleshooting details.\n- Read [algorithms.md](references/algorithms.md) for profile selection, benefits, limitations, and optional heavy algorithms.\n- Read [licenses.md](references/licenses.md) before redistributing the engine or model files.\n\nFile v1.2.0:README.md\n\n# Local Image Upscaler / 本地图像增强工具\n\n## 中文\n\n### 简介\n\nLocal Image Upscaler 是一个面向 macOS 和 Windows x64 的本地图像增强 Skill。它可以使用本地 AI 模型放大图片、按指定分辨率输出、将图片压缩到目标体积，并在处理前检查图片信息。图片不会上传到云端，源文件默认不会被覆盖。\n\n### 主要功能\n\n- AI 高保真放大，适合照片、截图和 AI 生成图片\n- 根据图片自动推荐算法，也可由用户选择默认、快速、照片、人像、插画或锐利细节模式\n- 每种算法在下载前说明优点、缺点和新增空间，模型按需下载\n- `1K`、`2K`、`4K`、`8K` 分辨率预设\n- 自定义长边尺寸，不拉伸原图\n- 原生 4× 放大\n- 严格控制目标体积，例如将约 1MB 图片压缩到 200KB 以内\n- 压缩时优先保留尺寸和画质，必要时才等比例缩小\n- 单张图片与文件夹批量处理\n- 图片尺寸、比例、像素和体积检查\n- macOS 与 Windows x64 支持\n- 国内网络镜像回退、离线缓存和 SHA-256 完整性校验\n\n### 支持格式\n\n- 输入：JPG、JPEG、PNG、WebP\n- 放大输出：PNG、JPG、WebP（WebP 精确尺寸存在平台限制）\n- 目标体积压缩输出：JPEG\n\n### 算法怎么选\n\n如果用户没有指定，Skill 会先观察图片并推荐模式；用户不想选择时使用保守的默认模式。人脸生成式修复不会自动开启。\n\n| 模式 | 适合 | 优点 | 缺点 | 首次下载 |\n| --- | --- | --- | --- | ---: |\n| `default` | 类型不确定或混合图片 | 均衡、保守 | 不追求最强锐度 | 约 32MB |\n| `fast` | 预览、批处理、低配置设备 | 最快、最小 | 细节重建较弱 | 约 2.5MB |\n| `photo` | 自然照片 | 质感和明暗过渡自然 | 硬边不如锐利模式 | 约 32MB |\n| `portrait` | 有噪点、压缩或较粗糙的真实人像 | 不替换五官，过渡更柔和 | 会抹掉清晰AI人像的部分皮肤细节 | 与照片模式共用 |\n| `digital-art` | 动漫、插画、图标 | 线条干净、模型小 | 可能简化照片纹理 | 约 8.6MB |\n| `sharp` | 建筑、商品、游戏素材 | 视觉锐度最强 | 可能放大噪点、光晕和皮肤纹理 | 约 32MB |\n\n查看模型、缓存状态和增量下载空间，不会安装任何内容：\n\n```bash\npython scripts/setup.py --list-models\n```\n\n不要仅因为画面中有人就选择人像模式：清晰AI人像和棚拍头像优先用 `default`；只有真实人像存在噪点、压缩或纹理粗糙时才推荐 `portrait`。\n\n### 准备运行环境\n\n进入 Skill 目录后运行：\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\n快速预览或低配置设备可以使用轻量模型：\n\n```bash\npython scripts/setup.py --model lite\n```\n\n也可以只准备选中的模式：\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\n首次运行会下载固定版本的 Upscayl NCNN 运行时和模型，并进行 SHA-256 校验。后续可以离线复用缓存。\n\n### 放大到指定分辨率\n\n```bash\npython scripts/upscale.py input.png --target 1k\npython scripts/upscale.py input.png --target 2k\npython scripts/upscale.py input.png --target 4k\npython scripts/upscale.py input.png --target 8k --tile 256\n```\n\n指定算法模式：\n\n```bash\npython scripts/upscale.py input.png --target 4k --profile portrait\npython scripts/upscale.py input.png --target 4k --profile digital-art\npython scripts/upscale.py input.png --target 4k --profile sharp\n```\n\n分辨率预设指图片长边：\n\n- 1K：1920 像素\n- 2K：2560 像素\n- 4K：3840 像素\n- 8K：7680 像素\n\n原图比例始终保留。例如，16:9 图片输出为 4K 时是 3840×2160；正方形图片则是 3840×3840。\n\n自定义长边：\n\n```bash\npython scripts/upscale.py input.png --max-edge 3000\n```\n\n保留模型原生 4×结果：\n\n```bash\npython scripts/upscale.py input.png --target scale4\n```\n\n### 压缩到目标体积\n\n将图片压缩到不超过 200KB：\n\n```bash\npython scripts/compress.py input.png --output output.jpg --target-kb 200\n```\n\n将图片压缩到不超过 1.5MB：\n\n```bash\npython scripts/compress.py input.png --target-mb 1.5\n```\n\n只调整质量，不允许降低尺寸：\n\n```bash\npython scripts/compress.py input.png --target-kb 200 --keep-dimensions\n```\n\n如果保持原尺寸无法达到目标体积，命令会直接报错。\n\n### 批量处理\n\n批量放大：\n\n```bash\npython scripts/upscale.py input-folder --output output-folder --target 4k\n```\n\n批量压缩，包括子目录：\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive\n```\n\n先预览批量任务，不写入文件：\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive --dry-run\n```\n\n### 检查图片信息\n\n```bash\npython scripts/inspect.py input.png\npython scripts/inspect.py input-folder --recursive --json\n```\n\n检查结果包括尺寸、宽高比、百万像素和文件体积。\n\n### 国内镜像与离线模式\n\n可以通过环境变量指定一个或多个镜像前缀：\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\n即使使用镜像，所有文件仍必须通过固定 SHA-256 校验。禁止网络访问时使用：\n\n```bash\npython scripts/setup.py --offline\n```\n\n### 注意事项\n\n- AI 增强会重建纹理，不代表恢复了原始图片中不存在的真实信息。\n- 8K 处理需要较多显存、内存和临时磁盘空间。\n- 当前模型原生放大倍率为 4×；当目标 8K 超过原生 4×尺寸时，额外像素来自高质量缩放，不代表恢复了新的真实细节。\n- 显存不足时依次尝试 `--tile 256` 和 `--tile 128`。\n- JPEG 压缩不保留透明通道；如果背景颜色很重要，请先明确转换背景。\n- 除非明确传入 `--overwrite`，压缩工具不会覆盖已有输出。\n\n### 联系方式\n\n更多 Skill 定制或功能需求，可以联系大瑜：`helloaigc2023`。\n\n---\n\n## English\n\n### Overview\n\nLocal Image Upscaler is a local image-enhancement Skill for macOS and Windows x64. It uses local AI models to upscale images, export resolution presets, compress images to strict file-size targets, and inspect image properties before processing. Images are never uploaded, and source files are not overwritten by default.\n\n### Features\n\n- High-fidelity AI upscaling for photos, screenshots, and AI-generated artwork\n- Automatic profile recommendations with user-selectable default, fast, photo, portrait, digital-art, and sharp-detail modes\n- Clear advantages, limitations, and incremental storage before each optional model download\n- `1K`, `2K`, `4K`, and `8K` presets\n- Custom long-edge sizes without stretching\n- Native 4× model output\n- Strict file-size targets, such as compressing an approximately 1MB image to 200KB or less\n- Quality-first compression with proportional resizing only when necessary\n- Single-image and folder batch processing\n- Image dimension, aspect-ratio, megapixel, and file-size inspection\n- macOS and Windows x64 support\n- Mirror fallback for restricted networks, offline caching, and SHA-256 verification\n\n### Supported Formats\n\n- Input: JPG, JPEG, PNG, WebP\n- Upscale output: PNG, JPG, WebP (exact-size WebP has platform limitations)\n- Target-size compression output: JPEG\n\n### Choose an Algorithm\n\nWhen the user does not specify an algorithm, the Skill visually inspects the image and recommends a profile. If the user declines to choose, it uses the conservative default. Generative face restoration is never enabled silently.\n\n| Profile | Best for | Advantage | Limitation | First download |\n| --- | --- | --- | --- | ---: |\n| `default` | Unknown or mixed images | Balanced and conservative | Does not maximize sharpness | ~32MB |\n| `fast` | Previews, batches, low-spec devices | Fastest and smallest | Reconstructs less detail | ~2.5MB |\n| `photo` | Natural photographs | Natural texture and tonal transitions | Softer hard edges | ~32MB |\n| `portrait` | Noisy, compressed, or rough natural portraits | Avoids face replacement and renders smoother transitions | Can remove fine detail from clean AI portraits | Shared with photo |\n| `digital-art` | Anime, illustration, icons | Clean edges and compact model | Can simplify photographic texture | ~8.6MB |\n| `sharp` | Architecture, products, game assets | Strongest apparent sharpness | Can amplify noise, halos, and skin texture | ~32MB |\n\nList models, trade-offs, cache state, and incremental downloads without installing anything:\n\n```bash\npython scripts/setup.py --list-models\n```\n\nDo not select the portrait profile merely because a person is present. Prefer `default` for clean AI portraits and studio headshots; recommend `portrait` only when a natural portrait is noisy, compressed, or texturally rough.\n\n### Prepare the Runtime\n\nRun this command from the Skill directory:\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\nUse the smaller model for previews or lower-spec devices:\n\n```bash\npython scripts/setup.py --model lite\n```\n\nPrepare only a selected profile:\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\nThe first setup downloads a pinned Upscayl NCNN runtime and model files, verifies every artifact with SHA-256, and caches them for later offline use.\n\n### Upscale to a Resolution Preset\n\n```bash\npython scripts/upscale.py input.png --target 1k\npython scripts/upscale.py input.png --target 2k\npython scripts/upscale.py input.png --target 4k\npython scripts/upscale.py input.png --target 8k --tile 256\n```\n\nChoose an algorithm profile explicitly:\n\n```bash\npython scripts/upscale.py input.png --target 4k --profile portrait\npython scripts/upscale.py input.png --target 4k --profile digital-art\npython scripts/upscale.py input.png --target 4k --profile sharp\n```\n\nPresets refer to the image's long edge:\n\n- 1K: 1920 pixels\n- 2K: 2560 pixels\n- 4K: 3840 pixels\n- 8K: 7680 pixels\n\nThe source aspect ratio is always preserved. A 16:9 image becomes 3840×2160 at 4K, while a square image becomes 3840×3840.\n\nUse a custom long edge:\n\n```bash\npython scripts/upscale.py input.png --max-edge 3000\n```\n\nKeep the model's native 4× output:\n\n```bash\npython scripts/upscale.py input.png --target scale4\n```\n\n### Compress to a Target File Size\n\nCompress an image to 200KB or less:\n\n```bash\npython scripts/compress.py input.png --output output.jpg --target-kb 200\n```\n\nCompress an image to 1.5MB or less:\n\n```bash\npython scripts/compress.py input.png --target-mb 1.5\n```\n\nAdjust quality only and keep the original dimensions:\n\n```bash\npython scripts/compress.py input.png --target-kb 200 --keep-dimensions\n```\n\nThe command fails clearly if the target cannot be reached at the original dimensions.\n\n### Batch Processing\n\nBatch upscale a folder:\n\n```bash\npython scripts/upscale.py input-folder --output output-folder --target 4k\n```\n\nRecursively compress a folder:\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive\n```\n\nPreview a batch job without writing files:\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive --dry-run\n```\n\n### Inspect Images\n\n```bash\npython scripts/inspect.py input.png\npython scripts/inspect.py input-folder --recursive --json\n```\n\nThe report includes dimensions, simplified aspect ratio, megapixels, and file size.\n\n### Mirrors and Offline Mode\n\nConfigure one or more mirror prefixes through an environment variable:\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\nArtifacts from mirrors must pass the same pinned SHA-256 checks. To forbid network access:\n\n```bash\npython scripts/setup.py --offline\n```\n\n### Notes\n\n- AI enhancement reconstructs texture; it cannot recover factual detail that was absent from the source.\n- 8K processing requires substantial GPU memory, system memory, and temporary disk space.\n- Bundled models are native 4× upscalers. When an 8K target exceeds native 4× output, the extra pixels come from high-quality resizing and are not newly recovered factual detail.\n- On GPU-memory errors, try `--tile 256`, then `--tile 128`.\n- JPEG compression does not preserve transparency; convert the background explicitly first when its color matters.\n- Existing outputs are not overwritten unless `--overwrite` is explicitly supplied.\n\n### Contact\n\nFor more Skill customization or feature requests, contact Dayu: `helloaigc2023`.\n\nFile v1.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn72j0qng9f6mm49z983cyzw1982naag\",\n  \"slug\": \"local-image-upscaler\",\n  \"version\": \"1.2.0\",\n  \"publishedAt\": 1784713464535\n}\n\nFile v1.2.0:references/algorithms.md\n\n# Algorithm Profiles\n\n## Selection policy\n\nInspect the image visually before invoking the script. Recommend a profile and state its advantage, disadvantage, and uncached download size. If the user does not choose, use `default`. Never enable generative face restoration silently.\n\n| Profile | Model | Best use | Advantage | Limitation | Download |\n| --- | --- | --- | --- | --- | ---: |\n| `default` | high-fidelity-4x | Unknown or mixed images | Balanced and conservative | Does not maximize any one content type | ~32 MB |\n| `fast` | upscayl-lite-4x | Preview and batch processing | Fastest and smallest | Less reconstructed detail | ~2.5 MB |\n| `photo` | remacri-4x | Natural photographs | Smooth tonal transitions and natural texture | Softer than `sharp` on hard edges | ~32 MB |\n| `portrait` | remacri-4x | Noisy, compressed, or rough natural portraits | Avoids generative face replacement and smooths transitions | Can remove skin and eyelash detail from clean AI portraits | Shared with `photo` |\n| `digital-art` | digital-art-4x | Anime, illustration, icons | Clean synthetic edges, compact model | Can flatten photographic texture | ~8.6 MB |\n| `sharp` | ultrasharp-4x | Architecture, products, game assets | Strongest apparent edge detail | Can amplify noise, halos, pores, and text artifacts | ~32 MB |\n\n`auto` means the agent selects a profile after visual inspection. The standalone CLI has no bundled vision classifier; it uses explicit filename hints for digital art and otherwise falls back to `default`.\n\nDo not route by subject alone. A same-size comparison on a clean AI portrait showed that `default` retained more eyelashes, eyebrows, and skin texture, while `portrait` produced smoother skin and a smaller output. Route clean AI and studio portraits to `default`; reserve `portrait` for degraded natural portraits.\n\n## 8K behavior\n\nThe bundled models produce a native 4× result. Exact 1K/2K/4K/8K presets then resize that result to the requested long edge. If the requested 8K dimensions exceed native 4× output, the extra pixels are interpolation rather than newly recovered factual detail. Prefer a clearly labeled comparison crop when evaluating results.\n\n## Heavy optional algorithms\n\nDo not install these by default:\n\n- SwinIR or HAT: transformer restoration with stronger benchmark reconstruction, but requires a substantially larger PyTorch environment and slower inference.\n- CodeFormer or GFPGAN: face restoration that can improve damaged portraits, but may change identity. Require explicit user consent and expose fidelity controls.\n- SUPIR: diffusion restoration with strong perceived detail, but high GPU-memory use, slow inference, generative hallucination risk, and non-commercial-use restrictions in the upstream project.\n\nKeep heavy algorithms in separate optional adapters and report their complete environment, model, temporary-file, and output storage costs before installation.\n\nFile v1.2.0:references/licenses.md\n\n# Upstream Licenses and Attribution\n\nThis Skill's scripts and instructions do not bundle third-party executables or model weights. Setup downloads the following pinned upstream artifacts on demand:\n\n- Upscayl NCNN command-line runtime: <https://github.com/upscayl/upscayl-ncnn>\n- Upscayl model files, including High Fidelity, Lite, Digital Art, Remacri, and Ultrasharp profiles: <https://github.com/upscayl/upscayl/tree/main/resources/models>\n\nUpscayl is distributed under the GNU Affero General Public License v3.0. Review the upstream license and each model's provenance before redistributing downloaded runtime or model files; model availability in the upstream repository does not erase separate upstream model terms. Keep all applicable notices with redistributed copies. This Skill downloads models on demand and does not change upstream license terms.\n\nFile v1.2.0:references/platforms.md\n\n# Platform and Storage Reference\n\n## Supported systems\n\n- macOS 12 or newer on Apple Silicon or Intel. The runtime is a universal binary and uses Metal through MoltenVK.\n- Windows 10/11 x64 with a Vulkan-capable GPU and current graphics driver.\n- Windows ARM is not supported by the pinned runtime. x64 emulation does not guarantee Vulkan compatibility.\n- Linux is intentionally omitted from version 1.0 to keep the tested support surface focused.\n\n## Approximate storage\n\nThe Skill itself is under 1 MB. Cached components use approximately:\n\n- macOS runtime: 9 MB download plus 28 MB extracted.\n- Windows runtime: 2.5 MB download plus 8 MB extracted.\n- High-fidelity model: 34 MB.\n- Lite model: 2.5 MB.\n- Digital-art model: 8.6 MB.\n- Natural photo/portrait model: 32 MB (one shared model for both profiles).\n- Sharp-detail model: 32 MB.\n- Installing every bundled model adds about 100 MB of model data; models are downloaded individually by default.\n- Output images: varies; lossless 4K PNG files are commonly 5–30 MB each.\n\nThe cache is stored in `~/.cache/image-upscaler` on macOS and `%LOCALAPPDATA%\\image-upscaler` on Windows. Override it with `IMAGE_UPSCALER_CACHE`.\n\n## Download order\n\n1. Existing verified cache.\n2. Prefixes in `IMAGE_UPSCALER_MIRRORS`, in the supplied order.\n3. The bundled GitHub acceleration prefix.\n4. Official GitHub or raw GitHub URL.\n\nAll paths use the same pinned SHA-256 digests. A mirror cannot substitute a modified binary or model without being rejected.\n\nFor a private mirror, mirror the exact upstream URL hierarchy and set a prefix, or use a prefix containing `{url}`. Example: `https://mirror.example/fetch?url={url}`.\n\n## Troubleshooting\n\n- `Unsupported platform`: use macOS or Windows x64.\n- `All download sources failed`: set `IMAGE_UPSCALER_MIRRORS` to a reachable internal/domestic proxy, or prefill the cache on a connected machine.\n- `SHA-256 mismatch`: do not continue. Remove only the named `.part` or cached artifact and retry from another source.\n- Vulkan or GPU error: update the graphics driver and verify Vulkan support. Virtual machines often lack sufficient Vulkan passthrough.\n- Out of GPU memory: retry `upscale.py` with `--tile 256`, then `--tile 128`.\n- Slow processing: use `--model lite`, avoid `--tta`, and process files one at a time.\n- Unsure which model is cached or how large it is: run `python scripts/setup.py --list-models` before downloading.\n- Exact WebP resizing is intentionally not performed through platform APIs. Use PNG/JPEG for exact 2K/4K dimensions, or WebP with `--target scale4`.\n\nFile v1.2.0:skill-card.md\n\n## Description: <br>\nUpscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-detail, balanced, and fast profiles; 1K/2K/4K/8K output; custom long edges; strict target file sizes; batch folders; aspect-ratio preservation; offline reuse; and verified download fallbacks. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[harven-droid](https://clawhub.ai/user/harven-droid) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users, developers, and content teams use this skill to enhance, resize, inspect, and compress local images without uploading them to a cloud service. It is suited for single-image and folder workflows that need preserved aspect ratios, selectable upscaling profiles, or strict JPEG size targets. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill reads user-selected image paths and writes output image files on the local machine. <br>\nMitigation: Inspect input and output paths before execution, never overwrite source images unless explicitly requested, and use dry-run for large folder compression jobs. <br>\nRisk: Runtime and model downloads may come through mirrors or fallback sources. <br>\nMitigation: Use trusted mirrors only, keep pinned SHA-256 verification enabled, and prefer offline mode or a verified cache when network access is not acceptable. <br>\nRisk: AI upscaling can reconstruct or interpolate texture rather than recover factual detail from the original image. <br>\nMitigation: Describe enhanced output as visual reconstruction, label 8K interpolation when it exceeds native 4x model output, and avoid claiming newly recovered factual detail. <br>\nRisk: Large 8K jobs and high-quality profiles can consume substantial GPU memory, temporary disk, and output storage. <br>\nMitigation: Check available storage before processing, disclose incremental model download sizes, and retry GPU-memory failures with smaller tile sizes such as 256 and 128. <br>\n\n\n## Reference(s): <br>\n- [Algorithm Profiles](artifact/references/algorithms.md) <br>\n- [Platform and Storage Reference](artifact/references/platforms.md) <br>\n- [Upstream Licenses and Attribution](artifact/references/licenses.md) <br>\n- [Upscayl NCNN command-line runtime](https://github.com/upscayl/upscayl-ncnn) <br>\n- [Upscayl model files](https://github.com/upscayl/upscayl/tree/main/resources/models) <br>\n- [ClawHub skill page](https://clawhub.ai/harven-droid/skills/local-image-upscaler) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and local file paths] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May produce local image files through bundled scripts; output paths, dimensions, profile choice, and file sizes should be reported.] <br>\n\n## Skill Version(s): <br>\n1.2.0 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.2.0:assets/manifest.json\n\n{\n  \"schema_version\": 1,\n  \"runtime_version\": \"20251207-174704\",\n  \"default_mirror_prefixes\": [\n    \"https://ghfast.top/\"\n  ],\n  \"platforms\": {\n    \"darwin-universal\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-macos.zip\",\n      \"sha256\": \"277419791281a56eae0c739c70120b974d7267cf7c2de8e86dc09798d4b314db\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-macos\",\n      \"executable\": \"upscayl-bin\"\n    },\n    \"windows-x64\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-windows.zip\",\n      \"sha256\": \"1f0f65c5d2ade866555e2ac467d35952c35a47080a4060fe56a1ab028f67258a\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-windows\",\n      \"executable\": \"upscayl-bin.exe\"\n    }\n  },\n  \"models\": {\n    \"high-fidelity\": {\n      \"engine_name\": \"high-fidelity-4x\",\n      \"download_bytes\": 33532559,\n      \"label\": \"Balanced / Default\",\n      \"best_for\": \"general photos, AI-generated images, and conservative enhancement\",\n      \"tradeoff\": \"balanced output; less aggressive than the sharp profile\",\n      \"files\": [\n        {\n          \"name\": \"high-fidelity-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.bin\",\n          \"sha256\": \"8a135402b4f39286121b76abb47601a6b7b7e8d4f3e999a5aaa45ed277824fb4\"\n        },\n        {\n          \"name\": \"high-fidelity-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.param\",\n          \"sha256\": \"4576ed5c2fc5fa250d3c3d585ef02248f26abdfc1867088078f501fe71e5d61e\"\n        }\n      ]\n    },\n    \"lite\": {\n      \"engine_name\": \"upscayl-lite-4x\",\n      \"download_bytes\": 2440291,\n      \"label\": \"Fast / Lite\",\n      \"best_for\": \"previews, batch work, and low-memory devices\",\n      \"tradeoff\": \"smallest download and fastest processing, but reconstructs less fine detail\",\n      \"files\": [\n        {\n          \"name\": \"upscayl-lite-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.bin\",\n          \"sha256\": \"85ee266b632a765a725425ba6a5620c088c8aa2939a03063b2d83b3462724cc1\"\n        },\n        {\n          \"name\": \"upscayl-lite-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.param\",\n          \"sha256\": \"22174924330297357434ad21ed0af7f4b820008d2a502b492754d130d4142714\"\n        }\n      ]\n    },\n    \"digital-art\": {\n      \"engine_name\": \"digital-art-4x\",\n      \"download_bytes\": 8973790,\n      \"label\": \"Digital Art\",\n      \"best_for\": \"anime, illustrations, icons, and clean synthetic edges\",\n      \"tradeoff\": \"compact and clean on artwork, but may oversimplify photographic texture\",\n      \"files\": [\n        {\n          \"name\": \"digital-art-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/digital-art-4x.bin\",\n          \"sha256\": \"fe01c269cfd10cdef8e018ab66ebe750cf79c7af4d1f9c16c737e1295229bacc\"\n        },\n        {\n          \"name\": \"digital-art-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/digital-art-4x.param\",\n          \"sha256\": \"2b8fb6e0ae4d2d85704ca08c119a2f5ea40add4f2ecd512eb7f4cd44b6127ed4\"\n        }\n      ]\n    },\n    \"remacri\": {\n      \"engine_name\": \"remacri-4x\",\n      \"download_bytes\": 33564815,\n      \"label\": \"Natural Photo / Portrait\",\n      \"best_for\": \"natural photos and portraits where identity and smooth tonal transitions matter\",\n      \"tradeoff\": \"more natural rendering, but less crisp than the sharp profile on text and architecture\",\n      \"files\": [\n        {\n          \"name\": \"remacri-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/remacri-4x.bin\",\n          \"sha256\": \"a43be595c0d743314c30b50fe7ef188be0c61cc55c46ce81adb79ba4b3c3fb7a\"\n        },\n        {\n          \"name\": \"remacri-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/remacri-4x.param\",\n          \"sha256\": \"859ecba5b3592ecf3e76c93bed65e9f627b5236dd696aae5a84ecf8c93ab65ce\"\n        }\n      ]\n    },\n    \"ultrasharp\": {\n      \"engine_name\": \"ultrasharp-4x\",\n      \"download_bytes\": 33540549,\n      \"label\": \"Sharp Detail\",\n      \"best_for\": \"architecture, products, game assets, and images that benefit from strong edge detail\",\n      \"tradeoff\": \"strongest apparent sharpness, but can exaggerate halos, noise, skin texture, and text artifacts\",\n      \"files\": [\n        {\n          \"name\": \"ultrasharp-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/ultrasharp-4x.bin\",\n          \"sha256\": \"fb3e279d40d4cddb44db4e684d59e68d0aa39852c8cc14dc3f23ccc7e6eee9c1\"\n        },\n        {\n          \"name\": \"ultrasharp-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/ultrasharp-4x.param\",\n          \"sha256\": \"0136ca83686809a8f17f7111f11b951e8db93610e24b7f4137c9ffe4dbc4a806\"\n        }\n      ]\n    }\n  },\n  \"profiles\": {\n    \"auto\": {\n      \"model\": \"high-fidelity\",\n      \"description\": \"Agent-inspected automatic recommendation; conservatively falls back to the balanced model\"\n    },\n    \"default\": {\n      \"model\": \"high-fidelity\",\n      \"description\": \"Balanced, conservative output for unknown or mixed content\"\n    },\n    \"fast\": {\n      \"model\": \"lite\",\n      \"description\": \"Lowest download, memory use, and processing time\"\n    },\n    \"photo\": {\n      \"model\": \"remacri\",\n      \"description\": \"Natural photographic texture and tonal transitions\"\n    },\n    \"portrait\": {\n      \"model\": \"remacri\",\n      \"description\": \"Smoother rendering for noisy, compressed, or rough natural portraits without generative face replacement; use default for clean AI portraits\"\n    },\n    \"digital-art\": {\n      \"model\": \"digital-art\",\n      \"description\": \"Clean edges for anime, illustrations, and icons\"\n    },\n    \"sharp\": {\n      \"model\": \"ultrasharp\",\n      \"description\": \"Aggressive apparent detail for architecture and products\"\n    }\n  }\n}\n\nFile v1.2.0:agents/openai.yaml\n\ninterface:\n  display_name: \"Local Image Upscaler\"\n  short_description: \"Choose local AI models, upscale to 8K, and compress images\"\n  default_prompt: \"Use $image-upscaler to recommend a local enhancement profile, explain its trade-offs and download size, then upscale or compress this image.\"\n\nArchive v1.1.0: 12 files, 22334 bytes\n\nFiles: agents/openai.yaml (271b), assets/manifest.json (2083b), README.md (8202b), references/licenses.md (668b), references/platforms.md (2204b), scripts/compress.py (10686b), scripts/inspect.py (2061b), scripts/setup.py (7382b), scripts/upscale.py (11985b), skill-card.md (3025b), SKILL.md (5312b), _meta.json (139b)\n\nFile v1.1.0:SKILL.md\n\n---\nname: image-upscaler\ndescription: Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including 1K/2K/4K/8K output, custom long edges, strict target file sizes, batch folders, aspect-ratio preservation, offline reuse, and verified download fallbacks. Use when the user asks to make an image clearer, enlarge AI-generated art, inspect image resolution, upscale without stretching, or reduce a larger image to a target such as 200KB.\n---\n\n# Image Upscaler\n\nUse the bundled Python scripts to run Upscayl's Vulkan-based NCNN engine locally. Preserve the source aspect ratio by default and never overwrite an input file.\n\n## Workflow\n\n1. Inspect the input path, file type, dimensions, and available disk space.\n2. Choose a model:\n   - `high-fidelity`: default for photos, GPT-generated images, and best visible detail.\n   - `lite`: faster and about 30 MB smaller; use for previews or low-memory devices.\n3. If the selected runtime or model is not cached, explain the download and disk cost, then run setup. Read [platforms.md](references/platforms.md) for compatibility and cache sizes.\n4. Run the upscaler or compressor. Prefer PNG for maximum upscale quality; use JPEG for strict file-size targets.\n5. Verify that the output exists, has the requested dimensions, and keeps the source ratio. Report the output path and file size.\n\n## Prepare the Runtime\n\nRun from this skill directory:\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\nThe downloader tries the local cache, configured mirrors, a verified GitHub acceleration endpoint, and the official source. Every downloaded artifact must match the pinned SHA-256 digest. To use an organization or domestic mirror, set `IMAGE_UPSCALER_MIRRORS` to one or more comma-separated URL prefixes before setup. Each prefix is prepended to the official URL. Example:\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\nUse `--offline` to forbid all network access. Use `--platform windows-x64 --download-only` to prefetch Windows files from another machine.\n\n## Upscale Images\n\nCreate a 4K image whose long edge is 3840 pixels while preserving the original ratio:\n\n```bash\npython scripts/upscale.py INPUT --output OUTPUT.png --target 4k\n```\n\nUseful variants:\n\n```bash\npython scripts/upscale.py INPUT --target 1k\npython scripts/upscale.py INPUT --target 2k --model lite\npython scripts/upscale.py INPUT --target 8k --tile 256\npython scripts/upscale.py INPUT --target scale4 --format png\npython scripts/upscale.py INPUT_FOLDER --output OUTPUT_FOLDER --target 4k\npython scripts/upscale.py INPUT --target 4k --format jpg --compression 92\n```\n\nThe screen-oriented presets use long edges: `1k=1920`, `2k=2560`, `4k=3840`, and `8k=7680`. A 16:9 4K landscape becomes 3840×2160; portraits and squares retain their own ratios. `scale4` keeps the model's native 4× output. Use `--max-edge N` for an exact custom long edge. For 8K, expect high memory and temporary-disk use; start with `--tile 256` if automatic tiling fails.\n\nExact 2K/4K output supports PNG and JPEG without extra dependencies. WebP is supported with `--target scale4`; use PNG when an exact target and transparency both matter.\n\n## Compress to a Target Size\n\nCompress a roughly 1MB image to no more than 200KiB:\n\n```bash\npython scripts/compress.py INPUT --output OUTPUT.jpg --target-kb 200\npython scripts/compress.py INPUT --target-mb 1.5 --keep-dimensions\npython scripts/compress.py INPUT_FOLDER --output OUTPUT_FOLDER --target-kb 200 --recursive\n```\n\nThe compressor first finds the highest JPEG quality that fits. If quality alone is insufficient, it reduces dimensions proportionally while respecting `--min-edge` (default 640px). It never stretches or overwrites the source. JPEG does not preserve transparency; convert the background explicitly before compression when its color matters.\n\nUse `--keep-dimensions` when reducing resolution is forbidden. Existing output files receive a `-v2`, `-v3`, and so on suffix unless `--overwrite` is explicitly supplied. Use `--dry-run` before a large folder job.\n\n## Inspect Before Processing\n\nInspect one file or a folder before choosing an upscale or compression target:\n\n```bash\npython scripts/inspect.py INPUT\npython scripts/inspect.py INPUT_FOLDER --recursive --json\n```\n\nThe report includes dimensions, simplified aspect ratio, megapixels, and file size.\n\n## Safety and Quality Rules\n\n- Never delete or replace source images.\n- Do not install GPU drivers, package managers, or system dependencies automatically.\n- Do not bypass SHA-256 verification, even when using a mirror.\n- Do not upload user images; processing must stay local.\n- Avoid TTA unless the user explicitly accepts a roughly 8× processing slowdown.\n- On GPU-memory errors, retry with `--tile 256`, then `--tile 128`.\n- If Vulkan is unavailable, stop and explain the platform limitation; do not silently switch to an unrelated cloud service.\n- Treat visual enhancement as reconstruction, not recovery of factual detail. Do not claim that invented texture is original information.\n\n## References\n\n- Read [platforms.md](references/platforms.md) for supported systems, storage, cache, mirror, and troubleshooting details.\n- Read [licenses.md](references/licenses.md) before redistributing the engine or model files.\n\nFile v1.1.0:README.md\n\n# Local Image Upscaler / 本地图像增强工具\n\n## 中文\n\n### 简介\n\nLocal Image Upscaler 是一个面向 macOS 和 Windows x64 的本地图像增强 Skill。它可以使用本地 AI 模型放大图片、按指定分辨率输出、将图片压缩到目标体积，并在处理前检查图片信息。图片不会上传到云端，源文件默认不会被覆盖。\n\n### 主要功能\n\n- AI 高保真放大，适合照片、截图和 AI 生成图片\n- `1K`、`2K`、`4K`、`8K` 分辨率预设\n- 自定义长边尺寸，不拉伸原图\n- 原生 4× 放大\n- 严格控制目标体积，例如将约 1MB 图片压缩到 200KB 以内\n- 压缩时优先保留尺寸和画质，必要时才等比例缩小\n- 单张图片与文件夹批量处理\n- 图片尺寸、比例、像素和体积检查\n- macOS 与 Windows x64 支持\n- 国内网络镜像回退、离线缓存和 SHA-256 完整性校验\n\n### 支持格式\n\n- 输入：JPG、JPEG、PNG、WebP\n- 放大输出：PNG、JPG、WebP（WebP 精确尺寸存在平台限制）\n- 目标体积压缩输出：JPEG\n\n### 准备运行环境\n\n进入 Skill 目录后运行：\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\n快速预览或低配置设备可以使用轻量模型：\n\n```bash\npython scripts/setup.py --model lite\n```\n\n首次运行会下载固定版本的 Upscayl NCNN 运行时和模型，并进行 SHA-256 校验。后续可以离线复用缓存。\n\n### 放大到指定分辨率\n\n```bash\npython scripts/upscale.py input.png --target 1k\npython scripts/upscale.py input.png --target 2k\npython scripts/upscale.py input.png --target 4k\npython scripts/upscale.py input.png --target 8k --tile 256\n```\n\n分辨率预设指图片长边：\n\n- 1K：1920 像素\n- 2K：2560 像素\n- 4K：3840 像素\n- 8K：7680 像素\n\n原图比例始终保留。例如，16:9 图片输出为 4K 时是 3840×2160；正方形图片则是 3840×3840。\n\n自定义长边：\n\n```bash\npython scripts/upscale.py input.png --max-edge 3000\n```\n\n保留模型原生 4×结果：\n\n```bash\npython scripts/upscale.py input.png --target scale4\n```\n\n### 压缩到目标体积\n\n将图片压缩到不超过 200KB：\n\n```bash\npython scripts/compress.py input.png --output output.jpg --target-kb 200\n```\n\n将图片压缩到不超过 1.5MB：\n\n```bash\npython scripts/compress.py input.png --target-mb 1.5\n```\n\n只调整质量，不允许降低尺寸：\n\n```bash\npython scripts/compress.py input.png --target-kb 200 --keep-dimensions\n```\n\n如果保持原尺寸无法达到目标体积，命令会直接报错。\n\n### 批量处理\n\n批量放大：\n\n```bash\npython scripts/upscale.py input-folder --output output-folder --target 4k\n```\n\n批量压缩，包括子目录：\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive\n```\n\n先预览批量任务，不写入文件：\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive --dry-run\n```\n\n### 检查图片信息\n\n```bash\npython scripts/inspect.py input.png\npython scripts/inspect.py input-folder --recursive --json\n```\n\n检查结果包括尺寸、宽高比、百万像素和文件体积。\n\n### 国内镜像与离线模式\n\n可以通过环境变量指定一个或多个镜像前缀：\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\n即使使用镜像，所有文件仍必须通过固定 SHA-256 校验。禁止网络访问时使用：\n\n```bash\npython scripts/setup.py --offline\n```\n\n### 注意事项\n\n- AI 增强会重建纹理，不代表恢复了原始图片中不存在的真实信息。\n- 8K 处理需要较多显存、内存和临时磁盘空间。\n- 显存不足时依次尝试 `--tile 256` 和 `--tile 128`。\n- JPEG 压缩不保留透明通道；如果背景颜色很重要，请先明确转换背景。\n- 除非明确传入 `--overwrite`，压缩工具不会覆盖已有输出。\n\n### 联系方式\n\n更多 Skill 定制或功能需求，可以联系大瑜：`helloaigc2023`。\n\n---\n\n## English\n\n### Overview\n\nLocal Image Upscaler is a local image-enhancement Skill for macOS and Windows x64. It uses local AI models to upscale images, export resolution presets, compress images to strict file-size targets, and inspect image properties before processing. Images are never uploaded, and source files are not overwritten by default.\n\n### Features\n\n- High-fidelity AI upscaling for photos, screenshots, and AI-generated artwork\n- `1K`, `2K`, `4K`, and `8K` presets\n- Custom long-edge sizes without stretching\n- Native 4× model output\n- Strict file-size targets, such as compressing an approximately 1MB image to 200KB or less\n- Quality-first compression with proportional resizing only when necessary\n- Single-image and folder batch processing\n- Image dimension, aspect-ratio, megapixel, and file-size inspection\n- macOS and Windows x64 support\n- Mirror fallback for restricted networks, offline caching, and SHA-256 verification\n\n### Supported Formats\n\n- Input: JPG, JPEG, PNG, WebP\n- Upscale output: PNG, JPG, WebP (exact-size WebP has platform limitations)\n- Target-size compression output: JPEG\n\n### Prepare the Runtime\n\nRun this command from the Skill directory:\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\nUse the smaller model for previews or lower-spec devices:\n\n```bash\npython scripts/setup.py --model lite\n```\n\nThe first setup downloads a pinned Upscayl NCNN runtime and model files, verifies every artifact with SHA-256, and caches them for later offline use.\n\n### Upscale to a Resolution Preset\n\n```bash\npython scripts/upscale.py input.png --target 1k\npython scripts/upscale.py input.png --target 2k\npython scripts/upscale.py input.png --target 4k\npython scripts/upscale.py input.png --target 8k --tile 256\n```\n\nPresets refer to the image's long edge:\n\n- 1K: 1920 pixels\n- 2K: 2560 pixels\n- 4K: 3840 pixels\n- 8K: 7680 pixels\n\nThe source aspect ratio is always preserved. A 16:9 image becomes 3840×2160 at 4K, while a square image becomes 3840×3840.\n\nUse a custom long edge:\n\n```bash\npython scripts/upscale.py input.png --max-edge 3000\n```\n\nKeep the model's native 4× output:\n\n```bash\npython scripts/upscale.py input.png --target scale4\n```\n\n### Compress to a Target File Size\n\nCompress an image to 200KB or less:\n\n```bash\npython scripts/compress.py input.png --output output.jpg --target-kb 200\n```\n\nCompress an image to 1.5MB or less:\n\n```bash\npython scripts/compress.py input.png --target-mb 1.5\n```\n\nAdjust quality only and keep the original dimensions:\n\n```bash\npython scripts/compress.py input.png --target-kb 200 --keep-dimensions\n```\n\nThe command fails clearly if the target cannot be reached at the original dimensions.\n\n### Batch Processing\n\nBatch upscale a folder:\n\n```bash\npython scripts/upscale.py input-folder --output output-folder --target 4k\n```\n\nRecursively compress a folder:\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive\n```\n\nPreview a batch job without writing files:\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive --dry-run\n```\n\n### Inspect Images\n\n```bash\npython scripts/inspect.py input.png\npython scripts/inspect.py input-folder --recursive --json\n```\n\nThe report includes dimensions, simplified aspect ratio, megapixels, and file size.\n\n### Mirrors and Offline Mode\n\nConfigure one or more mirror prefixes through an environment variable:\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\nArtifacts from mirrors must pass the same pinned SHA-256 checks. To forbid network access:\n\n```bash\npython scripts/setup.py --offline\n```\n\n### Notes\n\n- AI enhancement reconstructs texture; it cannot recover factual detail that was absent from the source.\n- 8K processing requires substantial GPU memory, system memory, and temporary disk space.\n- On GPU-memory errors, try `--tile 256`, then `--tile 128`.\n- JPEG compression does not preserve transparency; convert the background explicitly first when its color matters.\n- Existing outputs are not overwritten unless `--overwrite` is explicitly supplied.\n\n### Contact\n\nFor more Skill customization or feature requests, contact Dayu: `helloaigc2023`.\n\nFile v1.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn72j0qng9f6mm49z983cyzw1982naag\",\n  \"slug\": \"local-image-upscaler\",\n  \"version\": \"1.1.0\",\n  \"publishedAt\": 1784704153091\n}\n\nFile v1.1.0:references/licenses.md\n\n# Upstream Licenses and Attribution\n\nThis Skill's scripts and instructions do not bundle third-party executables or model weights. Setup downloads the following pinned upstream artifacts on demand:\n\n- Upscayl NCNN command-line runtime: <https://github.com/upscayl/upscayl-ncnn>\n- Upscayl model files: <https://github.com/upscayl/upscayl/tree/main/resources/models>\n\nUpscayl is distributed under the GNU Affero General Public License v3.0. Review the upstream license and individual model provenance before redistributing downloaded runtime or model files. Keep upstream license notices with redistributed copies. This Skill does not change the upstream license terms.\n\nFile v1.1.0:references/platforms.md\n\n# Platform and Storage Reference\n\n## Supported systems\n\n- macOS 12 or newer on Apple Silicon or Intel. The runtime is a universal binary and uses Metal through MoltenVK.\n- Windows 10/11 x64 with a Vulkan-capable GPU and current graphics driver.\n- Windows ARM is not supported by the pinned runtime. x64 emulation does not guarantee Vulkan compatibility.\n- Linux is intentionally omitted from version 1.0 to keep the tested support surface focused.\n\n## Approximate storage\n\nThe Skill itself is under 1 MB. Cached components use approximately:\n\n- macOS runtime: 9 MB download plus 28 MB extracted.\n- Windows runtime: 2.5 MB download plus 8 MB extracted.\n- High-fidelity model: 34 MB.\n- Lite model: 2.5 MB.\n- Output images: varies; lossless 4K PNG files are commonly 5–30 MB each.\n\nThe cache is stored in `~/.cache/image-upscaler` on macOS and `%LOCALAPPDATA%\\image-upscaler` on Windows. Override it with `IMAGE_UPSCALER_CACHE`.\n\n## Download order\n\n1. Existing verified cache.\n2. Prefixes in `IMAGE_UPSCALER_MIRRORS`, in the supplied order.\n3. The bundled GitHub acceleration prefix.\n4. Official GitHub or raw GitHub URL.\n\nAll paths use the same pinned SHA-256 digests. A mirror cannot substitute a modified binary or model without being rejected.\n\nFor a private mirror, mirror the exact upstream URL hierarchy and set a prefix, or use a prefix containing `{url}`. Example: `https://mirror.example/fetch?url={url}`.\n\n## Troubleshooting\n\n- `Unsupported platform`: use macOS or Windows x64.\n- `All download sources failed`: set `IMAGE_UPSCALER_MIRRORS` to a reachable internal/domestic proxy, or prefill the cache on a connected machine.\n- `SHA-256 mismatch`: do not continue. Remove only the named `.part` or cached artifact and retry from another source.\n- Vulkan or GPU error: update the graphics driver and verify Vulkan support. Virtual machines often lack sufficient Vulkan passthrough.\n- Out of GPU memory: retry `upscale.py` with `--tile 256`, then `--tile 128`.\n- Slow processing: use `--model lite`, avoid `--tta`, and process files one at a time.\n- Exact WebP resizing is intentionally not performed through platform APIs. Use PNG/JPEG for exact 2K/4K dimensions, or WebP with `--target scale4`.\n\nFile v1.1.0:skill-card.md\n\n## Description: <br>\nUpscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including 1K/2K/4K/8K output, custom long edges, strict target file sizes, batch folders, aspect-ratio preservation, offline reuse, and verified download fallbacks. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[harven-droid](https://clawhub.ai/user/harven-droid) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, designers, and image creators use this skill to inspect, upscale, batch-process, and compress local JPG, PNG, or WebP images on supported macOS and Windows systems while keeping files on the local machine. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: First setup can download pinned Upscayl runtime and model files, including through configured mirrors. <br>\nMitigation: Use offline mode when downloads are not acceptable, review mirror settings in controlled environments, and rely on SHA-256 verification for downloaded artifacts. <br>\nRisk: Batch processing can read and transform local image folders that may contain sensitive files. <br>\nMitigation: Run the skill only on intended folders, use dry-run planning for large compression jobs, and keep processing local. <br>\nRisk: Image upscaling reconstructs visual texture and may add detail that was not present in the source. <br>\nMitigation: Treat outputs as visual enhancement, not recovery of factual detail, and avoid presenting generated texture as original information. <br>\nRisk: High-resolution targets such as 8K can require substantial GPU memory and temporary storage. <br>\nMitigation: Check available capacity before processing and use smaller tiles, the lite model, or lower targets when resources are limited. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/harven-droid/skills/local-image-upscaler) <br>\n- [Platform and Storage Reference](artifact/references/platforms.md) <br>\n- [Upstream Licenses and Attribution](artifact/references/licenses.md) <br>\n- [Upscayl NCNN Runtime](https://github.com/upscayl/upscayl-ncnn) <br>\n- [Upscayl Model Files](https://github.com/upscayl/upscayl/tree/main/resources/models) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance, files] <br>\n**Output Format:** [Markdown with bash command blocks, output file paths, and optional JSON inspection reports] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Produces local image files for upscale and compression actions; source images are not overwritten by default.] <br>\n\n## Skill Version(s): <br>\n1.1.0 (source: ClawHub release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.1.0:assets/manifest.json\n\n{\n  \"schema_version\": 1,\n  \"runtime_version\": \"20251207-174704\",\n  \"default_mirror_prefixes\": [\n    \"https://ghfast.top/\"\n  ],\n  \"platforms\": {\n    \"darwin-universal\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-macos.zip\",\n      \"sha256\": \"277419791281a56eae0c739c70120b974d7267cf7c2de8e86dc09798d4b314db\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-macos\",\n      \"executable\": \"upscayl-bin\"\n    },\n    \"windows-x64\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-windows.zip\",\n      \"sha256\": \"1f0f65c5d2ade866555e2ac467d35952c35a47080a4060fe56a1ab028f67258a\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-windows\",\n      \"executable\": \"upscayl-bin.exe\"\n    }\n  },\n  \"models\": {\n    \"high-fidelity\": {\n      \"engine_name\": \"high-fidelity-4x\",\n      \"files\": [\n        {\n          \"name\": \"high-fidelity-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.bin\",\n          \"sha256\": \"8a135402b4f39286121b76abb47601a6b7b7e8d4f3e999a5aaa45ed277824fb4\"\n        },\n        {\n          \"name\": \"high-fidelity-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.param\",\n          \"sha256\": \"4576ed5c2fc5fa250d3c3d585ef02248f26abdfc1867088078f501fe71e5d61e\"\n        }\n      ]\n    },\n    \"lite\": {\n      \"engine_name\": \"upscayl-lite-4x\",\n      \"files\": [\n        {\n          \"name\": \"upscayl-lite-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.bin\",\n          \"sha256\": \"85ee266b632a765a725425ba6a5620c088c8aa2939a03063b2d83b3462724cc1\"\n        },\n        {\n          \"name\": \"upscayl-lite-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.param\",\n          \"sha256\": \"22174924330297357434ad21ed0af7f4b820008d2a502b492754d130d4142714\"\n        }\n      ]\n    }\n  }\n}\n\nFile v1.1.0:agents/openai.yaml\n\ninterface:\n  display_name: \"Image Upscaler\"\n  short_description: \"Upscale to 1K–8K, inspect, and compress image files\"\n  default_prompt: \"Use $image-upscaler to resize or compress this image while preserving its aspect ratio.\"\npolicy:\n  allow_implicit_invocation: true\n\nArchive v1.0.0: 9 files, 13464 bytes\n\nFiles: agents/openai.yaml (259b), assets/manifest.json (2083b), references/licenses.md (668b), references/platforms.md (2204b), scripts/setup.py (7382b), scripts/upscale.py (11788b), skill-card.md (2613b), SKILL.md (3887b), _meta.json (139b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: image-upscaler\ndescription: Upscale JPG, PNG, or WebP images with local AI on macOS or Windows, including 4K output, single-image or batch processing, aspect-ratio preservation, offline reuse, and verified download fallbacks for restricted networks. Use when the user asks to make an image clearer, enlarge AI-generated art, upscale to 2K/4K, improve resolution without stretching, or build a repeatable local enhancement workflow.\n---\n\n# Image Upscaler\n\nUse the bundled Python scripts to run Upscayl's Vulkan-based NCNN engine locally. Preserve the source aspect ratio by default and never overwrite an input file.\n\n## Workflow\n\n1. Inspect the input path, file type, dimensions, and available disk space.\n2. Choose a model:\n   - `high-fidelity`: default for photos, GPT-generated images, and best visible detail.\n   - `lite`: faster and about 30 MB smaller; use for previews or low-memory devices.\n3. If the selected runtime or model is not cached, explain the download and disk cost, then run setup. Read [platforms.md](references/platforms.md) for compatibility and cache sizes.\n4. Run the upscaler. Prefer PNG for maximum quality; use JPEG only when the user prioritizes file size.\n5. Verify that the output exists, has the requested dimensions, and keeps the source ratio. Report the output path and file size.\n\n## Prepare the Runtime\n\nRun from this skill directory:\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\nThe downloader tries the local cache, configured mirrors, a verified GitHub acceleration endpoint, and the official source. Every downloaded artifact must match the pinned SHA-256 digest. To use an organization or domestic mirror, set `IMAGE_UPSCALER_MIRRORS` to one or more comma-separated URL prefixes before setup. Each prefix is prepended to the official URL. Example:\n\n```bash\nIMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py\n```\n\nUse `--offline` to forbid all network access. Use `--platform windows-x64 --download-only` to prefetch Windows files from another machine.\n\n## Upscale Images\n\nCreate a 4K image whose long edge is 3840 pixels while preserving the original ratio:\n\n```bash\npython scripts/upscale.py INPUT --output OUTPUT.png --target 4k\n```\n\nUseful variants:\n\n```bash\npython scripts/upscale.py INPUT --target 2k --model lite\npython scripts/upscale.py INPUT --target scale4 --format png\npython scripts/upscale.py INPUT_FOLDER --output OUTPUT_FOLDER --target 4k\npython scripts/upscale.py INPUT --target 4k --format jpg --compression 92\n```\n\n`4k` means a 3840-pixel long edge, so a 16:9 landscape becomes 3840×2160, a portrait keeps its portrait ratio, and a square becomes 3840×3840. `scale4` keeps the model's native 4× output. Do not force 3840×2160 onto non-16:9 images because that stretches them.\n\nExact 2K/4K output supports PNG and JPEG without extra dependencies. WebP is supported with `--target scale4`; use PNG when an exact target and transparency both matter.\n\n## Safety and Quality Rules\n\n- Never delete or replace source images.\n- Do not install GPU drivers, package managers, or system dependencies automatically.\n- Do not bypass SHA-256 verification, even when using a mirror.\n- Do not upload user images; processing must stay local.\n- Avoid TTA unless the user explicitly accepts a roughly 8× processing slowdown.\n- On GPU-memory errors, retry with `--tile 256`, then `--tile 128`.\n- If Vulkan is unavailable, stop and explain the platform limitation; do not silently switch to an unrelated cloud service.\n- Treat visual enhancement as reconstruction, not recovery of factual detail. Do not claim that invented texture is original information.\n\n## References\n\n- Read [platforms.md](references/platforms.md) for supported systems, storage, cache, mirror, and troubleshooting details.\n- Read [licenses.md](references/licenses.md) before redistributing the engine or model files.\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn72j0qng9f6mm49z983cyzw1982naag\",\n  \"slug\": \"local-image-upscaler\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1784701048244\n}\n\nFile v1.0.0:references/licenses.md\n\n# Upstream Licenses and Attribution\n\nThis Skill's scripts and instructions do not bundle third-party executables or model weights. Setup downloads the following pinned upstream artifacts on demand:\n\n- Upscayl NCNN command-line runtime: <https://github.com/upscayl/upscayl-ncnn>\n- Upscayl model files: <https://github.com/upscayl/upscayl/tree/main/resources/models>\n\nUpscayl is distributed under the GNU Affero General Public License v3.0. Review the upstream license and individual model provenance before redistributing downloaded runtime or model files. Keep upstream license notices with redistributed copies. This Skill does not change the upstream license terms.\n\nFile v1.0.0:references/platforms.md\n\n# Platform and Storage Reference\n\n## Supported systems\n\n- macOS 12 or newer on Apple Silicon or Intel. The runtime is a universal binary and uses Metal through MoltenVK.\n- Windows 10/11 x64 with a Vulkan-capable GPU and current graphics driver.\n- Windows ARM is not supported by the pinned runtime. x64 emulation does not guarantee Vulkan compatibility.\n- Linux is intentionally omitted from version 1.0 to keep the tested support surface focused.\n\n## Approximate storage\n\nThe Skill itself is under 1 MB. Cached components use approximately:\n\n- macOS runtime: 9 MB download plus 28 MB extracted.\n- Windows runtime: 2.5 MB download plus 8 MB extracted.\n- High-fidelity model: 34 MB.\n- Lite model: 2.5 MB.\n- Output images: varies; lossless 4K PNG files are commonly 5–30 MB each.\n\nThe cache is stored in `~/.cache/image-upscaler` on macOS and `%LOCALAPPDATA%\\image-upscaler` on Windows. Override it with `IMAGE_UPSCALER_CACHE`.\n\n## Download order\n\n1. Existing verified cache.\n2. Prefixes in `IMAGE_UPSCALER_MIRRORS`, in the supplied order.\n3. The bundled GitHub acceleration prefix.\n4. Official GitHub or raw GitHub URL.\n\nAll paths use the same pinned SHA-256 digests. A mirror cannot substitute a modified binary or model without being rejected.\n\nFor a private mirror, mirror the exact upstream URL hierarchy and set a prefix, or use a prefix containing `{url}`. Example: `https://mirror.example/fetch?url={url}`.\n\n## Troubleshooting\n\n- `Unsupported platform`: use macOS or Windows x64.\n- `All download sources failed`: set `IMAGE_UPSCALER_MIRRORS` to a reachable internal/domestic proxy, or prefill the cache on a connected machine.\n- `SHA-256 mismatch`: do not continue. Remove only the named `.part` or cached artifact and retry from another source.\n- Vulkan or GPU error: update the graphics driver and verify Vulkan support. Virtual machines often lack sufficient Vulkan passthrough.\n- Out of GPU memory: retry `upscale.py` with `--tile 256`, then `--tile 128`.\n- Slow processing: use `--model lite`, avoid `--tta`, and process files one at a time.\n- Exact WebP resizing is intentionally not performed through platform APIs. Use PNG/JPEG for exact 2K/4K dimensions, or WebP with `--target scale4`.\n\nFile v1.0.0:skill-card.md\n\n## Description: <br>\nUpscale JPG, PNG, or WebP images with local AI on macOS or Windows, including 4K output, single-image or batch processing, aspect-ratio preservation, offline reuse, and verified download fallbacks for restricted networks. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[harven-droid](https://clawhub.ai/user/harven-droid) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, creators, and agent operators use this skill to enlarge local images to 2K, 4K, or native 4x output while preserving aspect ratio and avoiding cloud image upload. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The setup flow downloads and caches a local runtime and model files. <br>\nMitigation: Use offline mode with a prefilled cache or a trusted mirror when network provenance matters, and keep SHA-256 verification enabled. <br>\nRisk: The upscaling workflow reads selected local images and writes new output files. <br>\nMitigation: Point the skill only at intended image paths and review the output path before running batch jobs. <br>\nRisk: Windows exact resizing uses PowerShell with inherited environment variables. <br>\nMitigation: Run from an environment without highly sensitive variables when using Windows exact 2K or 4K resizing. <br>\nRisk: AI upscaling can reconstruct or invent visual texture. <br>\nMitigation: Treat enhanced detail as visual reconstruction, not factual recovery of original information. <br>\n\n\n## Reference(s): <br>\n- [Platform and Storage Reference](references/platforms.md) <br>\n- [Upstream Licenses and Attribution](references/licenses.md) <br>\n- [Upscayl NCNN runtime](https://github.com/upscayl/upscayl-ncnn) <br>\n- [Upscayl model files](https://github.com/upscayl/upscayl/tree/main/resources/models) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and file paths] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May produce local image files through the bundled upscaling script; the agent reports output path, dimensions, and file size.] <br>\n\n## Skill Version(s): <br>\n1.0.0 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.0:assets/manifest.json\n\n{\n  \"schema_version\": 1,\n  \"runtime_version\": \"20251207-174704\",\n  \"default_mirror_prefixes\": [\n    \"https://ghfast.top/\"\n  ],\n  \"platforms\": {\n    \"darwin-universal\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-macos.zip\",\n      \"sha256\": \"277419791281a56eae0c739c70120b974d7267cf7c2de8e86dc09798d4b314db\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-macos\",\n      \"executable\": \"upscayl-bin\"\n    },\n    \"windows-x64\": {\n      \"url\": \"https://github.com/upscayl/upscayl-ncnn/releases/download/20251207-174704/upscayl-bin-20251207-174704-windows.zip\",\n      \"sha256\": \"1f0f65c5d2ade866555e2ac467d35952c35a47080a4060fe56a1ab028f67258a\",\n      \"archive_root\": \"upscayl-bin-20251207-174704-windows\",\n      \"executable\": \"upscayl-bin.exe\"\n    }\n  },\n  \"models\": {\n    \"high-fidelity\": {\n      \"engine_name\": \"high-fidelity-4x\",\n      \"files\": [\n        {\n          \"name\": \"high-fidelity-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.bin\",\n          \"sha256\": \"8a135402b4f39286121b76abb47601a6b7b7e8d4f3e999a5aaa45ed277824fb4\"\n        },\n        {\n          \"name\": \"high-fidelity-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/high-fidelity-4x.param\",\n          \"sha256\": \"4576ed5c2fc5fa250d3c3d585ef02248f26abdfc1867088078f501fe71e5d61e\"\n        }\n      ]\n    },\n    \"lite\": {\n      \"engine_name\": \"upscayl-lite-4x\",\n      \"files\": [\n        {\n          \"name\": \"upscayl-lite-4x.bin\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.bin\",\n          \"sha256\": \"85ee266b632a765a725425ba6a5620c088c8aa2939a03063b2d83b3462724cc1\"\n        },\n        {\n          \"name\": \"upscayl-lite-4x.param\",\n          \"url\": \"https://raw.githubusercontent.com/upscayl/upscayl/main/resources/models/upscayl-lite-4x.param\",\n          \"sha256\": \"22174924330297357434ad21ed0af7f4b820008d2a502b492754d130d4142714\"\n        }\n      ]\n    }\n  }\n}\n\nFile v1.0.0:agents/openai.yaml\n\ninterface:\n  display_name: \"Image Upscaler\"\n  short_description: \"Upscale images to crisp 4K on macOS or Windows\"\n  default_prompt: \"Use $image-upscaler to upscale this image to 4K while preserving its aspect ratio.\"\npolicy:\n  allow_implicit_invocation: true","readmeExcerpt":"Skill: Local Image Upscaler Owner: harven-droid Summary: Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-... Tags: latest:1.2.2 Version history: v1.2.2 | 2026-07-22T09:52:12.907Z | user Verify the pinned runtime executable and selected model with SHA-256 before every upscale, including custom cache directories","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python scripts/setup.py --model high-fidelity"},{"language":"bash","snippet":"python scripts/setup.py --list-models"},{"language":"bash","snippet":"python scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp"},{"language":"bash","snippet":"IMAGE_UPSCALER_MIRRORS=\"https://mirror.example/proxy/\" python scripts/setup.py"},{"language":"bash","snippet":"python scripts/upscale.py INPUT --output OUTPUT.png --target 4k"},{"language":"bash","snippet":"python scripts/upscale.py INPUT --target 1k\npython scripts/upscale.py INPUT --target 2k --profile fast\npython scripts/upscale.py INPUT --target 4k --profile portrait\npython scripts/upscale.py INPUT --target 4k --profile digital-art\npython scripts/upscale.py INPUT --target 4k --profile sharp\npython scripts/upscale.py INPUT --target 8k --profile photo --tile 256\npython scripts/upscale.py INPUT --target scale4 --format png\npython scripts/upscale.py INPUT_FOLDER --output OUTPUT_FOLDER --target 4k\npython scripts/upscale.py INPUT --target 4k --format jpg --compression 92"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: image-upscaler\ndescription: Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-detail, balanced, and fast profiles; 1K/2K/4K/8K output; custom long edges; strict target file sizes; batch folders; aspect-ratio preservation; offline reuse; and verified download fallbacks. Use when the user asks to make an image clearer, enlarge AI-generated art, compare enhancement algorithms, inspect image resolution, upscale without stretching, or reduce a larger image to a target such as 200KB.\n---\n\n# Image Upscaler\n\nUse the bundled Python scripts to run Upscayl's Vulkan-based NCNN engine locally. Download models only when selected. Preserve the source aspect ratio by default and never overwrite an input file.\n\n## Workflow\n\n1. Inspect the input path, file type, dimensions, and available disk space.\n2. Inspect the image visually and recommend one profile. If the choice materially affects the result, give the user a compact choice with the advantage, disadvantage, and additional download size. Do not block if the user does not choose; use `default`.\n3. Choose a profile:\n   - `default`: balanced and conservative; use when content is mixed or uncertain. Model download: about 32 MB.\n   - `fast`: smallest and fastest; weaker fine-detail reconstruction. Model download: about 2.5 MB.\n   - `photo`: natural photographic texture; less crisp on text and architecture. Model download: about 32 MB.\n   - `portrait`: use for compressed, noisy, or rough natural portraits that benefit from smoother rendering. It avoids face replacement but can remove fine skin texture. Use `default` for already-clean AI portraits and sharp studio headshots. Model download: about 32 MB, shared with `photo`.\n   - `digital-art`: clean anime, illustration, and icon edges; may oversimplify photographic texture. Model download: about 8.6 MB.\n   - `sharp`: strongest apparent edge detail; may exaggerate noise, halos, skin, or text artifacts. Model download: about 32 MB.\n4. If the selected runtime or model is not cached, explain the download and disk cost, then run setup. Read [platforms.md](references/platforms.md) for compatibility and cache sizes.\n5. Run the upscaler or compressor. Prefer PNG for maximum upscale quality; use JPEG for strict file-size targets.\n6. Verify that the output exists, has the requested dimensions, and keeps the source ratio. Report the selected profile, output path, dimensions, and file size.\n\nThe agent performs the meaningful automatic selection after visually inspecting the image. CLI `--profile auto` uses filename hints only and otherwise falls back conservatively to `default`; it does not claim reliable face or scene classification without an extra vision package. Read [algorithms.md](references/algorithms.md) when comparing profiles or discussing heavier optional algorithms.\n\nFor portraits, inspect source quality before selecting by subject alone: choose `defa"},{"path":"README.md","content":"# Local Image Upscaler / 本地图像增强工具\n\n## 中文\n\n### 简介\n\nLocal Image Upscaler 是一个面向 macOS 和 Windows x64 的本地图像增强 Skill。它可以使用本地 AI 模型放大图片、按指定分辨率输出、将图片压缩到目标体积，并在处理前检查图片信息。图片不会上传到云端，源文件默认不会被覆盖。\n\n### 主要功能\n\n- AI 高保真放大，适合照片、截图和 AI 生成图片\n- 根据图片自动推荐算法，也可由用户选择默认、快速、照片、人像、插画或锐利细节模式\n- 每种算法在下载前说明优点、缺点和新增空间，模型按需下载\n- `1K`、`2K`、`4K`、`8K` 分辨率预设\n- 自定义长边尺寸，不拉伸原图\n- 原生 4× 放大\n- 严格控制目标体积，例如将约 1MB 图片压缩到 200KB 以内\n- 压缩时优先保留尺寸和画质，必要时才等比例缩小\n- 单张图片与文件夹批量处理\n- 图片尺寸、比例、像素和体积检查\n- macOS 与 Windows x64 支持\n- 国内网络镜像回退、离线缓存和 SHA-256 完整性校验\n\n### 支持格式\n\n- 输入：JPG、JPEG、PNG、WebP\n- 放大输出：PNG、JPG、WebP（WebP 精确尺寸存在平台限制）\n- 目标体积压缩输出：JPEG\n\n### 算法怎么选\n\n如果用户没有指定，Skill 会先观察图片并推荐模式；用户不想选择时使用保守的默认模式。人脸生成式修复不会自动开启。\n\n| 模式 | 适合 | 优点 | 缺点 | 首次下载 |\n| --- | --- | --- | --- | ---: |\n| `default` | 类型不确定或混合图片 | 均衡、保守 | 不追求最强锐度 | 约 32MB |\n| `fast` | 预览、批处理、低配置设备 | 最快、最小 | 细节重建较弱 | 约 2.5MB |\n| `photo` | 自然照片 | 质感和明暗过渡自然 | 硬边不如锐利模式 | 约 32MB |\n| `portrait` | 有噪点、压缩或较粗糙的真实人像 | 不替换五官，过渡更柔和 | 会抹掉清晰AI人像的部分皮肤细节 | 与照片模式共用 |\n| `digital-art` | 动漫、插画、图标 | 线条干净、模型小 | 可能简化照片纹理 | 约 8.6MB |\n| `sharp` | 建筑、商品、游戏素材 | 视觉锐度最强 | 可能放大噪点、光晕和皮肤纹理 | 约 32MB |\n\n查看模型、缓存状态和增量下载空间，不会安装任何内容：\n\n```bash\npython scripts/setup.py --list-models\n```\n\n不要仅因为画面中有人就选择人像模式：清晰AI人像和棚拍头像优先用 `default`；只有真实人像存在噪点、压缩或纹理粗糙时才推荐 `portrait`。\n\n### 准备运行环境\n\n进入 Skill 目录后运行：\n\n```bash\npython scripts/setup.py --model high-fidelity\n```\n\n快速预览或低配置设备可以使用轻量模型：\n\n```bash\npython scripts/setup.py --model lite\n```\n\n也可以只准备选中的模式：\n\n```bash\npython scripts/setup.py --profile photo\npython scripts/setup.py --profile digital-art\npython scripts/setup.py --profile sharp\n```\n\n首次运行会下载固定版本的 Upscayl NCNN 运行时和模型，并进行 SHA-256 校验。每次执行放大前还会重新校验缓存中的可执行文件和所选模型，后续可以安全地离线复用缓存。\n\n### 放大到指定分辨率\n\n```bash\npython scripts/upscale.py input.png --target 1k\npython scripts/upscale.py input.png --target 2k\npython scripts/upscale.py input.png --target 4k\npython scripts/upscale.py input.png --target 8k --tile 256\n```\n\n指定算法模式：\n\n```bash\npython scripts/upscale.py input.png --target 4k --profile portrait\npython scripts/upscale.py input.png --target 4k --profile digital-art\npython scripts/upscale.py input.png --target 4k --profile sharp\n```\n\n分辨率预设指图片长边：\n\n- 1K：1920 像素\n- 2K：2560 像素\n- 4K：3840 像素\n- 8K：7680 像素\n\n原图比例始终保留。例如，16:9 图片输出为 4K 时是 3840×2160；正方形图片则是 3840×3840。\n\n自定义长边：\n\n```bash\npython scripts/upscale.py input.png --max-edge 3000\n```\n\n保留模型原生 4×结果：\n\n```bash\npython scripts/upscale.py input.png --target scale4\n```\n\n### 压缩到目标体积\n\n将图片压缩到不超过 200KB：\n\n```bash\npython scripts/compress.py input.png --output output.jpg --target-kb 200\n```\n\n将图片压缩到不超过 1.5MB：\n\n```bash\npython scripts/compress.py input.png --target-mb 1.5\n```\n\n只调整质量，不允许降低尺寸：\n\n```bash\npython scripts/compress.py input.png --target-kb 200 --keep-dimensions\n```\n\n如果保持原尺寸无法达到目标体积，命令会直接报错。\n\n### 批量处理\n\n批量放大：\n\n```bash\npython scripts/upscale.py input-folder --output output-folder --target 4k\n```\n\n批量压缩，包括子目录：\n\n```bash\npython scripts/compress.py input-folder --output output-folder --target-kb 200 --recursive\n```\n\n先预览批量任务，不写入文件：\n\n```bash\npython scripts/compress.py input-folder --output output-folde"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn72j0qng9f6mm49z983cyzw1982naag\",\n  \"slug\": \"local-image-upscaler\",\n  \"version\": \"1.2.2\",\n  \"publishedAt\": 1784713932907\n}"},{"path":"references/algorithms.md","content":"# Algorithm Profiles\n\n## Selection policy\n\nInspect the image visually before invoking the script. Recommend a profile and state its advantage, disadvantage, and uncached download size. If the user does not choose, use `default`. Never enable generative face restoration silently.\n\n| Profile | Model | Best use | Advantage | Limitation | Download |\n| --- | --- | --- | --- | --- | ---: |\n| `default` | high-fidelity-4x | Unknown or mixed images | Balanced and conservative | Does not maximize any one content type | ~32 MB |\n| `fast` | upscayl-lite-4x | Preview and batch processing | Fastest and smallest | Less reconstructed detail | ~2.5 MB |\n| `photo` | remacri-4x | Natural photographs | Smooth tonal transitions and natural texture | Softer than `sharp` on hard edges | ~32 MB |\n| `portrait` | remacri-4x | Noisy, compressed, or rough natural portraits | Avoids generative face replacement and smooths transitions | Can remove skin and eyelash detail from clean AI portraits | Shared with `photo` |\n| `digital-art` | digital-art-4x | Anime, illustration, icons | Clean synthetic edges, compact model | Can flatten photographic texture | ~8.6 MB |\n| `sharp` | ultrasharp-4x | Architecture, products, game assets | Strongest apparent edge detail | Can amplify noise, halos, pores, and text artifacts | ~32 MB |\n\n`auto` means the agent selects a profile after visual inspection. The standalone CLI has no bundled vision classifier; it uses explicit filename hints for digital art and otherwise falls back to `default`.\n\nDo not route by subject alone. A same-size comparison on a clean AI portrait showed that `default` retained more eyelashes, eyebrows, and skin texture, while `portrait` produced smoother skin and a smaller output. Route clean AI and studio portraits to `default`; reserve `portrait` for degraded natural portraits.\n\n## 8K behavior\n\nThe bundled models produce a native 4× result. Exact 1K/2K/4K/8K presets then resize that result to the requested long edge. If the requested 8K dimensions exceed native 4× output, the extra pixels are interpolation rather than newly recovered factual detail. Prefer a clearly labeled comparison crop when evaluating results.\n\n## Heavy optional algorithms\n\nDo not install these by default:\n\n- SwinIR or HAT: transformer restoration with stronger benchmark reconstruction, but requires a substantially larger PyTorch environment and slower inference.\n- CodeFormer or GFPGAN: face restoration that can improve damaged portraits, but may change identity. Require explicit user consent and expose fidelity controls.\n- SUPIR: diffusion restoration with strong perceived detail, but high GPU-memory use, slow inference, generative hallucination risk, and non-commercial-use restrictions in the upstream project.\n\nKeep heavy algorithms in separate optional adapters and report their complete environment, model, temporary-file, and output storage costs before installation."},{"path":"references/licenses.md","content":"# Upstream Licenses and Attribution\n\nThis Skill's scripts and instructions do not bundle third-party executables or model weights. Setup downloads the following pinned upstream artifacts on demand:\n\n- Upscayl NCNN command-line runtime: <https://github.com/upscayl/upscayl-ncnn>\n- Upscayl model files, including High Fidelity, Lite, Digital Art, Remacri, and Ultrasharp profiles: <https://github.com/upscayl/upscayl/tree/main/resources/models>\n\nUpscayl is distributed under the GNU Affero General Public License v3.0. Review the upstream license and each model's provenance before redistributing downloaded runtime or model files; model availability in the upstream repository does not erase separate upstream model terms. Keep all applicable notices with redistributed copies. This Skill downloads models on demand and does not change upstream license terms."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-... Skill: Local Image Upscaler Owner: harven-droid Summary: Upscale, inspect, or compress JPG, PNG, or WebP images locally on macOS or Windows, including automatic or user-selected photo, portrait, digital-art, sharp-... Tags: latest:1.2.2 Version history: v1.2.2 | 2026-07-22T09:52:12.907Z | user Verify the pinned runtime executable and selected model with SHA-256 before every upscale, including custom cache directories","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1612,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-12T00:24:45.553Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-12T00:24:45.553Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-13T19:53:28.473Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}