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!
- 📖 What is ScaleX?
- ✨ Super Powers!
- 🛠️ Get This Thing Installed!
- 💻 Let's Cook! (Usage)
- 💡 Uh Oh! (Troubleshooting)
- 🤝 Join the Fun! (Contributing)
- 📜 The Fine Print (Acknowledgments & License)
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! 🐞➡️🦋
- 🚀 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! 😌
- 🐍 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 쌩쌩 달려요!
Get ready for an install party! 🥳
- Yoink the Code!
git clone https://github.com/Md-Siam-Mia-Code/ScaleX-CLI.git cd ScaleX-CLI
- 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
- Windows Wizards 🧙♂️:
Open Command Prompt/PowerShell in
Feeling brave? Like to live dangerously? 🤠
-
Clone It (Again, if you skipped above):
git clone https://github.com/Md-Siam-Mia-Code/ScaleX-CLI.git cd ScaleX-CLI
-
Conda Cave:
conda create -n ScaleX-CLI python=3.12 -y conda activate ScaleX-CLI
-
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!) -
Install the Rest of the Goodies:
pip install -r requirements.txt
-
Models? We Got 'Em! 🚀 They'll download themselves with cool progress bars when you first run ScaleX! ✨ (Usually into
models/pretrained/
)
Ready to make some magic? 🪄
- Open your terminal/Anaconda Prompt.
- Warp into the environment:
conda activate ScaleX-CLI
- Zoom to the
ScaleX-CLI
folder. - 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
-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
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 inmodels/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
ModuleNotFoundError
s? 🤷 Are you sure you're in theScaleX-CLI
conda environment? Didpip install -r requirements.txt
finish happily?
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!
- 🍴 Fork it!
- 🌿 New Branch (
git checkout -b feature/SuperCoolThing
) - 💾 Commit (
git commit -m 'Added SuperCoolThing'
) - 🚀 Push (
git push origin feature/SuperCoolThing
) - 📬 Open Pull Request!
ScaleX stands on the shoulders of giants! 🏋️♂️ Big virtual high-fives to:
- GFPGAN: TencentARC/GFPGAN - The OG face wizards!
- Real-ESRGAN: xinntao/Real-ESRGAN - Background beautifiers!
- BasicSR & facexlib: xinntao - The building blocks!