Skip to content

rootLocalGhost/ScaleX-CLI

Repository files navigation

ScaleX-CLI Banner

🌟 ScaleX: ✨ AI Face Magic Wand ✨ (CLI Edition!)

Zap those pixels! ScaleX is your command-line buddy for making faces look ✨ FABULOUS ✨ using AI smarts. Built on cool tech like GFPGAN & Real-ESRGAN, but now with Python 3.12 super-speed, a slick CLI, and zero setup headaches!

πŸ—‚ Quick Guide Menu


πŸ“– What is ScaleX?

ScaleX turbocharges your old, blurry, or just plain sad-looking photos right from your terminal! ε‘½δ»€θ‘Œι‡Œηš„ι­”ζ³•ζ£’! πŸͺ„ It uses AI brains (🧠 GFPGAN & Real-ESRGAN) to make faces pop and backgrounds beautiful. This ain't your grandma's photo editor (unless she's a Python 3.12 coding wizard with a slick CLI πŸ˜‰). We've made it easy, fast, and fixed those annoying bugs for ya! πŸžβž‘οΈπŸ¦‹


✨ Super Powers!

  • πŸš€ Face Makeover 9000: GFPGAN v1.3 & v1.4 for A+ faces!
  • πŸ–ΌοΈ Background Bling: Real-ESRGAN x2/x4 for spiffy backdrops! ✨
  • πŸ“ˆ Go BIG! You control the final image size. ΰΉƒΰΈ«ΰΈΰΉˆΰΈ‚ΰΈΆΰΉ‰ΰΈ™!
  • πŸ’» Friendly CLI: So easy, your cat could probably use it. 😼
  • πŸ—‚ One or Many: Single pics or whole albums - BAM! πŸ’₯
  • 🎨 Get ALL The Pixels: Restored images, cropped faces, comparisons - you name it!
  • 🎯 Already Aligned? Got 512x512 faces? We gotchu. πŸ‘
  • βš™οΈ Device Freedom! CPU 🐒, CUDA πŸš€, MPS 🍎 - your choice!
  • πŸ“ Your Style: Custom file names & types.
  • πŸ“Š Cool Progress Bars: Watch the magic happen!
  • πŸ”§ Auto-Fixer-Upper: No more weird torchvision drama! 😌

πŸ› οΈ Get This Thing Installed!

πŸ“‹ Stuff You Need First

  • 🐍 Python 3.12 (The slithery kind!)
  • πŸ‰ Anaconda/Miniconda (The big snake's cousin, for easy setup!)
  • βž• Git (To grab the code!)
  • ❗ Want SPEED? (Optional GPU Fun):
    • NVIDIA GPU + Fresh CUDA Drivers 쌩쌩 λ‹¬λ €μš”!

πŸš€ Easy Peasy Auto-Install (Recommended!)

Get ready for an install party! πŸ₯³

  1. Yoink the Code!
    git clone https://github.com/rootLocalGhost/ScaleX-CLI.git
    cd ScaleX-CLI
  2. Run the Magic Script! ✨ (It does almost everything for you!)
    • Windows Wizards πŸ§™β€β™‚οΈ: Open Command Prompt/PowerShell in ScaleX-CLI folder, then:
      install_scalex_windows.bat
    • Linux/macOS Ninjas πŸ₯·: Open Terminal in ScaleX-CLI folder, then:
      chmod +x install_scalex.sh
      ./install_scalex_linux.sh
    Follow the script's groovy instructions! πŸ•ΊπŸ’ƒ

πŸ”© DIY Manual Setup

Feeling brave? Like to live dangerously? 🀠

  1. Clone It (Again, if you skipped above):

    git clone https://github.com/rootLocalGhost/ScaleX-CLI.git
    cd ScaleX-CLI
  2. Conda Cave:

    conda create -n ScaleX-CLI python=3.12 -y
    conda activate ScaleX-CLI
  3. Get PyTorch (The Brains!): Go to PyTorch website. Pick your poison (OS, Conda, Python, CUDA/CPU).

    CPU Crew (conda):

    conda install pytorch torchvision torchaudio cpuonly -c pytorch -y

    CUDA Crew (conda, e.g.):

    conda install pytorch torchvision torchaudio pytorch-cuda=<your-cuda-version> -c pytorch -c nvidia -y

    (Change <your-cuda-version> with your actual CUDA version!)

  4. Install the Rest of the Goodies:

    pip install -r requirements.txt
  5. Models? We Got 'Em! πŸš€ They'll download themselves with cool progress bars when you first run ScaleX! ✨ (Usually into models/pretrained/)


πŸ’» Let's Cook! (Usage)

▢️ Fire It Up!

Ready to make some magic? πŸͺ„

  1. Open your terminal/Anaconda Prompt.
  2. Warp into the environment: conda activate ScaleX-CLI
  3. Zoom to the ScaleX-CLI folder.
  4. Let 'er rip: python inference_scalex.py ...

The Secret Incantation:

python inference_scalex.py --input <your_pics_here> --output <where_the_magic_goes> [MORE_SPELLS]

Example - Full Power! Make MyPhotos/ awesome, save to EnhancedPhotos/, use GFPGAN v1.4, RealESRGAN x4 for BG, and 4x bigger!

python inference_scalex.py -i MyPhotos/ -o EnhancedPhotos/ -f v1.4 -b x4 -s 4

βš™οΈ Magic Spells (Options)

  • -i, --input PATH: REQUIRED! Your pics (one or a folder). πŸ–ΌοΈ
  • -o, --output PATH: Where the awesomeness lands. (Default: Output)
  • -f, --face-enhance [v1.3|v1.4]: Face fixer model. (Default: v1.4) ✨
  • -b, --bg-enhance [none|x2|x4]: Background booster. none for no boost. (Default: x2) 🌳
  • -s, --upscale INTEGER: Make the whole pic BIGGER! (Default: 2) 🐘
  • --bg-tile INTEGER: Memory saver for BG. 0 = YOLO mode (faster if you got RAM). (Default: 400)
  • --device [auto|cpu|cuda|mps]: Your computer's muscle. auto is smart. (Default: auto) πŸ’ͺ
  • --aligned: Got pre-aligned 512x512 faces? This is for you! βœ”οΈ
  • --ext [auto|png|jpg]: How to save 'em. (Default: auto)
  • --no-save-cropped / --no-save-restored / --no-save-comparison: Less files, if you want. πŸš«πŸ’Ύ

What Else Can It Do? Ask It!

python inference_scalex.py --help

πŸ’‘ Uh Oh! (Troubleshooting)

  • Module... functional_tensor Error?! 😡 Relax! patches.py is our superhero for this. Should be automatic. If not, check it's there!
  • Downloads Stuck? 🐌 Internet playing tricks? Delete the half-baked .pth file in models/pretrained/ & try again.
  • GPU Says "Nope!"? πŸ™…β€β™€οΈ
    • NVIDIA: Drivers up-to-date? PyTorch match your CUDA?
    • Apple: Right macOS & PyTorch?
    • Try --device cpu. If that works, it's a GPU thing.
  • Install Script Blues? 🎢 Conda acting shy? Make sure it's in your PATH or conda init your_shell_name was run.
  • Other ModuleNotFoundErrors? 🀷 Are you sure you're in the ScaleX-CLI conda environment? Did pip install -r requirements.txt finish happily?

🀝 Join the Fun! (Contributing)

Got ideas? Found a πŸ›? Want to add your own sparkle? ✨ Contributions are super welcome! Check the issues page. Or just fork & send a Pull Request!

  1. 🍴 Fork it!
  2. 🌿 New Branch (git checkout -b feature/SuperCoolThing)
  3. πŸ’Ύ Commit (git commit -m 'Added SuperCoolThing')
  4. πŸš€ Push (git push origin feature/SuperCoolThing)
  5. πŸ“¬ Open Pull Request!

πŸ“œ The Fine Print (Acknowledgments & License)

ScaleX stands on the shoulders of giants! πŸ‹οΈβ€β™‚οΈ Big virtual high-fives to:


❀️ Go Make Some Pixels Happy! pixels πŸ˜„

About

ScaleX is a powerful command-line tool for enhancing and restoring faces in images using advanced AI. Built on the robust foundations of GFPGAN and Real-ESRGAN, ScaleX has been modernized for Python 3.12, features a user-friendly interactive CLI, and includes smarts for easier setup and smoother operation.

Topics

Resources

Stars

Watchers

Forks

Contributors