/media-os:media-upscale [model] [input] [output]from media-os
Upscales images and video with AI super-resolution models (Real-ESRGAN, Real-CUGAN, SwinIR, HAT, GFPGAN). Supports 2x/4x/8x for photos, anime, film scans, and face restoration.
Ships in media-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Context: $ARGUMENTS
scripts/upscale.py batch → Step 4.dnn_processing (SRCNN/ESPCN/EDSR) or a plain scale=...:flags=lanczos looks soft / blurry on real content.ffmpeg-video-filter (scale) instead.media-interpolate.| Model | License | Best for | GPU needed? | Notes |
|---|---|---|---|---|
| Real-ESRGAN | BSD-3-Clause | Photos, video frames, real-world | Optional | realesrgan-ncnn-vulkan — default. 2x/4x. |
| Real-CUGAN | MIT | Anime, illustration, cel-art | Optional | realcugan-ncnn-vulkan — 2x/3x/4x, denoise |
| SwinIR | Apache 2.0 | Fine-texture photo SR | Yes (CUDA) | Transformer, Python inference, slower |
| HAT | Apache 2.0 | SOTA photo SR (2023) | Yes (CUDA) | Hybrid Attention Transformer, Python |
| GFPGAN | Apache 2.0 | Face restoration in photos | Yes (CUDA) | Face-only; combines with Real-ESRGAN bg |
| waifu2x-ncnn-vulkan | MIT | Classic anime, small images | Optional | Original 2015-era anime upscaler |
| Upscayl | AGPL-3.0 | GUI for Real-ESRGAN | Optional | Desktop app; script skill stays CLI |
| chaiNNer | GPL-3.0 | Node-graph pipeline, ANY SR model | Optional | Run arbitrary PyTorch/ONNX/NCNN SR models |
Decision rules:
realesr-animevideov3 for cartoons, realesrgan-x4plus for photos, realesrgan-x4plus-anime for anime stills).Do NOT use: CodeFormer (S-Lab License, research-only — not commercial-safe), Topaz Video AI (commercial, paid). This skill covers open-source + commercial-safe only.
scripts/upscale.py install <model> prints the exact package-manager command for your platform. It does not auto-install. Examples:
# Real-ESRGAN (ncnn-vulkan prebuilt — fastest install, zero Python)
# macOS:
brew install realesrgan-ncnn-vulkan # if tap available, else download release
# or grab a release zip from: https://github.com/xinntao/Real-ESRGAN/releases
# Real-CUGAN (ncnn-vulkan)
# Download: https://github.com/nihui/realcugan-ncnn-vulkan/releases
# waifu2x-ncnn-vulkan
brew install waifu2x # macOS; tap: nihui/waifu2x-ncnn-vulkan
# GFPGAN (Python)
uv pip install gfpgan basicsr realesrgan facexlib
# SwinIR / HAT (Python + CUDA)
uv pip install torch opencv-python numpy basicsr
git clone https://github.com/JingyunLiang/SwinIR # weights via model zoo
git clone https://github.com/XPixelGroup/HAT # weights via releases page
# chaiNNer
# Download from: https://chainner.app/
realesrgan-ncnn-vulkan \
-i photo.jpg -o photo_4x.png \
-n realesrgan-x4plus -s 4 -f png
# Available -n models: realesrgan-x4plus, realesrnet-x4plus, realesr-animevideov3,
# realesrgan-x4plus-anime
# -s scale: 2, 3, 4
# -t tile: 0 auto, or e.g. 256 to limit VRAM. Set -g <GPU_ID> for multi-GPU.
# -f format: png | jpg | webp
Through the driver script:
uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py image \
--model realesr --scale 4 --in photo.jpg --out photo_4x.png
realcugan-ncnn-vulkan \
-i anime.png -o anime_4x.png \
-n 0 -s 4 -f png
# -n 0 default, -n 3 for heavy denoise, -n -1 conservative; -s 2|3|4.
uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py image \
--model realcugan --scale 4 --in anime.png --out anime_4x.png
python SwinIR/main_test_swinir.py \
--task real_sr --scale 4 --large_model \
--model_path SwinIR/model_zoo/swinir/003_realSR_BSRGAN_DFO_s64w8_SwinIR-L_x4_GAN.pth \
--folder_lq /path/to/input_dir --tile 400
python HAT/hat/test.py -opt HAT/options/test/HAT_SRx4.yml
python GFPGAN/inference_gfpgan.py \
-i inputs/ -o results/ \
-v 1.4 -s 2 --bg_upsampler realesrgan
# -v model version: 1.2, 1.3, 1.4; -s output scale factor.
# --bg_upsampler realesrgan re-uses Real-ESRGAN for non-face pixels.
Driver:
uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py face-restore \
--model gfpgan --in portrait.jpg --out portrait_restored.png --scale 2
AI SR models are frame-based. Video workflow:
uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py video \
--model realesr --scale 4 --in clip.mp4 --out clip_4x.mp4 \
--model-name realesr-animevideov3
What the script does:
# (1) frames out
ffmpeg -i clip.mp4 -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 frames/%08d.png
# (2) upscale frames
realesrgan-ncnn-vulkan -i frames -o frames_4x -n realesr-animevideov3 -s 4 -f png
# (3) remux with original audio, pick an FPS matching the source
ffmpeg -framerate <src_fps> -i frames_4x/%08d.png -i clip.mp4 \
-map 0:v -map 1:a? -c:v libx264 -preset slow -crf 17 -pix_fmt yuv420p \
-c:a copy -movflags +faststart clip_4x.mp4
VRAM control: add -t 256 (tile size) to the Real-ESRGAN step if GPU VRAM is tight; 0 = auto.
Native video model choice: realesr-animevideov3 is tuned for video and runs faster than the still-image models on frame sequences.
uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py batch \
--model realesr --scale 4 --in-dir photos/ --out-dir photos_4x/
Real-ESRGAN ncnn-vulkan natively accepts -i <dir> -o <dir> and processes every file in parallel. The wrapper adds logging, dry-run, and skips already-processed outputs.
dnn_processing=model=espcn.pb / EDSR / SRCNN are 2014–2017 research models. On real content they are not competitive with Real-ESRGAN (2021+). Recommend ffmpeg built-ins only as a tiny fallback.-n model name, not path. realesrgan-ncnn-vulkan -n realesrgan-x4plus expects the model file to live under the binary's models/ directory (shipped in the release zip). If you get failed to load model, pass -m <dir> to point at your models.realesrgan-x4plus is 4x-only. Don't pass -s 2 to a 4x model and expect 2x output — you'll get a downsample of 4x output.-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" on the remux.-t 256 (tile size) to process 256×256 tiles and stitch — slower but fits in 2GB.media-matte. Also: v1.4 was NC; only v2.0 (Apache 2.0) is commercial-safe.ffprobe first — don't assume 23.976 / 25 / 29.97.uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py image \
--model realesr --scale 4 --in grandma_1970.jpg --out grandma_4x.png
# 480 * 2.25 ≈ 1080 → use Real-CUGAN 2x, then pad to 1080p if needed.
uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py video \
--model realcugan --scale 2 --in ep01_480p.mp4 --out ep01_960p.mp4
ffmpeg -i ep01_960p.mp4 -vf "scale=-2:1080:flags=lanczos" -c:v libx264 -crf 18 ep01_1080p.mp4
uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py face-restore \
--model gfpgan --in scan.jpg --out scan_restored.png --scale 2
uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py batch \
--model realesr --scale 4 --in-dir thumbs/ --out-dir thumbs_4x/
uv run ${CLAUDE_SKILL_DIR}/scripts/upscale.py check
realesrgan-ncnn-vulkan: command not foundCause: binary not installed.
Solution: Download from https://github.com/xinntao/Real-ESRGAN/releases and unzip. Or brew install realesrgan-ncnn-vulkan. Or run uv run .../upscale.py install realesr.
failed to load model: realesrgan-x4plusCause: model .param / .bin files not next to the binary (expected at <binary>/models/).
Solution: The release zip bundles them — always use the full zip. Or pass -m /path/to/models.
Cause: -t tile size too small relative to content.
Solution: Increase tile (-t 512 or -t 0 for auto). Or run without tiling on a GPU with more VRAM.
CUDA out of memoryCause: tile size too large.
Solution: Reduce --tile 400 → --tile 200. HAT's test.py reads tile from the YML.
Cause: reassembled at wrong FPS, or VFR source.
Solution: ffprobe -select_streams v -show_entries stream=r_frame_rate,avg_frame_rate clip.mp4 — pass that exact rational to -framerate. For VFR sources, first normalize with ffmpeg -vsync cfr.
Cause: GFPGAN needs a GPU by default.
Solution: python inference_gfpgan.py --device cpu ... (slow but works).
references/models.md.references/LICENSES.md.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub damionrashford/media-os --plugin media-os110 skills in this plugin
/audio-coreaudioManipulate macOS audio at the Core Audio HAL layer: afinfo (audio file metadata), afplay (play), afconvert (convert format/rate/bit-depth/channel layout), say (TTS), SwitchAudioSource (change default input/output/system device — brew install switchaudio-osx), audiodevice CLIs (npm/Go variants), AppleScript via osascript to drive System Preferences Sound. HAL plugins at /Library/Audio/Plug-Ins/HAL/ load virtual drivers (BlackHole 2ch/16ch/64ch, Loopback, Background Music). Aggregate Device (drift-corrected multi-in) and Multi-Output Device via Audio MIDI Setup.app or AudioHardwareCreateAggregateDevice. Use when the user asks to change default macOS audio device, route audio between apps on Mac, install BlackHole, build an Aggregate Device, convert audio files with afconvert, or script Mac audio from the terminal.
/audio-jackRoute professional low-latency audio with JACK Audio Connection Kit (jackaudio.org): jackd server (ALSA/CoreAudio/PortAudio/ASIO backends), jack_control (D-Bus JACK2 config), jack_lsp (list ports/connections), jack_connect/jack_disconnect (manage links), jack_cpu_load, jack_samplerate, jack_bufsize (runtime period size), jack_transport, jack_rec (multi-channel WAV recording), jack_iodelay (round-trip latency), jack_wait, jack_midi_dump. JACK1 C maintenance vs JACK2 C++ multicore. Modern Linux swaps jackd for PipeWire's libjack shim — same client API. JackTrip for uncompressed multichannel UDP over the Internet. Use when the user asks to run a JACK server, connect audio clients, measure roundtrip latency, record from JACK ports, set JACK period size, or bridge JACK over the network with JackTrip.
Other plugins' skills for the same job