Git Product home page Git Product logo

streamstablediffusion's Introduction

StreamStableDiffusion

Simple Twitch bot for StableDiffusion !generate chat commands, facilitated by interfacing with stable-diffusion-webui via websockets

Functionality

Generated images are saved to an overwritten stream.jpg file that obs can watch for, as well as a text file to output the prompt and who requested, and a text file for outputing loading messages

Utilizes StableDiffusion's Safety filter to (ideally) prevent any nsfw prompts making it to stream

built in queuing system allows for multiple requests to be stored and ran sequentually

Can connect to a twitch channel chat to search for commands:

  • !generate {prompt} # generates an image based off of the given prompt
  • !clear # wipes the current image and text
  • !approve # only the account used to connect the bot can use this command, depending on nsfw settings will 'approve' an image if they were misclassified
  • !params # outputs parameters used to create displayed image to chat
  • !seed, !prompt # outputs seed or prompt for displayed image to chat

install process:

First install the webui from https://github.com/AUTOMATIC1111/stable-diffusion-webui

NOTE: in the webui-user.bat file, --api needs to be added to the commandline args in order for this repo to work correctly.

Then download this repo

install dependancies for this repo using pip and the included requirements.txt (ideally setup a venv)

and run streambot.py

after running streambot.py once, it will create a config.json, where you can fill in your twitch api info for the bot, as well as the url for the webui, and the webui file location (the install location of the webui)

now running streambot.py again will startup the whole script, automatically startup an instance of the webui, and you should see in the terminal window it connecting to twitch

in the streamable_outputs/stream folder, there is a stream.jpg, user.txt, and generate.txt, which can be pointed to from obs to display as sources for your stream

with a little luck that should be it

To Do:

  • create a system that automatically sets up a venv and installs dependancies on first run
  • create and integrate an optional discord bot that allows posting all stream generations to a designated discord channel, and post links to chat, so users can download their explorations of the latent space
  • add a forward and backward command that lets scrolling through previous grid images, select from grid, maybe even slideshow?
  • clean up the presentation of this repo, with images detailing how it can look in action

A massive shoutout to the open source communities that are making the future of AI open to everyone. Feel free to modify or reuse the code in this repository, as long as it eventually ends up as publicly accessible code for anyone to use/learn from.

streamstablediffusion's People

Contributors

temporalyx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.