Icons is a Python tool that generates app icons using Flux 1.1 Pro on Replicate. It creates icons from text prompts or processes existing images, outputting them as SVG and PNG files.
- Python 3.6+
- libvips (required for image processing) - Installation Guide
Install the required Python packages:
pip install pyvips replicate colorama python-dotenv tqdm
- Get your Replicate API token from replicate.com
- Create a
.env
file in the project root:Alternatively, set it as an environment variable.REPLICATE_API_TOKEN=your_token_here
-
Run the script:
python generate.py
-
Enter your prompt when asked
-
The script will generate:
icons/{timestamp}.svg
- SVG versionicons/{timestamp}.png
- PNG version
Note: Generated images are temporarily stored in
generations/{timestamp}.jpg
To process an existing image:
python generate.py --previous path/to/your/image.jpg
This will convert your image to SVG and PNG formats in the icons
directory.
The script creates two directories:
generations/
- Stores intermediate generated imagesicons/
- Stores the final icons in SVG and PNG formats
Each file is named with a timestamp for unique identification.