Git Product home page Git Product logo

mirai-plugin-midjourney's Introduction

Mirai机器人插件 mirai-plugin-midjourney

介绍

本项目为 Mirai 的机器人插件,对接 Midjourney API,实现 QQ 机器人的AI绘画功能,当前版本 v0.1.0

本插件基于 Mirai 2.15 版本开发,支持 2.14 版本,暂未测试其他 Mirai 版本,如有其他版本请自行测试。

本插件使用的 Midjourney API 兼容:

可用的在线 API 服务:

免责声明

注意,本项目仅限于学术研究,请勿用于非法用途。不建议向公众提供服务,当然也不鼓励,不支持一切商业使用。生成的图像属于 Midjourney ,任何由于此项目导致的法律问题本人概不负责。

使用方法

1 添加插件

如果你要添加该插件,请将该插件放在 MCL 根目录下的 /plugins 文件夹中,并运行一次 MCL,生成插件的 Config 文件。

2 编辑配置文件

目前版本暂不支持在线更新Config。在 MCL 成功运行后,请关闭 MCL 主程序。

在 Mirai 的根目录下找到 /config/top.joyer.mirai-plugin-midjourney 文件夹,在该文件夹下为本插件的配置文件。

config.yml help_config and More...
插件主要配置文件 插件自带Help指令配置文件 and More...

config.yml(必须配置)

配置项 类型 描述
bot_qq long 被允许运行此插件的机器人企鹅号(必须是数字企鹅号),必须配置
api_url String 通过兼容的API平台获取的API地址,必须配置
api_key String 通过兼容的API平台获取的密钥,必须配置
command_help bool 插件自带Help指令的开关,默认打开
bot_qq: 123456
api_url: https://xxx.xxx.xxx/
api_key: 'sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
command_help: true

help_config.yml (选择配置)

配置项 类型 描述
help_text String 用户执行/?显示的文本
后期会改善在配置文件中配置的便利性
help_text: "Bot指令列表:\n\nAI绘画:\n◆ /image <关键词>  # 新的AI绘图\n◆ /change v <数字1-4> <可选:绘图ID> # 从四宫格绘图中的第{数字}幅图为底生成新的绘图\n◆ /change u <数字1-4> <可选:绘图ID> # 放大四宫格绘图中的第{数字}幅图\n◆ /change r <可选:任务ID> # 重新绘制四宫格绘图\n\n在 image 指令中添加 --niji <数字1-5> 参数,数字越大二次元浓度越高\n在 change 指令中如果不填写绘图 ID ,默认为该用户上一次生成的四宫格绘图"

3 开始使用

重新运行 MCL 主程序,现在可以开始使用了。

功能

  • 由用户唤起的绘图请求,并在绘图结束后获得四宫格的图像
  • 由用户唤起的绘图修改请求,并在绘图结束后获得四宫格的图像或单图像

⚠ 绘图指令受到 PG-13 分级的限制,如果关键词超出这个限制将不会生成图像,并弹出警告 (某些瑟瑟的人呐,小心机器人封号)

四宫格图像

1695580369782414.jpg

上图可见为四宫格图像,从左到右从上到下被定义为图1、2、3、4。

单图像

1695584776767642.jpg

上图为单图像,经过放大四宫格图像操作得到(例如上图是/change u 1)。

指令

指令用法 描述
/image <关键词> 新的AI绘图
/change v <数字1-4> <可选:绘图ID> 从四宫格绘图中的第{数字}幅图为底生成新的绘图
/change u <数字1-4> <可选:绘图ID> 放大四宫格绘图中的第{数字}幅图
/change r <可选:任务ID> 重新绘制四宫格绘图

在上述指令中有一个可选参数绘图ID绘图ID在每次绘图生成时被附带生成。如果在输入指令时未输入该ID,插件会尝试使用上一次用户生成的绘图的ID,未找到时将不会执行请求。

出现问题

如果有任何问题、建议、Bug提交,请在 Issues 中提出。

开源协议

本项目基于 AGPLv3 协议 开源。

mirai-plugin-midjourney's People

Contributors

joyerliu avatar

Stargazers

 avatar sansiny avatar KangChou~OvO⁹⁹ avatar  avatar  avatar

Watchers

 avatar

Forkers

haoieac

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.