4KAgent
A multi-agent framework that upscales any image, whatever its degradation or domain, to 4K resolution.
- Source repo
- taco-group/4KAgent
- Stars
- ★ 833
- Last updated
- 1y ago
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 40/100 · Major gaps
At a glance
- How it runs
- Works with
- Portable with changes
- Cost
- Free software; you pay for model usage
- Setup effort
- High · needs real infrastructure
- You'll need
- Typical use
- Researchers reproducing or benchmarking 4K super-resolution on Set5, Urban100, DRealSR and similar datasets
- Not a fit if
- Users without GPUs or with limited VRAM who want CPU inference
- Teams wanting a one-command install without Conda and model wiring
- Simple upscaling needs where a multi-agent pipeline is overkill
- Source review
- 40/100 · Major gaps 1 safety controls not found
What does this agent do, and when should you use it?
4KAgent is a NeurIPS 2025 agentic super-resolution generalist that aims to restore any image to 4K, spanning classical and real-world degradations, extreme low-quality inputs, AI-generated images, and scientific imaging such as remote sensing, microscopy, pathology and medical scans. It pairs a Perception Agent that uses large vision-language models to analyze image content and distortion with a Restoration Agent that runs an execution–reflection–rollback loop over a toolbox of restoration and upscaling methods. A Quality-Driven Mixture-of-Expert (Q-MoE) policy picks the best candidate at each step, and a separate face restoration pipeline handles faces. Tasks are configured through profile files, so the system adapts without additional training, and inference is driven by the infer_4kagent.py CLI, which writes per-image folders of logs and intermediate outputs alongside evaluation scripts in eval/.
4KAgent reads images from an input directory, asks its Perception Agent — backed by a vision-language model such as llama_vision or an externally launched DepictQA service — to diagnose content and distortion, and emits a restoration plan. The Restoration Agent follows a profile (ExpSR_s4_F, ExpSR_s4_P, FastGen4K_P, OldP4K_P, GenMIR_P and others) to invoke deblurring, denoising, brightening, gamma correction and super-resolution tools, iterating through execution–reflection–rollback and selecting the best image via Q-MoE; with FaceRestore enabled it applies codeformer, gfpgan or keeps the original face. Outputs are per-image folders containing logs and stage-wise images; utils/image_export.py extracts final outputs, utils/toolchain_export.py prints the toolchain used per image, and utils/face_restoration_tool_export.py reports face tools. Scripts in eval/ compute PSNR/SSIM/LPIPS plus no-reference metrics such as NIQE, MUSIQ, MANIQA and CLIPIQA.
- Researchers reproducing or benchmarking 4K super-resolution on Set5, Urban100, DRealSR and similar datasets
- Remote-sensing teams upscaling and scoring satellite imagery such as AID, DIOR, DOTA or WorldStrat
- Medical and biological imaging groups enhancing microscopy, pathology, X-ray or ultrasound images
- Old-photo restoration work using the OldP4K_P profile on degraded historical photographs
- AI-art creators pushing generated images to 4K while repairing faces through the face pipeline
- Engineers who want to chain multiple restoration tools and audit which toolchain each image used
How do you install or deploy this agent?
Setup details live in the repository's Installation Guide (installation/Installation.md); the README does not list the full dependency set. An API key must be filled into config.yml before inference. To use DepictQA as the perception VLM, prepare its environment separately:
cd ./DepictQA
conda activate depictqaTo fetch the DIV4K-50 dataset:
python -m pip install "huggingface_hub[cli]"
huggingface-cli download --repo-type dataset YSZuo/DIV4K-50 --local-dir ./dataset/DIV4K-50
cd ./dataset/DIV4K-50
unzip DIV4K-50.zipHow do you use this agent?
Fill the VLM API key into config.yml first. With llama_vision as the perception VLM, run inference directly:
CUDA_VISIBLE_DEVICES=1 python infer_4kagent.py \
--input_dir ./assets/profile_test_example/classicsr \
--output_dir ./outputs/4KAgent_test/classicsr \
--profile_name ExpSR_s4_F \
--tool_run_gpu_id 2With DepictQA, start its service in one terminal and run inference in another (the FastGen4K_P profile is recommended for speed and perceptual quality):
# terminal A
cd ./DepictQA
conda activate depictqa
CUDA_VISIBLE_DEVICES=0 python src/app_eval.py# terminal B
CUDA_VISIBLE_DEVICES=1 python infer_4kagent.py \
--input_dir ./assets/profile_test_example/4ksr \
--output_dir ./outputs/4KAgent_test/4ksr \
--profile_name FastGen4K_P \
--tool_run_gpu_id 2Other profiles include OldP4K_P for old photos and GenMIR_P for multiple-degradation restoration. Custom profiles can be based on examples in pipeline/profiles, documented in pipeline/profiles/profile_setup.md.
What are this agent's strengths and limitations?
- First agent framework targeting universal any-image-to-4K upscaling, covering classical/real degradations, remote sensing, microscopy, medical imaging and AIGC
- Two-agent perception/restoration design lets a VLM diagnose distortion and propose a restoration plan instead of hand-tuned pipelines
- Q-MoE selection with an execution–reflection–rollback loop chooses the best candidate at every restoration step
- Profile files switch between restoration tasks without additional training
- Ships the DIV4K-50 dataset and task-specific evaluation scripts for reproducible measurement
- Installation is delegated to installation/Installation.md; the README gives no complete dependency list
- Multi-GPU setup is assumed (CUDA_VISIBLE_DEVICES plus a separate tool_run_gpu_id in every example)
- Depends on an external VLM: an API key in config.yml or a separately running DepictQA service
- DepictQA and the restoration tools referenced in Toolbox.md must each be set up, lengthening deployment
- Benchmark result artifacts are hosted on Google Drive rather than bundled in the repo
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| 4KAgent This agent | 40 · Major gaps | CLIFree + model costs | ★ 833 | 1y ago | Python | — |
| veRL Agent Training | 32 · Major gaps | CLIFree + model costs | ★ 2.4k | 4mo ago | Python | — |
| AgileRL | 71 · Some gaps | Library / SDKFreemium | ★ 959 | today | Python | — |
| Plexe: Build ML Models from Natural Language | 41 · Major gaps | CLIFree + model costs | ★ 2.6k | 7mo ago | Python | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
README instructs users to fill an API key into config.yml but does not explain how the key is stored, whether it is logged, or whether it is transmitted externally; inference relies on external VLM services (llama_vision/depictqa) with no transparency on image data flow to third parties, so points are deducted. No user-confirmation mechanism is visible, and the restoration agent's rollback refers to algorithmic image rollback rather than a recoverable system operation, so points are deducted. Dependency security shows only scattered third-party tools and test scripts with no lockfile or audit notes, so points are deducted. Source attribution is comparatively good: README credits AgenticIR and the Toolbox open-source tools and provides a citation.
README and example commands are broadly self-consistent, but profile naming is inconsistent (ExpSR_s4_F vs ExpSR-s4-F) and config references are partial, so points are deducted. Dependency availability points only to an Installation.md whose contents are not provided, and requires multiple GPUs, conda environments, and external VLM services with no version pinning, so points are deducted. No error handling or diagnostic messaging is visible in the source, so points are deducted.
README covers classical SR, real-world SR, old photos, multi-degradation, remote sensing, medical, and AIGC scenarios, giving strong audience and scenario coverage. However, capability boundaries are presented only as promotional claims with no failure conditions or unsuitable image types; trigger precision depends on profile names and VLM judgment without explicit rules; environment fit requires specific GPUs and external services with no alternatives, so points are deducted.
README is well structured with an installation link, inference examples, evaluation scripts, and a results table, giving good information architecture and examples. But installation details depend on an unprovided Installation.md, profile naming is inconsistent in case and hyphenation, there is no version number or changelog, and maintenance responsibility is only a personal email with unverified publisher identity, so points are deducted. LICENSE is the full Apache-2.0 text and scores high.
Utility scripts for image export, toolchain export, and face-restoration tool export improve output usability, and the project offers clear marginal value across many SR tasks. However, running requires multiple GPUs, external VLM services, and many model weights, with no resource estimates in the README, so cost-benefit is deducted.
README links to an arXiv paper, project page, dataset, and results, giving reasonable claim traceability. But results are only external Google Drive links with no in-repo logs or reproduction scripts to corroborate them, so cross-source corroboration is deducted; promotional claims ("first", "perfect-4K") are not clearly separated from factual inference, so points are deducted.
- Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- README asks for an API key but does not explain key storage or transmission; using external VLM services may send image data off-site, so assess privacy risk yourself.
- Running requires multiple GPUs, conda environments, and external VLM services; installation details live in an unprovided Installation.md, so verify dependency versions before reproducing.
- Profile naming is inconsistent in case and hyphenation across the README, which may cause command failures.
- Results are provided only as external Google Drive links with no in-repo logs or reproduction scripts; treat promotional claims with caution.
- Publisher identity is unverified and maintenance responsibility is only a personal email, leaving long-term support and update paths unclear.