Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DirPixel: A Python desktop application that replaces images in a folder with AI-generated ones based on customizable prompts using Pollinations.ai

License

techcow2/dir-pixel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DirPixel

DirPixel is a desktop application that allows you to replace existing images with AI-generated ones based on customizable prompts. Using the power of Pollinations.ai, this tool can generate new images based on text descriptions and save them with the same filenames as your original images.

Generating AI images with Pollinations.ai is completely free and does not require an API key.

Features

  • Select a folder containing images to be replaced
  • Provide global prompts that apply to all images
  • Customize individual prompts for specific images
  • Maintain original filenames for seamless replacement
  • Support for PNG and JPG/JPEG images (automatically converts generated PNGs to JPG if original is JPG)
  • Real-time progress tracking and status updates
  • User-friendly graphical interface built with PyQt6

How It Works

  1. Select a folder containing the images you want to replace
  2. Enter a global prompt that will be used as a base for all images (optional)
  3. Optionally, provide custom prompts for specific images
  4. Click "Generate Images" to start the AI generation process
  5. Find your new AI-generated images in the generated_images subfolder

The application uses Pollinations.ai to generate images based on your text prompts. Pollinations.ai generates PNG images, but if your source images are JPG/JPEG, the app will automatically convert them to JPG format to match.

Installation

Prerequisites

  • Python 3.7 or higher
  • Windows operating system

Steps

  1. Clone or download this repository:

    git clone https://github.com/techcow2/dir-pixel.git
  2. Navigate to the project directory:

    cd dir-pixel
  3. Install the required dependencies:

    pip install -r requirements.txt

    Or install them manually:

    pip install PyQt6 requests Pillow
  4. Run the application:

    python main.py

Usage

  1. Launch the application by running main.py
  2. Click "Select Folder" and choose the directory containing the images you want to replace (supports PNG, JPG, JPEG)
  3. (Optional) Enter a global prompt in the "Global Prompt" field that will be applied to all images
  4. (Optional) For specific images, double-click in the "Custom Prompt" column to enter unique prompts
  5. Click "Generate Images" to start the process
  6. View progress in the progress bar and status messages
  7. Once complete, find your generated images in the generated_images subfolder within your selected directory (in matching format: PNG or JPG)

Tips for Better Prompts

  • Be descriptive about the style, mood, and content you want
  • Include terms like "high quality", "professional", "photorealistic" for better results
  • For consistency across images, use similar descriptive terms in your prompts
  • Custom prompts for individual images will override the global prompt

Supported Image Formats

  • PNG (native format from Pollinations.ai)
  • JPG/JPEG (with automatic conversion from generated PNG)

Dependencies

  • PyQt6 - For the graphical user interface
  • Requests - For making HTTP requests to the AI service
  • Pillow - For image format conversion

How to Contribute

  1. Fork the repository
  2. Create a new branch for your feature or bug fix
  3. Make your changes
  4. Submit a pull request with a clear description of your changes

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This application uses the Pollinations.ai service for image generation. Please ensure you comply with their terms of service and usage guidelines. The developer of this application is not responsible for the content generated by third-party AI services.

Troubleshooting

If you encounter issues:

  1. Ensure you have a stable internet connection
  2. Check that your prompts are in English for best results
  3. Verify that your firewall or antivirus software is not blocking the application
  4. Make sure you have sufficient disk space for the generated images

If the application reports HTTP errors, it might be due to temporary issues with the image generation service. Try again later or modify your prompts slightly.

About

DirPixel: A Python desktop application that replaces images in a folder with AI-generated ones based on customizable prompts using Pollinations.ai

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages