PhotoBolt converts a Product Image into a Poster.
It uses
- Generative AI (Stable Diffusion) for
image processing
, - Decentralized Communication Protocol (nostr) for
task planning & outsourcing
, - Bitcoin Technology (Lightning Network) for
payment processing
This repo contains both the client
(vue) and service provider
(go). Client breaks down the poster generation task into 5 smaller tasks, chain them together via NIP90(Data Vending Machine) and broadcast them to the nostr network. Service provider accepts each job requests by prompting for a payment, then process and return the job result back to the client.
Although each job request may depend on another job request as an input, they could still be processed independently by different service providers. You could test it out by running two PhotoBolt service provider instances when generating a poster. You should be able to tell which service provider took a task based on the avatar rendered under the Tasks Pending
UI section.
Video Demo here
- automatic1111 Stable Diffusion server
- rembg Background removal tool
- ffmpeg Media processing tool
- polar Simulated Lightning Network
- alby webLN browser wallet integration
- relayer nostr relay
- NIP90 nostr Data Vending Machine Proposal
- aperture L402 gateway server
- Install
automatic1111
- Install
rembg
CLI tool - Install
ffmpeg
CLI tool - Install
polar
or a LND mainnet node. Both client and server require the use of Lightning - Install
alby
to be used with the web client (you will need a mainnet node for the server) - Connect to a public nostr relay or Install
relayer
and point both client & service provider to the relayer instance - You'll also need an ImgBB api secret key
cp .env-example .env
in the/env
folder. Populate it. NOTE: automatic1111 url should be pointing to the api server (7681 by default)go run .
to start the service providercp .env-example .env
in the/frontend
folder. Populate itcd frontend; npm run dev
to start the client
Once the client is running, simply follow the instructions on the screen. Upload a product image, and provide a simple prompt. Next upload a logo image and provide a simple prompt. Click Submit
and pay the invoice whenever there is a job offer (You'll need webLN. If not, go to browser console to find the bolt11). Once all the tasks are completed you should see the final Poster image.
This project started with L402 and eventually pivoted towards NIP90. To test L402, get aperture
running, and then test out the CLI client by running cd client; go run .
Video Demo here