Skip to content

mattfreed/Image-Prompt-Tree-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Prompt Tree Generator

This repository contains Python code to generate a tree of image prompts and the corresponding images. The program takes an initial prompt (or multiple prompts from a text file) and generates an image from each prompt. These images are then used to create new prompts, which are again used to generate new images, forming a tree structure.

Table of Contents

  1. Installation
  2. How to Run
  3. File Descriptions
  4. Contributing
  5. License

Installation

To install the necessary packages, run the following command:

pip install -r requirements.txt

How to Run

Run the main.py script to start the program.

python main.py [levels] [prompt_expansion] [input_file] [output_dir]
  • levels: How many levels of hierarchical prompts to generate
  • prompt_expansion: How many new prompts to be generated per node
  • input_file: Path to the text file containing prompts, one per line
  • output_dir: Path to the directory where the generated images will be saved

File Descriptions

  • main.py: The entry point of the application. Handles argument parsing and initiates the prompt tree generation.
  • src/
    • img2prompt.py: Contains code for generating a textual prompt from an image using Salesforce's BLIP model.
    • prompt2img.py: Contains code to generate an image from a textual prompt.
    • promptmixerOpenAI.py: Utilizes OpenAI's GPT-3 model to generate new prompts based on existing ones.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


License

This project is licensed under the MIT License.


About

Generate a tree of image prompts and the corresponding images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages