Follow @ImagicalRealism to see the generated output.
This bot uses the fantastic twitter-api-v2 library to interact with Twitter.
OAuth 1.0a tokens are used for authentication. I followed the library's guide to generate all of the necessary tokens.
The Stability Diffusion API's gRPC service generates an image for a given prompt.
The @grpc/grpc-js library talks to the backend service. You can find details on how the gRPC client definitions were generated in the proto directory.
A GitHub Actions workflow definition executes npm run tweet
on a one-hour schedule. If there is already a generated image for the latest @MagicRealismBot tweet, then npm run tweet
will exit without posting anything.