📖 介绍
nonebot绘画插件,基于sd-webui实现,支持指定模型、参数等
🔧 开发环境
Nonebot2:2.0.0rc3
python:3.8.13
操作系统:Windows 10、Ubuntu 22.04
编辑器:VS Code
💿 安装
1. nb-cli安装(推荐)
在你bot工程的文件夹下,运行cmd,执行nb命令安装插件,插件配置会自动添加至配置文件
nb plugin install nonebot_plugin_sd_webui
2. 本地安装
将项目clone到你的机器人插件下的对应插件目录内(一般为机器人文件夹下的src/plugins),然后把nonebot_plugin_sd_webui文件夹里的内容拷贝至上一级目录即可。
clone命令参考:
git clone https://github.com/evan-gyy/nonebot_plugin_sd_webui.git
也可以直接下载压缩包到插件目录解压,然后同样提取nonebot_plugin_sd_webui至上一级目录。
目录结构: 你的bot/src/plugins/nonebot_plugin_sd_webui/__init__.py
3. pip安装
pip install nonebot_plugin_sd_webui
打开 nonebot2 项目的 bot.py 文件, 在其中写入
nonebot.load_plugin('nonebot_plugin_sd_webui')
当然,如果是默认nb-cli创建的nonebot2的话,在bot路径pyproject.toml的[tool.nonebot]的plugins中添加nonebot_plugin_sd_webui即可
pyproject.toml配置例如:
[tool.nonebot]
plugin_dirs = ["src/plugins"]
plugins = ["nonebot_plugin_sd_webui"]
更新版本
nb plugin update nonebot_plugin_sd_webui
🔧 配置
sd-webui配置
启动sd-webui环境,并打开api,具体配置请参考官方仓库
python launch.py --api --listen
🎉 功能
基于stable-diffusion的AI绘画
👉 命令
指令:
ai画 [prompt] | [negative prompt]:使用stable-diffusion绘画
ai图生图 [prompt] | [negative prompt] [image]:根据输入的图片绘画
查看sd模型:查看当前的sd模型,以及所有模型列表
切换sd模型 [model_id]:切换到某个sd模型
查看lora ?[标签] ?[keyword]:查看可用的lora模型,支持关键词搜索、自动打tag
参数:
<[width]x[height]>:指定图片大小,如<512x768>
<s:[steps]>:指定步长,如<s:30>
<t:[translate]>:翻译成英文,如<t:动人>
示例:
ai画 miku, ultra detailed | (low quality:1.4), nsfw:1.5
ai画 <512x768>, <s:30>, <t:动人>, miku, ultra detailed
切换sd模型 2
⚙ 拓展
📝 更新日志
致谢
Metadata
Release files for nonebot-plugin-sd-webui 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_sd_webui-0.1.2.tar.gz | 7.2 kB | Without provenance | Details for nonebot_plugin_sd_webui-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_sd_webui-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_sd_webui-0.1.2-py3-none-any.whl |
Total release size: 15.4 kB
Release files / nonebot_plugin_sd_webui-0.1.2.tar.gz
| Download URL | nonebot_plugin_sd_webui-0.1.2.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c80080fcaf8c3f637943446f80b314e1620bc3c971f54770c9bc7309f08c254
|
|
BLAKE2b-256 checksum How to use checksums |
cbb40be82842d466e1fe32698188c574df20463e3614cd9b1f35dc562011dfc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.13 Windows/10
|
Release files / nonebot_plugin_sd_webui-0.1.2-py3-none-any.whl
| Download URL | nonebot_plugin_sd_webui-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75cd45d1687595d18d3af44f05090911b672c3175925da4c6c4d077cd778a4e4
|
|
BLAKE2b-256 checksum How to use checksums |
09fe4bf17c2b03b20c697e502c81290946f2711db5714e4dcb8ef45ee2fb8df7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.9.13 Windows/10
|
Security for nonebot-plugin-sd-webui 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.