NoneBot2 plugin for use AI to draw image
Project description
📖 介绍
使用第三方 API 的 NovelAI 绘图插件
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-aidraw
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-aidraw
pdm
pdm add nonebot-plugin-aidraw
poetry
poetry add nonebot-plugin-aidraw
conda
conda install nonebot-plugin-aidraw
打开 nonebot2 项目的 bot.py
文件, 在其中写入
nonebot.load_plugin('nonebot_plugin_aidraw')
⚙️ 配置
在 nonebot2 项目的.env
文件中添加下表中的必填配置
配置项 | 必填 | 说明 |
---|---|---|
AI_DRAW_API | 否 | 第三方 API 的地址 |
AI_DRAW_TOKEN | 是 | 第三方 API 的 token, 点击这里获取 |
AI_DRAW_COOLDOWN | 否 | 插件的冷却时间, 默认60秒 |
AI_DRAW_TIMEOUT | 否 | 请求 API 的超时时间, 默认60秒 |
🎉 使用
指令表
指令 | 需要@ | 范围 | 说明 |
---|---|---|---|
绘画/画画/画图/作图/绘图/约稿 | 否 | 群聊/私聊 | 使用描述性文本生成图画, 可用参数见文本生成参数 |
以图绘图/以图生图/以图制图 | 否 | 群聊/私聊 | 在基准图像上使用描述性文本生成图画, 支持回复图片消息使用, 可用参数见图像生成参数 |
文本生成参数
参数名 | 简写 | 全写 | 说明 |
---|---|---|---|
shape | -p | --shape | 可选 Portrait(纵向)、Landscape(横向)、Square(方形) 默认图像为纵向, 支持缩写为 p、l、s |
scale | -c | --scale | 指示 AI 对提示的遵守程度,较大的值可以帮助 AI 更接近文本提示的整体意图 |
seed | -s | --seed | 随机种子。在其他条件不变的情况下,相同的种子代表生成相同的图 |
steps | -t | --steps | 定义 AI 从最初创建时应优化的迭代次数 |
ntags | -n | --ntags | 不需要的内容,可以列出希望 AI 避免的任何内容 |
图像生成参数
参数名 | 简写 | 全写 | 说明 |
---|---|---|---|
strength | -e | --strength | 允许 AI 改变图像的构成, 降低该值会产生更接近原始图像的效果 |
使用示例:
/绘图 描述文本 -p l --scale 12
注意
默认情况下, 您应该在指令前加上命令前缀, 通常是 /
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nonebot-plugin-aidraw-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd1def937d0795cfcdfb71ef7a5b21f959c3d3c38c04ce04e340536bd7b29322 |
|
MD5 | db28b580bf57ece5146bd88fb35e622e |
|
BLAKE2b-256 | af8318e1ab5451625b9837bc5a6ccd779639b84d8774f8f8f3ad29723cf15d6c |
Close
Hashes for nonebot_plugin_aidraw-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 490917fa2c1119501fc49ee5d8d771c6c78f01916493205888b8c8f52817e689 |
|
MD5 | ca47c71568da722dab970ccc607b1fc5 |
|
BLAKE2b-256 | 443dbe4a8a661bf9e0bddce76d922b55d58e1f2646a62f8ba08f1c74597ba7f1 |