Welcome to Prompt Sanctuary, a versatile tool for generating prompts for both text and image inputs. This README provides detailed instructions on how to set up and run the application.
Prompt Sanctuary is a Streamlit-based application that leverages AI-powered generative models to create prompts based on user input. It offers two main functionalities: generating text prompts and generating image prompts. Users can either input their custom text or upload an image to generate prompts tailored to their needs. Additionally, there's an option to generate random prompts for both text and image inputs, adding an element of surprise and creativity.
To set up Prompt Sanctuary on your local machine, follow these steps:
-
Clone the repository:
git clone https://github.com/1999AZZAR/streamlit_promptgen
-
Navigate to the project directory:
cd streamlit_promptgen
-
Create a virtual env (optional)
python -m venv myenv
-
Activate the virtual env (if u use one)
source myenv/bin/activate
-
Navigate to the actual code directory:
cd code
-
Install the required dependencies from the
requirements.txt
file:pip install -r requirements.txt
After completing the installation steps, you can run the application locally. Execute the following command from the project directory:
streamlit run app.py
This command will start a local server, and the application will be accessible through your web browser at http://localhost:8501
.
The codebase for Prompt Sanctuary is organized as follows:
streamlit/
└── code/
├── img/
│ ├── favicon.ico
│ └── logo.png
├── instruction/
│ ├── examples1.txt
│ ├── examples2.txt
│ └── image_styles.txt
├── app.py
└── generator.py
img/
: Directory containing the application's favicon and logo images.instruction/
: Directory containing text files with instructions or examples.app.py
: The main Python script containing the Streamlit application code.generator.py
: Python module implementing the GenerativeModel class for generating prompts.
User -> Web Browser -> Streamlit Server (app.py) -> Generative Model (generator.py)
| | | | |
| Input text/image | | | |
|------------------> Request to Server | | |
| |------------------------>| | |
| | | Process input | |
| | |------------------------------->| |
| | | | Generate prompt |
| | | |<--------------------------------|
| | | Return generated prompt | |
| |<------------------------| | |
| | Display prompt | | |
|<------------------| | | |
Prompt Sanctuary is powered by Streamlit and leverages AI models for prompt generation. Special thanks to the developers of Streamlit and the underlying generative models for enabling this project.