4KAgent

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

Stars
★ 845
Last updated
1y ago v1.0
FARS reviewed
Nov 08, 2026
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
Website
4kagent.github.io ↗ set on GitHub
Maintenance
No commits for 6+ monthslast commit 2025-09-23latest release v1.0 (2025-09-24)

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

Key setup facts

Pulled from the install and usage notes below. The project README has the current values.

Config files
config.yml

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.

Safety boundaries, hardening & integrations

Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.

Declared capability surface (blast radius)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

FARS trust-control audit

Not found in source — apply before daily use
  • confirmation before acting — Turn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
  • sensitive-data handling — Use dedicated, low-privilege, revocable API keys — never production credentials — and keep secrets out of logs.

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 39 · Major gaps CLIFree + model costs ★ 845 1y ago Python —
Gamma-World: Multi-Agent World Model 38 · Major gaps — ★ 580 5mo ago Python —
veRL Agent Training 47 · Major gaps CLIFree + model costs ★ 2.5k 5mo ago Python —
AgileRL 62 · Some gaps Library / SDKFreemium ★ 973 3d ago Python —

How does FollowAgents rate this agent?

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

The README says an API key must be configured and describes VLMs and multiple image-restoration tools, but the supplied material does not show key protection, permission limits, image transfer paths, or privacy handling, so least privilege, data-flow transparency, and sensitive-data handling score low. No per-action user confirmation is documented. The stated effects are mainly local output images and logs, with limited detail on external effects and rollback. The README names authors, cites a paper, and acknowledges a base project and tools, providing useful but incomplete attribution.

Reliability3 / 14 · 1.1/5

The README gives inference commands for several tasks and points to evaluation scripts, but a supplied configuration uses machine-specific absolute dataset paths. Inference also depends on an API, GPUs, an external VLM service, and multiple model tools, limiting ordinary availability. The material does not describe error handling or user-facing failure messages.

Adaptability9 / 18 · 2.5/5

Documentation covers classical, real-world, mixed-degradation, face, remote-sensing, microscopy, pathology, and medical imaging, and says profiles can be customized. Boundaries are mostly broad claims and examples; unsupported cases, precise triggers, and deployment resource limits are not clearly stated. Commands assume CUDA, multiple GPUs, and a specific service setup.

Convention8 / 18 · 2.2/5

The README organizes installation, inference, profiles, datasets, evaluation, results, and citation, with several command examples. Installation details are delegated to another guide, and sample profile names vary in punctuation, such as ExpSR_s4_F versus ExpSR-s4-F. Limitations are sparse and no change history is supplied; the Apache 2.0 license is explicit. Authors and a contact email are listed, but maintenance responsibility and update path are unclear.

Effectiveness7 / 13 · 2.7/5

The framework aims to select restoration steps based on image content and degradation, and provides output images plus exportable logs and toolchains, which can serve research and batch workflows. The material lists tasks and evaluation scripts, but performance evidence is linked externally rather than reported here, and API, GPU, and tool requirements raise deployment costs. Claims such as “perfect 4K” exceed what the supplied material can verify.

Verifiability4 / 8 · 2.5/5

The README gives traceable descriptions of the architecture, profiles, inference entry point, dataset, and evaluation scripts, and identifies the paper, authors, and base project. The other supplied source files are one test script and two configuration samples, which cannot independently corroborate the overall framework behavior or results. Promotional capability claims are not clearly separated from evidence, so some conclusions remain author-reported.

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.
  • Not found in source: sensitive-data handlingUse dedicated, low-privilege, revocable API keys — never production credentials — and keep secrets out of logs.
  • Running requires an API key and depends on GPUs, a VLM service, and multiple restoration tools; the supplied material does not say whether images are sent to external services or how keys are protected.
  • “Any image” and “perfect 4K” are broad claims; this static packet cannot verify output quality or reproduce the full workflow.
Evidence confidence: Low Reviewed Nov 08, 2026 Reviewed revision 04179ffed12c
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/4kagent.svg)](https://followagents.com/en/agents/4kagent)
<a href="https://followagents.com/en/agents/4kagent"><img src="https://followagents.com/badge/4kagent.svg" alt="FARS review"></a>

Recent releases

Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.

  1. v1.0 4kagent-v1.0
    Release notes excerpt
    Initial software released for 4KAgent.
    View on GitHub ↗

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/.
Was this page helpful?
View on GitHub ↗ Install ↓

Related concepts