Giter VIP home page Giter VIP logo

ai-drawing-chatbot's Introduction

AI Drawing ChatBot

This is an AI image generator Discord bot written in Python. It has a chatbot that uses ChatGPT!

This project uses lots of APIs. As a result, you will not need a powerful computer!

DISCLAIMER: ChatGPT uses your Poe account. I am not responsible if your Poe account gets banned, since using Poe in programs is against their TOS.

Broken stuff

  • Using text-davinci-003 as the chatbot model
  • Using Imaginepy

Table of Contents

  1. Features
  2. Notes
  3. Prerequisites
  4. Setup
  5. Configuration
  6. Generate images faster with Stable Horde

Features

  • ChatGPT chatbot that is integrated with Imaginepy
  • 3 slash commands for generating images
  • Stable Diffusion
  • Anything Diffusion
  • Pollinations

Notes

  • ChatGPT is the fastest model that you can use.
  • While generating a response with GPT4All, the program locks up.
  • Do not input any personal information on the /imagine_poly command because your generated image will be displayed on their official frontpage.
  • Please do not enter any personal information in the Chatbot or in the image generators, because your prompts are sent to various providers.
  • When you use Stable Horde to generate images, your prompts are sent to Stable Horde, as listed in their privacy policy.
  • The chatbot may not work as expected if multiple users are chatting with it at once.
  • When using Replit, GPT4All cannot be used.
  • When using Replit, you must input your .env variables in the Secrets button on Replit.

Prerequisites

This project assumes that:

  • Python 3.8+ is installed and is on your PATH
  • Pip is installed
  • Python-venv is installed (only for Debian based distros)
  • Git is installed
  • You know how to create a Discord Bot account
  • You know JSON syntax (It's basically a Python Dictionary)

Setup

  1. Create a Discord Bot and grab the token. Make sure to switch on Message Content Intent in the Bot tab of the Developer Portal.
  2. Grab an API key from Stable Horde at their register page.
  3. Rename example.env to .env and place your bot token and your API key in under API_KEY.
  4. Register for Poe and open inspect tool. Find your token and place it under POE_TOKEN in your .env file.
  5. Place your Discord bot token under BOT_TOKEN.
  6. Clone the Stable Horde module:
git clone https://github.com/mak448a/horde_module --depth=1
  1. Create venv and install dependencies:

Linux or MacOS

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Windows

python -m venv venv
venv\Scripts\activate.bat
pip install -r requirements.txt
  1. Rename example_config.json to config.json. Edit this file however you like. See Configuration.
  2. Run the bot and invite it with the link it provides.
  3. Type / in the message box and try out the commands!
  4. You can chat with the bot by @pinging the bot and typing your message.

Configuration

Configuring chat model Go to config.json and set the key "model" to the model you want.

Available Models

  • ChatGPT
  • GPT4All
  • text-davinci-003

You must write the model exactly as it is written here. When using ChatGPT, you must sign up for a Poe account.

When you are done, the edited line should look like this:

"model": "ChatGPT",

Disable chatbot Go to config.json and set the key "chatbot" to false.

It should look like this:

"chatbot": false,

Change loading GIF Go to config.json and set the key "loading_gif" to any GIF on Tenor you want!

It should look like this:

"loading_gif": "https://tenor.com/your/favorite/loading/gif",

Turn off command syncing (makes bot load faster) Go to config.json and set the key "sync" to false.

It should look like this:

"sync": false

Generate images faster with Stable Horde

Stable Horde uses Kudos to rank users on a queue. The more Kudos you have, the higher you are on the generation queue. You get Kudos by rating images and/or generating images for Stable Horde on your local hardware. To get more Kudos, first stick your api key here. Then, rate some images generated by other users here. After rating for a few minutes, you will have more Kudos! IMPORTANT: When an image says, "This rating must be x," you must rate it that. This picture is used as a Captcha to avoid spam.

ai-drawing-chatbot's People

Contributors

mak448a avatar mishalhossin avatar genericness 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.