Generates SNS posts using AI based on YAML files containing person details.
-
Copy the Example Environment File
In the project root directory, there's a file named
.env.example.This file contains all the necessary environment variables that the application needs, but with placeholder or sample values.Create a copy of this file in the same directory and name it
.env. -
Edit the .env File
Replace
SERVER_ENDPOINTandOPENAI_API_KEY.
- Install all required modules and libraries.
- Place YAML files with person details inside the
peopledirectory. - Each person should have a corresponding
.pngimage (their profile picture) in thepeopledirectory. Ensure the image filename matches the YAML filename.
Run the script:
pip install requirements.txt
python main.pyThe generated SNS posts will be saved as .png files in the temp directory.
-
generate_situation(yaml_path)Generates a possible situation for the SNS post based on the YAML file of the person.
-
generate_instagram_post(yaml_path, situation, save_dir=None)Produces an SNS post mockup based on the situation and saves it to a directory.
When you run the main script, it reads every .yaml file in the people directory, generates a situation for the person, and then creates an SNS post mockup.
AI-generated situations may vary in accuracy. It's advisable to verify the outputs.
- Add diverse situations.
- Improve AI prompt for more contextual posts.