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.
- 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
- Select a folder containing the images you want to replace
- Enter a global prompt that will be used as a base for all images (optional)
- Optionally, provide custom prompts for specific images
- Click "Generate Images" to start the AI generation process
- Find your new AI-generated images in the
generated_imagessubfolder
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.
- Python 3.7 or higher
- Windows operating system
-
Clone or download this repository:
git clone https://github.com/techcow2/dir-pixel.git
-
Navigate to the project directory:
cd dir-pixel -
Install the required dependencies:
pip install -r requirements.txt
Or install them manually:
pip install PyQt6 requests Pillow
-
Run the application:
python main.py
- Launch the application by running
main.py - Click "Select Folder" and choose the directory containing the images you want to replace (supports PNG, JPG, JPEG)
- (Optional) Enter a global prompt in the "Global Prompt" field that will be applied to all images
- (Optional) For specific images, double-click in the "Custom Prompt" column to enter unique prompts
- Click "Generate Images" to start the process
- View progress in the progress bar and status messages
- Once complete, find your generated images in the
generated_imagessubfolder within your selected directory (in matching format: PNG or JPG)
- 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
- PNG (native format from Pollinations.ai)
- JPG/JPEG (with automatic conversion from generated PNG)
- PyQt6 - For the graphical user interface
- Requests - For making HTTP requests to the AI service
- Pillow - For image format conversion
- Fork the repository
- Create a new branch for your feature or bug fix
- Make your changes
- Submit a pull request with a clear description of your changes
This project is licensed under the MIT License - see the LICENSE file for details.
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.
If you encounter issues:
- Ensure you have a stable internet connection
- Check that your prompts are in English for best results
- Verify that your firewall or antivirus software is not blocking the application
- 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.