Skip to content

HAKORADev/Klarity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Klarity - AI Image/Video Restoration

Klarity Logo

Latest Release Open In Colab Hugging Face Spaces

Klarity is a local, free, offline AI-powered image and video restoration tool that delivers professional-grade denoising, deblurring, upscaling, and frame generation. Built for creators, editors, and anyone who needs to enhance visual content without subscription fees.

๐Ÿ“ฆ Pre-built binaries available โ€” no Python or setup needed. Grab the latest release with CPU binaries for Windows and Linux, download, extract, and run.

๐Ÿค– For AI agents and automated tools: See Bots.md


Quick Start

Run from Source

# Clone the repository
git clone https://github.com/HAKORADev/Klarity.git
cd Klarity

# Install dependencies
pip install -r requirements.txt

# Launch GUI
python src/klarity.py

# Or use CLI mode
python src/klarity.py cli

Installation Requirements

# Install FFmpeg (required for video processing)
# Windows: winget install FFmpeg
# macOS: brew install ffmpeg
# Linux: sudo apt install ffmpeg

Core Capabilities

๐ŸŽจ 9 Processing Modes

Klarity offers nine distinct processing modes, each designed for specific enhancement needs:

Mode Description Input Output
Denoise Remove noise from images/videos Image/Video Image/Video
Deblur Remove blur from images/videos Image/Video Image/Video
Upscale 2x or 4x upscaling Image/Video Image/Video
Clean Denoise + Deblur pipeline Image/Video Image/Video
Full Denoise + Deblur + Upscale Image/Video Image/Video
Frame-Gen AI frame interpolation Video Video (higher FPS)
Clean-Frame-Gen Clean + Frame generation Video Video
Full-Frame-Gen Full pipeline + Frame generation Video Video

โšก Dual Model Modes

Mode Models Download Quality Speed
Heavy (default) NAFNet-width64, RealESRGAN-x4plus, RIFE v4.25 ~785 MB Best Slower
Lite NAFNet-width32, RealESRGAN-general-x4v3, RIFE v4.17 ~204 MB Good Faster

Performance Comparison

Metric Lite Mode Heavy Mode
Hardware Demand ๐ŸŸข 13x less demanding ๐Ÿ”ด Baseline
Processing Speed ๐ŸŸข 20x faster ๐Ÿ”ด Baseline
Quality Loss ๐ŸŸก ~20-28% quality trade-off ๐ŸŸข Maximum quality
Minimum RAM ๐ŸŸข 4GB RAM ๐Ÿ”ด 8-16GB RAM
Best For Quick previews, low-end systems Final output, maximum fidelity

๐Ÿ’ก Pro Tip: Use Lite mode for rapid iteration and previewing, then switch to Heavy mode for your final export.


๐Ÿ”ง AI Model Integration

Klarity leverages state-of-the-art open-source models for professional-grade restoration:

  • Denoising: NAFNet-SIDD โ€” Neural networks for noise reduction
  • Deblurring: NAFNet-GoPro โ€” Motion blur removal
  • Upscaling: Real-ESRGAN โ€” 4x super-resolution
  • Frame Generation: RIFE โ€” AI frame interpolation

Usage Guide

GUI Mode

  1. Launch: python src/klarity.py
  2. Drag & drop files or click Browse
  3. Select processing mode from dropdown
  4. Choose model mode (Heavy/Lite)
  5. Set upscale factor (2x or 4x) if applicable
  6. Click "Process"
  7. Preview results with comparison slider
  8. Save output

CLI Mode (Interactive)

python src/klarity.py cli

CLI Mode (Direct)

# Image processing
python src/klarity.py deblur input.jpg -o output.jpg
python src/klarity.py denoise image.png
python src/klarity.py upscale photo.jpg --upscale 4
python src/klarity.py clean image.jpg        # denoise + deblur
python src/klarity.py full image.jpg         # full pipeline

# Video processing
python src/klarity.py frame-gen video.mp4 --multi 2
python src/klarity.py clean-frame-gen video.mp4 --multi 4
python src/klarity.py full-frame-gen video.mp4 --multi 2 --upscale 2

# Lite mode (faster)
python src/klarity.py -lite full image.jpg

System Requirements

Component Minimum Recommended
CPU 2 cores 4+ cores
RAM 4GB 16GB+
GPU None (CPU works) NVIDIA GTX 1060+
VRAM N/A 4GB+
Storage 2GB SSD recommended

Note: Klarity works on CPU. GPU with CUDA significantly speeds up processing.


Supported Formats

Images

.jpg, .jpeg, .png, .bmp, .tiff, .tif, .webp

Videos

.mp4, .avi, .mov, .mkv, .webm, .flv, .wmv, .m4v


๐ŸŽฌ Showcase

Graphical User Interface

Klarity GUI - Main Interface Klarity GUI - Processing View


Clean Mode (Denoise + Deblur)

Original Image

Original Zoomed Cleaned (Lite Mode) Zoomed

Left: Original (zoomed) โ€” Right: Cleaned with Lite mode (zoomed)


2x Upscale (Full-Lite Mode)

Original 2x Reference 2x Upscale Lite

Left: Original โ€” Right: 2x Upscale (Full-Lite mode)


4x Upscale: Lite vs Heavy

Original 4x Reference

4x Upscale Lite 4x Upscale Heavy

Left: 4x Upscale (Full-Lite) โ€” Right: 4x Upscale (Full-Heavy)


Frame Generation: 15FPS โ†’ 60FPS

15FPS_x4_clean.mp4.mp4

Left: 15FPS gameplay (NFS Heat) โ€” Right: x4 Clean Frame-Gen Heavy (60FPS) at 480p

๐ŸŽฎ Demo: 15FPS gameplay video transformed to smooth 60FPS using Clean-Frame-Gen Heavy mode

Note: set playback speed to 0.25 to see the difference clearly


Documentation


License

Each component has its own license:

  • NAFNet: Apache 2.0
  • Real-ESRGAN: BSD 3-Clause
  • RIFE: MIT
  • Klarity: MIT

Links

๐Ÿ“ Note: The HuggingFace demo uses Lite models and supports image processing only. For Heavy models and video support, use the desktop version or the Google Colab notebook, which provides the full experience with Heavy models and video processing โ€” just like running it on a real PC except GUI is desktop-only.


About

A comprehensive local AI toolkit for image and video restoration. Includes high-performance denoising, deblurring, upscaling, and frame generation

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages