Skip to main content

NoneBot2 plugin for use AI to draw image

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-aidraw

✨ 使用人工智能来一起画画吧! ✨

license pypi python

📖 介绍

使用第三方 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot-plugin-aidraw-0.2.0.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

nonebot_plugin_aidraw-0.2.0-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page