Giter VIP home page Giter VIP logo

stable-diffusion-qqbot's Introduction

maven maven maven

stable-diffusion-qqbot

004.jpg

一个支持中文的stable-diffusion文字生成图像机器人,需要在部署docker版本的stable-diffusion时挂载模型进去

如何部署

  1. 下载stable-diffusion的模型文件,参见 https://github.com/CompVis/stable-diffusion 选择合适的模型,如sd-v1-4.ckpt
  2. 把go-cqhttp的data文件放进cqhttp文件夹,如何配置QQ号之类的请参见https://docs.go-cqhttp.org/
  3. 修改docker-compose.yml,修改挂载模型位置,以及如果需要开发txt2img_serve.py可以挂载一个新的进去
  4. 修改.env.env.dev,如果修改了redis密码,还要修改redis_conf下的配置,如果没有使用代理服务器,就无法使用google翻译,但不会影响英文功能
  5. docker-compose up

一个示例的.env文件如下(由于gitignore设置,不可以上传.env文件)

ENVIRONMENT=dev
REDIS_HOST_ADDRESS=redis
REDIS_HOST_PORT=6379
REDIS_DB_NUMBER=0
REDIS_PASSWORD=ThisIsAExamplePasswordInTheDemoConfigPleaseChangeItBeforeUseHoHoHo
REDIS_JOB_QUEUE_NAME=queue:txt2img_job
REDIS_RESULT_QUEUE_NAME=queue:txt2img_result
REDIS_ERROR_QUEUE_NAME=queue:txt2img_error
IMAGE_SAVE_PATH=/workdir/images
PROXY_ADDR=socks5://你的代理IP:1080

如何使用

目前支持2个命令,

/draw english text to draw

/cn 中文走翻译然后再画

额外参数

请参见 https://github.com/lxj616/stable-diffusion-docker-service 下的txt2img_serve.py,目前由于性能原因,锁定 50 steps,大概十几秒一张图片

QQ机器人中目前没有开放自定义参数功能,因为性能实在不够用

bot测试QQ群

暗号是:老铁没毛病

004.jpg

免费分享不易,GPU资源有限,限时分享开放一阵子 因为电脑还有其他学习任务,不定期开放,一般在周末白天分享,工作日随缘,睡觉时必定关机

安全 & 合规

stable-diffusion-docker-service内置使用了CompVis/stable-diffusion-safety-checker进行内容安全控制,请放心使用,如果出现疑似违规图片,会自动替换成rick的照片,如果看到以下这个照片,说明内容疑似违规了,误伤概率有点大,但还是严格一点儿比较放心

rick.jpeg

stable-diffusion-qqbot's People

Contributors

lxj616 avatar

Watchers

 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.