Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dan1229/tutorial-ai-photo-editing-tools
Example of how to use open source AI models to edit photos in mass.
https://github.com/dan1229/tutorial-ai-photo-editing-tools
Last synced: about 1 month ago
JSON representation
Example of how to use open source AI models to edit photos in mass.
- Host: GitHub
- URL: https://github.com/dan1229/tutorial-ai-photo-editing-tools
- Owner: dan1229
- Created: 2024-12-08T20:23:36.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-08T20:37:49.000Z (about 1 month ago)
- Last Synced: 2024-12-08T21:32:11.735Z (about 1 month ago)
- Language: Python
- Homepage: https://TODO-blog-post
- Size: 68.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tutorial - AI Photo Editing Tools
[![Python Checks](https://github.com/dan1229/tutorial-ai-photo-editing-tools/actions/workflows/python-checks.yml/badge.svg?branch=main&event=push&job=black)](https://github.com/dan1229/tutorial-ai-photo-editing-tools/actions/workflows/python-checks.yml)
#### By [Daniel Nazarian](https://danielnazarian.com)
## Description
Learn how to use open source AI models to enhance photos in bulk using Python and Stable Diffusion. This tutorial demonstrates how to build a practical tool for automatically improving image quality, lighting, and details across entire directories of photos.
### What You'll Learn
- Using Stable Diffusion for photo enhancement
- Processing multiple images efficiently
- Working with enhancement presets
- Handling GPU acceleration
- Managing batch operations## Getting Started
### Requirements
- Python 3.12 or higher
- CUDA-compatible GPU (recommended)
- 8GB RAM minimum
- Python packages listed in `Pipfile`### Installation
1. Clone the repository:
```bash
git clone https://github.com/dan1229/tutorial-ai-photo-editing-tools.git
cd tutorial-ai-photo-editing-tools
```2. Set up your environment:
```bash
pipenv install
```## How It Works
This tool leverages Stable Diffusion to enhance photos using various presets. Here's what happens under the hood:
1. Images are loaded and preprocessed
2. The AI model applies enhancement based on selected preset
3. Enhanced images are saved with metadata## Usage
### 1. Basic Enhancement
Enhance all images in a directory:
```bash
python main.py ./my_images
```### 2. Preset Options
Available enhancement presets:
- **Default**: Balanced, all-purpose enhancement
- **Subtle**: Light touch-ups
- **Natural**: Realistic improvements
- **Maximum**: Professional-grade enhancementTry all presets:
```bash
python main.py ./my_images --sample
```### 3. Custom Enhancement
Specify a preset and size:
```bash
python main.py ./my_images --preset natural --size large
```### Output Structure
Enhanced images are organized as follows:
```
out/enhanced__/
_/
enhancement_info.txt
[enhanced images]
```When using --sample:
```
out/enhanced__/
default_medium/
subtle_medium/
natural_medium/
maximum_medium/
```---
Copyright © 2024 [Daniel Nazarian](https://danielnazarian.com)