A Python tool that generates creative coloring book. It uses OpenAI's gpt-image-1 model to create unique, concise prompts for coloring pages, and saves the results in organized folders.
- Generate multiple variations of coloring book prompts for a given theme
- Uses OpenAI GPT models for prompt generation
- Outputs prompts and results in organized folders
- Simple command-line interface
- Python 3.8+
- OpenAI API key
- Clone this repository:
git clone https://github.com/pablo-mano/Coloring_Pages_Gen.git cd Coloring_Pages_Gen
- Install dependencies:
pip install -r requirements.txt
Copy the .env.example
file to .env
and add your OpenAI API key:
cp .env.example .env
# Then edit .env to add your real OpenAI API key
Run the script from the command line. Example:
python generate_coloring_book.py --topic "Dinosaurs" --n 5
--topic
(or-t
): The main theme for the coloring book--n
: Number of pages of colouring book
The generated images and book will be saved in the colourings/
folder, organized by theme and timestamp.
You can see a demo of the Coloring Pages Generator in action below:
Click to expand video embed (may not work on GitHub)
The example_output/
folder contains sample coloring book PDFs generated by this tool. You can view these files to see what the output looks like:
- colouring_Dinosaurs_20250426_003629.pdf
- colouring_Princess_20250426_002923.pdf
- colouring_Unicorns_20250426_001535.pdf
Each PDF contains a set of coloring pages based on the specified theme. These examples demonstrate the format and quality you can expect from the generator.
python generate_coloring_book.py --topic "Underwater Adventure" --n 3
MIT License
Feel free to customize or extend this tool for your own coloring book projects!