Agent skill
waifu2x
Use when the user wants to upscale one image or a folder of images with waifu2x-ncnn-vulkan, including default or custom scale, noise reduction, model, format, tile size, and batch processing.
Install this agent skill to your Project
npx add-skill https://github.com/eryet/codex-skill-collection/tree/main/skills/waifu2x
SKILL.md
Waifu2x
Use this skill when the user wants local image upscaling with waifu2x-ncnn-vulkan.
Keep the workflow practical:
- Resolve the input path.
- Choose defaults or gather custom options.
- Find the waifu2x executable.
- Run the upscaling command.
- Report output paths, sizes, and any failures.
Input resolution
Determine the input path in this order:
- A path explicitly supplied with the skill invocation or user message.
- A path inferred from attached or pasted image metadata when available.
- Ask the user for the file or folder path only if no reliable path is available.
Then determine whether the path is a file or a directory.
- If it is a file, verify it exists and process that single image.
- If it is a directory, enumerate only the top-level files matching:
*.png,*.jpg,*.jpeg,*.webp,*.bmp,*.tga - In folder mode, skip files whose names already contain
_waifu2x_. - If no matching files are found, tell the user and stop.
Defaults and customization
If the user asks for a quick run, default run, or uses -d / --default, do not ask follow-up questions. Use:
- scale:
2 - noise:
2 - model:
models-cunet - format:
png - tile:
0
Otherwise, prefer asking a single concise question only when the user has not already provided enough detail. Supported options:
- scale:
1,2,4 - noise:
-1,0,1,2,3 - model:
models-cunetmodels-upconv_7_anime_style_art_rgbmodels-upconv_7_photo
- format:
png,jpg,webp - tile:
0,32,64,128,256,400
If the user says "use defaults", apply the default values above immediately.
Finding the executable
Prefer this order:
- Check the Codex memory file
reference_waifu2x_path.mdunder the user's Codex memories directory. If$CODEX_HOMEis available, prefer$CODEX_HOME/memories/reference_waifu2x_path.md. - Try resolving
waifu2x-ncnn-vulkanfromPATH. - Search common local locations only if needed.
- Ask the user for the full path to
waifu2x-ncnn-vulkan.exeif it still cannot be found.
Whenever the user provides a valid executable path, update that memory file so future runs can reuse it.
When using a full executable path, compute the model directory relative to the executable's folder.
Command construction
Name each output file:
<original-name>_waifu2x_<scale>x.<format>
Place the output beside the source image.
Command shape:
<waifu2x-path> -i "<input-path>" -o "<output-path>" -s <scale> -n <noise> -m "<model-path>" -f <format> -t <tile-size>
In directory mode, process files sequentially and continue past per-file failures. Emit progress updates during long runs.
Reporting
For a single image:
- report the final output path
- report the output file size
- if the command fails, include the relevant error and likely fixes
For a folder:
- summarize each file as success or failure
- report output file sizes for successful results
- report total succeeded and failed
- include concrete failures and likely fixes
Failure handling
If waifu2x fails, check and mention the most likely cause:
- executable not found
- invalid model path
- unsupported input format
- insufficient VRAM or memory
If VRAM is likely the problem, suggest retrying with a smaller tile size.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
ga4-event-tracking
Add, review, or update GA4 event tracking on HTML websites using data attributes and a reusable JavaScript tracker. Use when wiring gtag or GTM dataLayer events, choosing event names/parameters, or extending a base GA4 tracking snippet for clicks and simple interactions.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
scaffold-exercises
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
Didn't find tool you were looking for?