Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeffposnick/magic-realism-dream-bot
A Twitter bot that feeds magical realism prompts into the Stable Diffusion AI image generator.
https://github.com/jeffposnick/magic-realism-dream-bot
ai twitter twitter-api twitter-bot
Last synced: 10 days ago
JSON representation
A Twitter bot that feeds magical realism prompts into the Stable Diffusion AI image generator.
- Host: GitHub
- URL: https://github.com/jeffposnick/magic-realism-dream-bot
- Owner: jeffposnick
- License: mit
- Created: 2022-09-01T13:41:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-16T13:56:24.000Z (about 2 years ago)
- Last Synced: 2024-10-11T01:49:24.483Z (27 days ago)
- Topics: ai, twitter, twitter-api, twitter-bot
- Language: TypeScript
- Homepage:
- Size: 79.1 KB
- Stars: 8
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Illustrated Magical Realism Bot
## Follow the bot on Twitter
Follow [@ImagicalRealism](https://twitter.com/ImagicalRealism) to see the generated output.
## Technical details
### The Twitter API
This bot uses the fantastic [twitter-api-v2](https://github.com/PLhery/node-twitter-api-v2) library to interact with Twitter.
OAuth 1.0a tokens are used for authentication. I followed the library's [guide](https://github.com/PLhery/node-twitter-api-v2/blob/master/doc/auth.md#user-wide-authentication-flow) to generate all of the necessary tokens.
### Generating images
The [Stability Diffusion API](https://github.com/Stability-AI/stability-sdk)'s gRPC service generates an image for a given prompt.
The [@grpc/grpc-js](https://www.npmjs.com/package/@grpc/grpc-js) library talks to the backend service. You can find details on how the gRPC client definitions were generated in the [proto](proto/) directory.
### Running the bot
A [GitHub Actions workflow definition](.github/workflows/tweet.yaml) executes [`npm run tweet`](package.json) on a one-hour schedule. If there is already a generated image for the latest [@MagicRealismBot](https://twitter.com/MagicRealismBot/) tweet, then `npm run tweet` will exit without posting anything.