• Stars
    star
    171
  • Rank 222,266 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 2 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A front-end GUI for interacting with the AI Horde / Stable Diffusion distributed cluster

ArtBot for Stable Diffusion

A painting robot

See it in action: https://tinybots.net/artbot

Table of Contents

Intro

ArtBot is an unofficial front-end web client designed for interacting with the Stable Horde distributed cluster -- a group of GPUs running Stable Diffusion whose processing time has been kindly donated by an enthusiastic community of volunteers.

ArtBot is built using Next.js 13 and Typescript. It with was created as a side project in order to experiment with various client-side technologies, such as IndexedDB and LocalStorage APIs. These APIs allow you to securely and privately store the AI generated images you've created with the cluster within your own browser.

The UI components are custom built using a combination of Styled Components and Tailwind CSS, with more recent efforts strictly focused on using Tailwind CSS. The long term goal is to completely remove Styled Components from the code base.

ArtBot makes use of icons from Tabler.

Setup

Requirements

  • node >= 18.0.0
  • npm >= 9.0.0

Most of these steps should be applicable to Linux / MacOS / Windows environments.

Installing various versions of Node.js on your machine can be tricky. I am a big fan of nvm, which allows you to run multiple isolated versions of Node.js on your machine with ease.

Using nvm, you can install Node like this:

> nvm install v18.16.0
> nvm alias default node

Installing

Once you have your Node.js environment setup, you can clone this repository and install the required packages. Depending on the specs of your machine and speed of your internet connection, installing all packages may take a minute or two.

> git clone https://github.com/daveschumaker/artbot-for-stable-diffusion
> cd artbot-for-stable-diffusion
> npm install

Environmental variables

A postinstall script will automatically run that creates a blank .env file in the root of the project folder. You don't need to add anything to it, but it's presence is required by the dotenv package.

While not required, the code base references a few environmental variables in various places. These are generally endpoints for messaging, telemetry services that I run, or local data storage related to model counts and image generation totals.

Usage

Development

IMPORTANT: Attempting to run the app this way on a Windows machine will not work. This is due to passing environment variables to the web app with the npm scripts. See the troubleshooting section for more information.

Alright, you should now be able to run the ArtBot web app! To run in development mode (which uses NextJS's hot reloading feature -- where you can see updates live on the site as you make changes)

> npm run dev

Then, open your browser and visit http://localhost:3000, you should now be able to immediately make image requests to the Stable Horde. Head over to http://localhost:3000/artbot/settings and enter your Stable Horde API key for faster generation times.

Production

If you want to run this in a production type of environment, you'll first need to kick off a build and then run as you normally would run a Node.JS app.

> npm run build
> npm run start

On TinyBots, my web server for hosting ArtBot, I use PM2 in order to persist the application and automatically restart after crashes or reboots. You can modify PM2 related settings inside ecosystem.config.js.

Additionally, you can start and stop PM2 using:

> npm run pm2:start-prod
> npm run pm2:stop-prod

Troubleshooting

Windows issues

As mentioned earlier, attempting to use npm run dev or npm run start within a Windows environment will result in an error. One possible solution to this is to remove the environment variable. In the case of npm run dev, that would look like this.

  • Open package.json
  • Change the scripts/dev line to remove PORT=3000 from the script:
> npm run update:build-id && node server.js
  • Save package.json and attempt to run again: > npm run dev
  • It should now work (the web app will default in port 3000, which is automatically set inside server.js

Other issues

For other issues not mentioned here, feel free to open a new issue on Github or visit the ArtBot feedback channel on the Stable Horde Discord server.

Contributions

Contributions are very welcome! General guidelines are as follows:

  1. Fork this repository
  2. Cut a new feature branch. e.g., > git checkout -b my-cool-new-feature
  3. Make any necessary changes.
  4. Open a new pull request based on your feature branch.

Let me know if you have any questions. I'm more than happy to help.

License

See LICENSE.md

More Repositories

1

nodeEbot

NodeEbot: A Node E-Books Bot for Twitter that generates tweets from pseudo Markov chains based on a particular user's posting history.
JavaScript
28
star
2

moonbot

A (very) simple cryptocurrency trading bot. Next stop: the Moon!
JavaScript
8
star
3

scss-away

A utility to examine a folder of React components, check corresponding scss files and show orphaned rules.
JavaScript
6
star
4

local-air

View the latest air quality data from PurpleAir IoT sensors located near your home.
JavaScript
5
star
5

Verge-Pull-Quote-Generator

Generate your own fancy pull quotes that look like they were featured on The Verge!
CSS
4
star
6

Bughzzfeed-Bot

A PHP script to randomly generate Buzzfeed style headlines and post them on Twitter.
PHP
3
star
7

GIFtv

GIFtv - Turn any display into a fullscreen GIF picture frame
PHP
3
star
8

DaveChat

Simple chat app using Node.js and socket.io
CSS
3
star
9

JavaScript-Baseball-Simulator

Realistic predictions on the outcome of baseball games based on baseball players' past performance.
JavaScript
2
star
10

Flags-of-the-World

AngularJS and Node web app that quizzes users about flags of the world.
JavaScript
2
star
11

super-simple-chatui

A simple interface for interacting with LLMs via a local installation of Ollama
TypeScript
2
star
12

QuickEmailMaker

Quick and Dirty PHP Email Generator for Contests and Giveaways
PHP
1
star
13

Random-Sandwiches

A book of 1500 randomly generated sandwich recipes.
HTML
1
star
14

bootstrap-node-project

Quickly setup a new Node.js project with frequently used configuration parameters.
JavaScript
1
star