Skip to content

dmunicio/gpt2insta

Repository files navigation

gpt2insta

gpt2insta is a Python script which ask for a topic and does the following:

  • Get a nice sentence for that topic by invoking ChatGPT (e.g. for topic "Life" the sentence could be "Life is a precious gift").
  • Generate an image with Stable Diffusion by using the previously generated sentence as prompt.
  • Add the text to the generated image by calling an already created apitemplate template.
  • Upload the final image to instagram.

Configuration

Download the code from github repo

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env

Register in apitemplate.io and create a template like this: Image showing a template in https://apitemplate.io/

Edit .env file and fill in the values.

Usage

./gpt2insta.py -topic Happiness

Enter the code sent by instagram to your email or sms.

You will get a nice story in your instagram account, like this: Instagram story with the generated image

Next steps

Some ideas:

  • Translate content by calling google translate API
  • Generate videos instead of images.

Libraries and services

These are the libraries I have used. Thanks to the creators!

And the services used:

Disclaimer

This code is only intended as a PoC of interconnecting several AI services. Instagram discourages bot usage and your account can be suspended if you are trying to do massive operations programmatically. Use it at your own risk. Also ChatGPT have not yet released a public API, so a non-official API library is used.

Contributing

Pull requests are welcome.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published