4KAgent

A multi-agent framework that upscales any image, whatever its degradation or domain, to 4K resolution.

Stars
★ 833
Last updated
1y ago
License
Apache-2.0
Primary language
Python

At a glance

How it runs
CLI
Works with
Portable with changes
Cost
Free software; you pay for model usage
Setup effort
High · needs real infrastructure
You'll need
Python environment (Conda)CUDA GPUsAPI key for VLM (e.g. llama_vision / depictqa)huggingface_hub CLI (for DIV4K-50)Shell / CLINetwork accessLocal filesystem
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

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.

  1. Researchers reproducing or benchmarking 4K super-resolution on Set5, Urban100, DRealSR and similar datasets
  2. Remote-sensing teams upscaling and scoring satellite imagery such as AID, DIOR, DOTA or WorldStrat
  3. Medical and biological imaging groups enhancing microscopy, pathology, X-ray or ultrasound images
  4. Old-photo restoration work using the OldP4K_P profile on degraded historical photographs
  5. AI-art creators pushing generated images to 4K while repairing faces through the face pipeline
  6. 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 depictqa

To 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.zip

How 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 2

With 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 2

Other 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?

Pros
  • 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
Limitations
  • 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?

FollowAgents source review · FARS-2.1
Major gaps
40/ 100 5-point scale 2.0 / 5
Trust 10/29
Reliability 3/14
Adaptability 8/18
Convention 8/18
Effectiveness 7/13
Verifiability 4/8
Why each dimension lost points
Trust10 / 29 · 1.7/5

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.

Reliability3 / 14 · 1.1/5

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.

Adaptability8 / 18 · 2.2/5

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.

Convention8 / 18 · 2.2/5

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.

Effectiveness7 / 13 · 2.7/5

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.

Verifiability4 / 8 · 2.5/5

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.

Risks and how to mitigate them
  • 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.
Evidence confidence: Low Reviewed Oct 20, 2026 Reviewed revision 04179ffed12c
See the full review method →

FAQ

Can it run on a single GPU?
The README says tool_run_gpu_id can be set equal to CUDA_VISIBLE_DEVICES on GPUs with large VRAM, but examples default to separate GPUs, so low-VRAM single-card setups may struggle.
Is DepictQA mandatory?
No. Profiles built on llama_vision run infer_4kagent.py directly, while depictqa-based profiles such as FastGen4K_P, OldP4K_P and GenMIR_P require starting the DepictQA service in a separate terminal first.
Does using it cost money?
The code is Apache-2.0, but inference needs an API key for the VLM in config.yml plus adequate GPU hardware; the real cost depends on the model you choose.
How do I get just the final images?
Run utils/image_export.py to copy each image's output into a new folder using original filenames, then score them with the matching script in eval/.
View on GitHub ↗ Install ↓

Related agents