new file: README.rst
This commit is contained in:
parent
390eb96e4f
commit
de7af8eeaa
1 changed files with 86 additions and 0 deletions
86
README.rst
Normal file
86
README.rst
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
Black Forest Labs Image Generation
|
||||
==================================
|
||||
|
||||
This project allows you to generate images based on prompts using the Black Forest Labs API. The generated images are saved to a local directory, and their metadata, including base64 representations, are stored in a SQLite database.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- Python 3.x
|
||||
- Required Python packages:
|
||||
- ``http.client``
|
||||
- ``json``
|
||||
- ``base64``
|
||||
- ``os``
|
||||
- ``time``
|
||||
- ``requests``
|
||||
- ``argparse``
|
||||
- ``re``
|
||||
- ``sqlite3``
|
||||
- ``datetime``
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Install required packages::
|
||||
|
||||
pip install requests
|
||||
|
||||
Setup
|
||||
-----
|
||||
|
||||
1. Clone the Repository
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Clone this repository to your local machine::
|
||||
|
||||
git clone black_forest_test
|
||||
cd black_forest_test
|
||||
|
||||
2. Set Up Environment Variables
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Set your API key as an environment variable::
|
||||
|
||||
export BLACK_FOREST_LABS_API_KEY="your_api_key_here"
|
||||
|
||||
Replace ``"your_api_key_here"`` with your actual Black Forest Labs API key.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Run the script with a prompt::
|
||||
|
||||
python black_forest_test.py "A beautiful sunset over the mountains"
|
||||
|
||||
The script will automatically create an ``images`` directory for storing generated images.
|
||||
|
||||
Output
|
||||
------
|
||||
|
||||
- Generated images are saved in the ``images`` directory
|
||||
- Image metadata stored in ``image_metadata.db`` SQLite database
|
||||
|
||||
Database Structure
|
||||
-----------------
|
||||
|
||||
The ``images`` table contains:
|
||||
|
||||
- **id**: Unique identifier (INTEGER PRIMARY KEY)
|
||||
- **slug**: Prompt-based slug (TEXT)
|
||||
- **prompt**: Original generation prompt (TEXT)
|
||||
- **filename**: Saved image filename (TEXT)
|
||||
- **base64_image**: Base64 encoded image (TEXT)
|
||||
- **timestamp**: Creation timestamp (DATETIME)
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
||||
- Requires active internet connection
|
||||
- Keep API key confidential
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
This work is dedicated to the public domain.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue