初始文档
This commit is contained in:
52
开发文档/Flutter框架.md
Normal file
52
开发文档/Flutter框架.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# 新版android-studio设置中文
|
||||
```
|
||||
# 下载对应版本号的中文插件
|
||||
https://plugins.jetbrains.com/plugin/13710-chinese-simplified-language-pack----/versions/stable
|
||||
|
||||
# 将插件压缩包复制到android-studio安装目录的plugins目录
|
||||
# 打开android-studio,打开setting,plugins,选择install plugin from disk从本地磁盘安装插件
|
||||
```
|
||||
|
||||
# android sdk环境变量配置
|
||||
```dart
|
||||
//在系统变量中新建ANDROID_HOME变量,变量值为android-sdk所在目录
|
||||
//在path变量中添加tools工具目录%ANDROID_HOME%\tools和%ANDROID_HOME%\platform-tools
|
||||
```
|
||||
# 包管理
|
||||
## cookie
|
||||
```sh
|
||||
dio-cookie-manage不能用于web项目
|
||||
```
|
||||
# 布局Widget
|
||||
## container
|
||||
> container可以自定义其子widget,例如添加padding,边框等
|
||||
|
||||
## center
|
||||
> 创建一个上下左右居中的容器
|
||||
|
||||
## child和children
|
||||
> child只能包含单个子项,例如:center,container
|
||||
> children可以包含多个子项,Row,column,ListView,Stack
|
||||
|
||||
## Row和Column
|
||||
> 使用 mainAxisAlignment 和 crossAxisAlignment 属性控制行或列如何对齐其子项
|
||||
|
||||
SingleChildScrollView和ListView在Flutter中都是用于处理滚动内容的组件,但它们之间存在一些关键的区别。以下是它们之间的主要区别:
|
||||
|
||||
1. **子元素数量**:
|
||||
- SingleChildScrollView:只能包含一个子元素。这个子元素可以是一个复杂的布局,比如一个Column、ListView或GridView,但整体来说,SingleChildScrollView的直接子元素是单一的。
|
||||
- ListView:可以包含多个子元素。它是一个滚动的可滚动组件,通常用于包含多个子元素的情况。ListView接受一个children参数,该参数是一个包含所有子元素的列表。
|
||||
2. **使用场景**:
|
||||
- SingleChildScrollView:通常用于包装一个内容较大的单一子元素,例如一个长文本或一个包含多个控件的复杂布局。当这个子元素的大小超过屏幕可见区域时,用户可以通过滚动来查看全部内容。
|
||||
- ListView:更适用于包含多个子元素,且子元素数量相对固定或有限的情况。由于ListView需要知道所有子元素的数量,因此它在性能上更高效,因为它只会在屏幕上显示的子元素上工作。
|
||||
3. **动态内容**:
|
||||
- SingleChildScrollView:由于只包含一个子元素,这个子元素可以是一个动态生成的内容。SingleChildScrollView在处理动态内容(例如异步加载的数据)时更加灵活。
|
||||
- ListView:虽然也可以处理动态内容,但由于其性能优化机制(只渲染可见的子元素),在处理大量动态内容时可能需要额外的考虑。
|
||||
4. **其他功能**:
|
||||
- ListView:支持分割器(divider),用于在列表项之间添加分隔符。此外,ListView还提供了更多的滚动控制选项,如滚动物理效果(ScrollPhysics)和滚动控制器(ScrollController)。
|
||||
- SingleChildScrollView:更加简单和直观,主要用于滚动查看超出屏幕可见区域的内容。它没有ListView提供的那些特定于列表的功能。
|
||||
|
||||
总结:
|
||||
|
||||
- 如果你有一个固定的、数量相对较少的子元素列表,ListView是一个更好的选择,因为它提供了针对列表的特定功能和性能优化。
|
||||
- 如果你有一个单一的、内容较大的子元素,或者需要处理动态内容,SingleChildScrollView可能更适合你的需求。它提供了一个简单而直观的方式来滚动查看超出屏幕可见区域的内容
|
||||
62
开发文档/javascript/html+css+js教程.md
Normal file
62
开发文档/javascript/html+css+js教程.md
Normal file
@@ -0,0 +1,62 @@
|
||||
text-decoration:none 去下划线
|
||||
cursor:pointer 鼠标变手型
|
||||
target="_blank" 在新页面打开连接
|
||||
rel="nofollow" 禁止爬虫爬该链接
|
||||
float 元素偏移
|
||||
rgba(0,0,0,0-1) 设置透明色
|
||||
# html用法
|
||||
|
||||
### 表单上传多文件
|
||||
```html
|
||||
<form action="url" method="POST" enctype="multipart/form-data">
|
||||
<input type="file" name="imagevideo" accept="image/jpeg,image/png,image/jpg,video/mp4,video/mpeg" multiple="multiple" disabled="disabled">
|
||||
<input type="radio" value="5" name="evaluate3" required>
|
||||
<input typed="text" placeholder="这里是提示的文字">
|
||||
<input type="text" value="默认显示值" readonly>
|
||||
</form>
|
||||
“input禁止复制粘贴 禁止复制: οncοpy="return false" 禁止粘贴: οnpaste="return false" 禁止剪切: oncut="return false" 禁止右键弹出: οncοntextmenu="return false" 关闭自动完成功能(缓存): autocomplete="off" 自动获得焦点: autofocus="autofocus" 禁用自动更正: autocorrect="off" 来关闭键盘默认首字母大写...
|
||||
```
|
||||
> + type指定类型
|
||||
> + 上传多文件必须的属性
|
||||
method="post" 请求方式
|
||||
enctype="multipart/form-data" 表单上传多文件
|
||||
multiple="multiple" 多选文件
|
||||
> + accept指定上传文件类型
|
||||
> + disabled指定元素不可选
|
||||
> + required指定字段不能为空
|
||||
> + placeholder在文本框显示提示语
|
||||
> + value在文本框显示默认值
|
||||
> + readonly文本框只读
|
||||
> + οncοpy="return false"禁止复制
|
||||
> + οnpaste="return false"禁止粘贴
|
||||
> + oncut="return false"禁止剪切
|
||||
> + onselectstart="return false"禁止被选中
|
||||
> + οncοntextmenu="return false"禁止右键弹出
|
||||
> + autocomplete="off"关闭自动完成功能(缓存)
|
||||
> + autofocus="autofocus"自动获得焦点
|
||||
> + autocorrect="off"禁用自动更正
|
||||
> + autocapitalize="off"移动端关闭键盘首字母大写
|
||||
> + spellcheck="false"不对元素的文本进行拼写检查
|
||||
|
||||
##### accept支持上传文件类型
|
||||
# JavaScript
|
||||
### 类型转换
|
||||
+ 将JavaScript任意类型转换为string类型
|
||||
> 可以用 data.toString()或String(data)方式
|
||||
|
||||
### 计算文件hash
|
||||
```javascript
|
||||
const md5 = CryptoJS.algo.MD5.create()
|
||||
// 以二进制的方式读取文件,每次读取一定字节块
|
||||
md5.update(a)
|
||||
|
||||
md5.finalize().toString(CryptoJS.enc.MD5)
|
||||
|
||||
```
|
||||
|
||||
### 生成随机数
|
||||
```JavaScript
|
||||
Math.random() //返回0-1之间的小数
|
||||
Math.round(num) //将num四舍五入
|
||||
Math.floor(Math.random()*10) //生成0-10之间的随机数
|
||||
```
|
||||
125
开发文档/javascript/javascript工具集.md
Normal file
125
开发文档/javascript/javascript工具集.md
Normal file
@@ -0,0 +1,125 @@
|
||||
|
||||
### 计算文件md5
|
||||
|
||||
```javascript
|
||||
const md5 = CryptoJS.algo.MD5.create()
|
||||
// 以二进制的方式读取文件,每次读取一定字节块
|
||||
md5.update(a)
|
||||
md5.finalize().toString(CryptoJS.enc.MD5)
|
||||
```
|
||||
# 原生js发起http请求
|
||||
```js
|
||||
//客服端发起请求,接受服务器返回的json数据
|
||||
fetch('http://example.com/request')
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
console.log(data); // 这里处理返回的JSON数组
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('There has been a problem with your fetch operation:', error);
|
||||
});
|
||||
```
|
||||
# 重新加载网页
|
||||
```js
|
||||
//重新加载名为example_frame的框架页面
|
||||
window.frames['example_frame'].location.reload(true);
|
||||
//重新加载当前页面
|
||||
location.reload();
|
||||
//重新加载页面的客户端部分(不包括服务器端脚本)
|
||||
location.assign(location.href);|
|
||||
```
|
||||
# 修改元素的属性
|
||||
```js
|
||||
//修改id_name的边框为2px
|
||||
document.getElementById('id_name').style.border='2px'
|
||||
```
|
||||
# 修改网页内容
|
||||
```js
|
||||
//innerHTML可以添加html元素
|
||||
document.getElementById('id_name').innerHTML=''
|
||||
//textContent只能添加纯文本
|
||||
document.getElementById('id_name').textContent
|
||||
```
|
||||
# 生成随机数
|
||||
```js
|
||||
//生成10以内的随机数
|
||||
Math.floor(Math.random() * 10) + 1
|
||||
//Math.random()生成一个随机浮点数
|
||||
//Mate.floor()将浮点数向下取整,变成一个整数
|
||||
```
|
||||
# 分钟倒计时
|
||||
|
||||
```html
|
||||
<h3 id="countdown">02:00</h3>
|
||||
<button type="button" class="btn btn-primary" id="startCountdown">开始计时</button>
|
||||
```
|
||||
```js
|
||||
// 抽奖二维码倒计时功能
|
||||
let countdownElement = document.getElementById('countdown');
|
||||
let minutes = '02'; // 将分钟初始化为字符串形式
|
||||
let seconds = '00'; // 将秒初始化为字符串形式
|
||||
let intervalIds;
|
||||
let timer;
|
||||
let isPause = false;
|
||||
const toggleButton = document.getElementById('startCountdown')
|
||||
//开始计时
|
||||
function startCountdown() {
|
||||
intervalIds = setInterval(updateCountdown, 1000);
|
||||
}
|
||||
//更新计时器
|
||||
function updateCountdown() {
|
||||
if (minutes === '00' && seconds === '00') {
|
||||
clearInterval(intervalIds); // 停止计时器
|
||||
countdownElement.textContent = '00:00';
|
||||
return;
|
||||
}
|
||||
seconds = parseInt(seconds) - 1; // 将秒转换为整数进行减法运算
|
||||
if (seconds < 0) {
|
||||
minutes = parseInt(minutes) - 1; // 将分钟转换为整数进行减法运算
|
||||
seconds = 59;
|
||||
}
|
||||
// 只对个位数分钟进行补零操作,并且只在倒计时进行到个位数分钟时才补零
|
||||
if (minutes < 10 && minutes > -1 && seconds === '00') {
|
||||
minutes = "0" + minutes;
|
||||
} else {
|
||||
minutes = minutes.toString().padStart(2, '0'); // 其他情况下保证分钟为两位数
|
||||
}
|
||||
if (seconds < 10) {
|
||||
seconds = "0" + seconds; // 秒小于10时在前面补零
|
||||
}
|
||||
countdownElement.textContent = `${minutes}:${seconds}`;
|
||||
}
|
||||
|
||||
// document.getElementById('startCountdown').addEventListener('click', startCountdown);
|
||||
toggleButton.addEventListener('click', () => {
|
||||
if (isPause) {
|
||||
isPause = false;
|
||||
clearInterval(intervalIds);
|
||||
toggleButton.textContent = '继续计时'; // 修改按钮文本为"Pause"
|
||||
} else {
|
||||
isPause = true;
|
||||
toggleButton.textContent = '结束计时'; // 修改按钮文本为"Resume"
|
||||
startCountdown()
|
||||
}
|
||||
});
|
||||
```
|
||||
# 显示或隐藏元素
|
||||
```html
|
||||
<div id="qrImage" style="display: none;">
|
||||
<image src="https://example.com/example.png"></image>
|
||||
</div>
|
||||
```
|
||||
```js
|
||||
var divElement = document.getElementById("qrImage");
|
||||
if (divElement.style.display === "none") {
|
||||
divElement.style.display = "block"; // 显示div元素
|
||||
} else {
|
||||
divElement.style.display = "none"; // 隐藏div元素
|
||||
}
|
||||
```
|
||||
47
开发文档/javascript/nodejs.md
Normal file
47
开发文档/javascript/nodejs.md
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
# nvm版本管理器常用命令
|
||||
|
||||
```shell
|
||||
nvm arch #显示node是以32位还是64位运行
|
||||
nvm check #检查nvm4w进程是否存在问题
|
||||
nvm current #显示活动版本
|
||||
nvm install <version> [arch] # 安装指定版本的node,也可以指定32位或64位
|
||||
nvm list [available] # 列出node安装的版本,末尾加available可以显示可安装的版本
|
||||
nvm on #启用node版本管理
|
||||
nvm off #禁用node版本管理
|
||||
nvm proxy [url] # 设置下载代理,留空查看当前代理,设置none删除代理
|
||||
nvm uninstall <version> #删除特定版本
|
||||
nvm use <version> [arch] # 切换到指定版本
|
||||
nvm root <path> # 设置nvm存放不通版本node的目录
|
||||
nvm version # 显示当前运行的nvm的版本
|
||||
nvm node_mirror <node_mirror_url> # 设置节点镜像https://npmmirror.com/mirrors/node/
|
||||
nvm npm_mirror <npm_mirror_url> # 设置npm镜像,https://npmmirror.com/mirrors/npm/
|
||||
```
|
||||
# npm安装模块
|
||||
```js
|
||||
npm install -g --save-dev --verbose crypto
|
||||
//-g参数:全局安装
|
||||
//--save-dev:保存到当前项目模块目录
|
||||
//--verbose:安装时显示进度条
|
||||
```
|
||||
# npm安装加速
|
||||
```shell
|
||||
# 设置华为镜像加速
|
||||
npm config set registry https://repo.huaweicloud.com/repository/npm/
|
||||
npm cache clean -f
|
||||
# 设置nodejs工具的镜像地址
|
||||
npm config set disturl https://repo.huaweicloud.com/nodejs
|
||||
# 设置Node-Sass的镜像地址
|
||||
npm config set sass_binary_site https://repo.huaweicloud.com/node-sass
|
||||
# 设置浏览器引擎驱动镜像地址,
|
||||
npm config set phantomjs_cdnurl https://repo.huaweicloud.com/phantomjs
|
||||
npm config set chromedriver_cdnurl https://repo.huaweicloud.com/chromedriver
|
||||
npm config set operadriver_cdnurl https://repo.huaweicloud.com/operadriver
|
||||
# 设置Electron和Python的镜像地址
|
||||
npm config set electron_mirror https://repo.huaweicloud.com/electron/
|
||||
npm config set python_mirror https://repo.huaweicloud.com/python
|
||||
```
|
||||
# yarn安装加速
|
||||
```shell
|
||||
yarn config set registry https://repo.huaweicloud.com/repository/npm/
|
||||
```
|
||||
68
开发文档/python/Anaconda用法.md
Normal file
68
开发文档/python/Anaconda用法.md
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: 'Anaconda用法'
|
||||
date: '2022/03/28 20:00'
|
||||
tags: [python, 虚拟化, anaconda, 文档教程]
|
||||
categories:
|
||||
- 软件用法
|
||||
---
|
||||
|
||||
# Anaconda用法
|
||||
- Anaconda下载地址:https://www.anaconda.com/download/
|
||||
- Miniconda下载地址:https://docs.conda.io/en/latest/miniconda.html
|
||||
- 清华大学的conda源:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
|
||||
- 配置清华大学conda源
|
||||
```ini
|
||||
channels:
|
||||
- defaults
|
||||
show_channel_urls: true
|
||||
default_channels:
|
||||
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
|
||||
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
|
||||
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
|
||||
custom_channels:
|
||||
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
|
||||
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
|
||||
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
|
||||
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
|
||||
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
|
||||
pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
|
||||
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
|
||||
```
|
||||
|
||||
## linux下载链接
|
||||
```sh
|
||||
wget https://repo.anaconda.com/miniconda/Miniconda3-py311_24.1.2-0-Linux-x86_64.sh
|
||||
sudo bash Miniconda3-py311_24.1.2-0-Linux-x86_64.sh
|
||||
```
|
||||
### conda命令用法
|
||||
- 删除虚拟环境
|
||||
`conda env remove --name myenv`
|
||||
- 删除指定路径的虚拟环境
|
||||
`conda env remove -p /完整/路径/到/环境`
|
||||
- 查看虚拟环境
|
||||
`conda env list或conda info --envs`
|
||||
- windows下在用户目录下创建conda配置文件,文件名.condarc,linux下会自动创建无需手动创建
|
||||
`conda config --set show_channel_urls yes`
|
||||
- 清除索引缓存
|
||||
`conda clean -i`
|
||||
> 更改conda源后使用
|
||||
- 创建一个名为envname的虚拟环境,并安装python=3.6
|
||||
`conda create --name envname python=3.6`
|
||||
> 默认在用户目录下创建
|
||||
- 指定目录创建环境,在d盘virtual目录下创建名为tensorflow的虚拟环境
|
||||
`conda create --prefix=d:\virtual\tensorflow`
|
||||
> 使用prefix时,不能指定虚拟环境名称,给定的路径最后一个目录即为虚拟环境名称
|
||||
- 取消自动激活conda环境
|
||||
`conda config --set auto_activate_base false`
|
||||
- 在conda环境中安装包,虚拟环境名称可以不用指定
|
||||
`conda install --name envname package1 package2`
|
||||
- 在conda环境中卸载包,remove和uninstall效果一样
|
||||
`conda remove --name envname package1 package2`
|
||||
- 查询conda包,可以不输入完整的包名
|
||||
`conda search packagename`
|
||||
- 查询指定conda包的可用版本
|
||||
`conda search packagename==`
|
||||
- 列出conda包
|
||||
`conda list`
|
||||
- 更新conda包
|
||||
`conda update --name envname package1 package2`
|
||||
58
开发文档/python/mojo教程.md
Normal file
58
开发文档/python/mojo教程.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# 安装Mojo
|
||||
打开终端并安装modular命令行工具:
|
||||
```sh
|
||||
curl -s https://get.modular.com | sh -
|
||||
```
|
||||
|
||||
然后使用以下命令登录到您的Modular帐户:
|
||||
```sh
|
||||
modular auth
|
||||
```
|
||||
|
||||
现在您可以安装Mojo SDK:
|
||||
```sh
|
||||
modular install mojo
|
||||
```
|
||||
|
||||
设置环境变量以便访问mojo命令行界面:如果您使用的是Bash,请运行以下命令:
|
||||
```sh
|
||||
MOJO_PATH=$(modular config mojo.path) \
|
||||
&& BASHRC=$( [ -f "$HOME/.bash_profile" ] && echo "$HOME/.bash_profile" || echo "$HOME/.bashrc" ) \
|
||||
&& echo 'export MODULAR_HOME="'$HOME'/.modular"' >> "$BASHRC" \
|
||||
&& echo 'export PATH="'$MOJO_PATH'/bin:$PATH"' >> "$BASHRC" \
|
||||
&& source "$BASHRC"
|
||||
```
|
||||
安装 MAX SDK:
|
||||
```
|
||||
modular install max
|
||||
```
|
||||
|
||||
安装 [MAX 引擎 Python](https://docs.modular.com/engine/reference/python/engine) 包:
|
||||
```
|
||||
MAX_PATH=$(modular config max.path) \ && python3 -m pip install --find-links $MAX_PATH/wheels max-engine
|
||||
```
|
||||
|
||||
设置环境变量,以便您可以访问 [`max`](https://docs.modular.com/engine/reference/cli/) 和 [`mojo`](https://docs.modular.com/mojo/cli/) CLI:
|
||||
```
|
||||
MAX_PATH=$(modular config max.path) \
|
||||
&& BASHRC=$( [ -f "$HOME/.bash_profile" ] && echo "$HOME/.bash_profile" || echo "$HOME/.bashrc" ) \
|
||||
&& echo 'export MODULAR_HOME="'$HOME'/.modular"' >> "$BASHRC" \
|
||||
&& echo 'export PATH="'$MAX_PATH'/bin:$PATH"' >> "$BASHRC" \
|
||||
&& source "$BASHRC"
|
||||
```
|
||||
|
||||
要检查您当前的Mojo版本,请使用`--version`选项:
|
||||
```sh
|
||||
mojo --version
|
||||
```
|
||||
|
||||
要升级到最新的Mojo版本,请使用`modular update`命令:
|
||||
```sh
|
||||
modular update mojo
|
||||
```
|
||||
### 更新Modular CLI[](https://mojocn.org/mojo/manual/getstarted/getmojo.html#%E6%9B%B4%E6%96%B0modular-cli)
|
||||
运行以下命令在您的系统上更新CLI。
|
||||
```sh
|
||||
sudo apt update
|
||||
sudo apt install modular
|
||||
```
|
||||
120
开发文档/python/pycryptodome.md
Normal file
120
开发文档/python/pycryptodome.md
Normal file
@@ -0,0 +1,120 @@
|
||||
# pycryptodome模块
|
||||
|
||||
1. 安装
|
||||
```shell
|
||||
pip3 install pycryptodome
|
||||
```
|
||||
|
||||
2. 对称加密
|
||||
+ 流密码Salsa20
|
||||
> 最自然的密码:它们一次加密一个字节的数据
|
||||
+ 块密码AES
|
||||
> 只能对固定数量的数据进行操作的密码。最重要的块密码是AES,其块大小为128位(16字节)。通常,块密码通常仅与操作模式一起使用,该操作模式允许加密可变数量的数据。某些模式(如 CTR)可以有效地将块密码转换为流密码。
|
||||
3. 操作模式
|
||||
+ CBC
|
||||
> 创建一个新的 CBC 对象,使用<算法>作为基本块密码。
|
||||
参数:
|
||||
密钥(数据类型:字节) – 加密密钥
|
||||
模式 – 常量Crypto.Cipher.<algorithm>.MODE_CBC
|
||||
iv(数据类型:字节) – 初始化向量。对手无法预知的一段数据。它与块大小一样长(例如,AES为16字节)。如果不存在,则库将创建一个随机 IV 值。
|
||||
4. 流密码Salsa20用法示例
|
||||
```python
|
||||
# 加密方法
|
||||
from Crypto.Cipher import Salsa20
|
||||
plaintext = b'Attack at dawn'
|
||||
secret = b'*Thirty-two byte (256 bits) key*'
|
||||
cipher = Salsa20.new(key=secret)
|
||||
msg = cipher.nonce + cipher.encrypt(plaintext)
|
||||
|
||||
# 解密方法
|
||||
from Crypto.Cipher import Salsa20
|
||||
secret = b'*Thirty-two byte (256 bits) key*'
|
||||
msg_nonce = msg[:8]
|
||||
ciphertext = msg[8:]
|
||||
cipher = Salsa20.new(key=secret, nonce=msg_nonce)
|
||||
plaintext = cipher.decrypt(ciphertext)
|
||||
```
|
||||
|
||||
5. 块密码AES的CBC模式用法示例
|
||||
```python
|
||||
# 加密方法
|
||||
import json
|
||||
from base64 import b64encode
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.Util.Padding import pad
|
||||
from Crypto.Random import get_random_bytes
|
||||
data = b"secret"
|
||||
key = get_random_bytes(16)
|
||||
cipher = AES.new(key, AES.MODE_CBC)
|
||||
ct_bytes = cipher.encrypt(pad(data, AES.block_size))
|
||||
iv = b64encode(cipher.iv).decode('utf-8')
|
||||
ct = b64encode(ct_bytes).decode('utf-8')
|
||||
result = json.dumps({'iv':iv, 'ciphertext':ct})
|
||||
print(result)
|
||||
'{"iv": "bWRHdzkzVDFJbWNBY0EwSmQ1UXFuQT09", "ciphertext": "VDdxQVo3TFFCbXIzcGpYa1lJbFFZQT09"}'
|
||||
|
||||
# 解密方法
|
||||
import json
|
||||
from base64 import b64decode
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.Util.Padding import unpad
|
||||
# We assume that the key was securely shared beforehand
|
||||
try:
|
||||
b64 = json.loads(json_input)
|
||||
iv = b64decode(b64['iv'])
|
||||
ct = b64decode(b64['ciphertext'])
|
||||
cipher = AES.new(key, AES.MODE_CBC, iv)
|
||||
pt = unpad(cipher.decrypt(ct), AES.block_size)
|
||||
print("The message was: ", pt)
|
||||
except (ValueError, KeyError):
|
||||
print("Incorrect decryption")
|
||||
|
||||
|
||||
## 用于数据字节不够时自动填充数据
|
||||
```python
|
||||
# 导入模块
|
||||
from Crypto.Util.Padding import pad,unpad
|
||||
# 自动填充
|
||||
AES.new(key, AES.MODE_CBC).encrypt(pad(data, AES.block_size))
|
||||
# 去除填充
|
||||
AES.new(key, AES.MODE_CBC).encrypt(pad(data, AES.block_size))
|
||||
```
|
||||
## 加密数据填充示例
|
||||
```python
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.Util.Padding import pad, unpad
|
||||
from Crypto.Random import get_random_bytes
|
||||
# 假设key是一个16字节的密钥
|
||||
key = get_random_bytes(16) cipher = AES.new(key, AES.MODE_CBC)
|
||||
# 需要加密的数据
|
||||
data = b"This is some data to encrypt"
|
||||
# 使用PKCS7进行填充
|
||||
padded_data = pad(data, AES.block_size)
|
||||
# 加密填充后的数据
|
||||
encrypted_data = cipher.encrypt(padded_data)
|
||||
# 你现在可以存储或发送 encrypted_data 和 cipher.iv (初始化向量) # ... # 解密时,你需要使用相同的初始化向量和密钥
|
||||
decipher = AES.new(key, AES.MODE_CBC, iv=cipher.iv)
|
||||
decrypted_padded_data = decipher.decrypt(encrypted_data)
|
||||
# 移除填充
|
||||
decrypted_data = unpad(decrypted_padded_data, AES.block_size)
|
||||
# decrypted_data 现在应该与原始数据相同
|
||||
print(decrypted_data)
|
||||
```
|
||||
## 生成随机秘钥
|
||||
```python
|
||||
# 导入模块
|
||||
from Crypto.Random import get_random_bytes
|
||||
# 用法
|
||||
get_random_bytes(16)
|
||||
|
||||
```
|
||||
## 数据转换内置库
|
||||
```python
|
||||
# 二进制数据与十六进制数据互相转换的库
|
||||
from binascii import a2b_hex,b2a_hex
|
||||
# 将字符串转换为二进制
|
||||
a2b_hex('abcdef1234')
|
||||
|
||||
# 将二进制数据转换为base64编码的二进制数据
|
||||
from base64 import b64encode,b64decode
|
||||
```
|
||||
36
开发文档/python/python库用途.md
Normal file
36
开发文档/python/python库用途.md
Normal file
@@ -0,0 +1,36 @@
|
||||
## 自动化相关
|
||||
### PySimpleGUI
|
||||
```
|
||||
用途:提供一些弹窗等界面
|
||||
安装pip install pysimplegui
|
||||
导入import PySimpleGUI
|
||||
```
|
||||
|
||||
## 日志
|
||||
### loguru
|
||||
```
|
||||
安装pip install loguru
|
||||
导入from loguru import logger
|
||||
```
|
||||
|
||||
## 数据处理
|
||||
### pyechart
|
||||
```
|
||||
可以做echart图片.得到一个html图表文件
|
||||
```
|
||||
### pybi-next
|
||||
```
|
||||
安装pip install pybi-next
|
||||
导入import pybi
|
||||
```
|
||||
|
||||
## 工具
|
||||
### codon
|
||||
```
|
||||
将python代码转为本地机器码,提高运行速度
|
||||
**https://github.com/exaloop/codon**
|
||||
```
|
||||
### httpx
|
||||
```
|
||||
网络请求库
|
||||
```
|
||||
1488
开发文档/python/python教程.md
Normal file
1488
开发文档/python/python教程.md
Normal file
File diff suppressed because it is too large
Load Diff
82
开发文档/python/selenium浏览器自动化.md
Normal file
82
开发文档/python/selenium浏览器自动化.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# 使用示例
|
||||
```python
|
||||
import requests
|
||||
import time
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.options import Options # 浏览器参数
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
chrome_option=Options()
|
||||
# 设置浏览器参数
|
||||
# chrome_option.add_argument('--headless') # 不显示图形界面,俗称无头模式
|
||||
chrome_option.add_argument("--disable-gpu") # windows系统使用
|
||||
# chrome_option.add_argument("--remote-debugging-port=9000")
|
||||
driver=webdriver.Chrome(options=chrome_option)
|
||||
# 设置网页超时时间
|
||||
driver.set_page_load_timeout(60)
|
||||
|
||||
host="https://ag.dji.com/cn/t60/specs"
|
||||
# 打开指定的网页
|
||||
driver.get(host)
|
||||
|
||||
# 等待指定元素加载完成
|
||||
WebDriverWait(driver, 10).until(
|
||||
EC.visibility_of_element_located((By.ID, "player_if"))
|
||||
|
||||
)
|
||||
|
||||
# 使用 Fluent Waits 等待元素变得可见
|
||||
element = FluentWait(driver, timeout=10, poll_frequency=1).until(
|
||||
EC.visibility_of_element_located((By.ID, "myElement"))
|
||||
)
|
||||
|
||||
# 使用js等待页面加载完成
|
||||
wait_for_page_load = lambda: driver.execute_script("return document.readyState") == "complete"
|
||||
driver.implicitly_wait(10) # 设置隐式等待时间
|
||||
while not wait_for_page_load():
|
||||
pass
|
||||
|
||||
# 使用路径查找指定的div元素的第一个内容
|
||||
parameter=driver.find_element(By.XPATH,"/html/body/div[1]/div/div/div[2]/div[2]/section/div/div/div[2]/div/div/div[2]/div/div")
|
||||
# 输出该元素包含的所有文本内容
|
||||
print(parameter.text)
|
||||
# 获取该元素的子属性
|
||||
print(parameter.get_attribute("id"))
|
||||
|
||||
# 使用路径查找指定的div元素的所有内容,需遍历结果
|
||||
parameters=driver.find_elements(By.XPATH,"/html/body/div[1]/div/div/div[2]/div[2]/section/div/div/div[2]/div/div/div[2]/div/div")
|
||||
for i in parameters:
|
||||
tit=i.find_elements(By.TAG_NAME, "h4")
|
||||
# 多重遍历
|
||||
for j in tit:
|
||||
print(j.text)
|
||||
# print(i.text)
|
||||
|
||||
# 以下是查找元素的其他方法,find_element是单数,find_elements是复数,结果是列表
|
||||
# 使用标签名称查找
|
||||
element = driver.find_element(By.TAG_NAME, "h3")
|
||||
# 使用id名查找
|
||||
element = driver.find_element(By.ID, "element_id")
|
||||
# 使用name名查找
|
||||
element = driver.find_element(By.NAME, "element_name")
|
||||
# 使用xpath路径查找
|
||||
element = driver.find_element(By.XPATH, "xpath_expression")
|
||||
# 使用链接文本查找
|
||||
element = driver.find_element(By.LINK_TEXT, "link text")
|
||||
# 查找包含特定文本的链接
|
||||
element = driver.find_element(By.PARTIAL_LINK_TEXT, "partial link text")
|
||||
# 使用class类名查找
|
||||
element = driver.find_element(By.CLASS_NAME, "class_name")
|
||||
# 使用css选择器查找元素
|
||||
element = driver.find_element(By.CSS_SELECTOR, "css_selector")
|
||||
|
||||
|
||||
# 刷新网页
|
||||
driver.refush()
|
||||
|
||||
# 关闭网页,如果只有一个页面,执行后等同于driver.quit()
|
||||
driver.close()
|
||||
|
||||
# 关闭浏览器
|
||||
driver.quit()
|
||||
```
|
||||
123
开发文档/python/代码片段.md
Normal file
123
开发文档/python/代码片段.md
Normal file
@@ -0,0 +1,123 @@
|
||||
|
||||
# postgresql数据库连接
|
||||
```python
|
||||
import psycopg2 as pg
|
||||
def db_conn(sql,query=None):
|
||||
try:
|
||||
conn = pg.connect(database='video_data',user='videos',password='Vi2023**',host='124.71.39.185',port='9900')
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(sql)
|
||||
conn.commit()
|
||||
# res = cursor.fetchall()
|
||||
if sql[:6]=="SELECT" and query == 0:
|
||||
# 返回所有查询结果
|
||||
return cursor.fetchall()
|
||||
if sql[:6] == "SELECT" and query == 1:
|
||||
# 返回1条查询结果
|
||||
return cursor.fetchone()
|
||||
else:
|
||||
return True
|
||||
except pg.DatabaseError as e:
|
||||
# conn.rollback()
|
||||
print(f'DB_ERROR: {e}')
|
||||
return False
|
||||
finally:
|
||||
if conn:
|
||||
conn.close()
|
||||
sql='select * from table_name;'
|
||||
db_conn(sql)
|
||||
```
|
||||
# 随机字符串生成
|
||||
```python
|
||||
# 秘钥生成器
|
||||
import random
|
||||
str1 = '0123456789'
|
||||
str2 = 'abcdefghijklmnopqrstuvwxyz'
|
||||
str3 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
str4 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
def auto_key(number):
|
||||
'''number:生成的字符串位数'''
|
||||
# 设置随机数种子
|
||||
random.seed(random.randint(1,1000))
|
||||
str=''
|
||||
for i in range(number):
|
||||
str+=random.choice(str4)
|
||||
print(str)
|
||||
return str
|
||||
auto_key(24)
|
||||
|
||||
```
|
||||
# 列出主机的音频设备信息
|
||||
```python
|
||||
import pyaudio
|
||||
|
||||
p = pyaudio.PyAudio()
|
||||
for i in range(p.get_device_count()):
|
||||
d_info=p.get_device_info_by_index(i)
|
||||
print(d_info)
|
||||
```
|
||||
# 音频录制
|
||||
```python
|
||||
import pyaudio
|
||||
import os
|
||||
from pydub import AudioSegment
|
||||
|
||||
buffer = 1024
|
||||
bits = pyaudio.paInt16
|
||||
channel = 2
|
||||
hz = 48000
|
||||
sour_path = "D:\\3-option\\music\\"
|
||||
record_second = 10
|
||||
|
||||
# 实例化PyAudio对象
|
||||
p = pyaudio.PyAudio()
|
||||
# 使用立体声混音(录制扬声器的声音)
|
||||
# stream = p.open(rate=hz,channels=channel,format=bits,input=True,frames_per_buffer=buffer,input_device_index=11)
|
||||
# 选择录音设备,这里我们选择麦克风
|
||||
stream = p.open(format=bits,
|
||||
channels=channel,
|
||||
rate=hz,
|
||||
input=True,
|
||||
frames_per_buffer=buffer,
|
||||
input_device_index=1)
|
||||
|
||||
# 从麦克风直接录制FLAC格式音频
|
||||
audio = AudioSegment.empty()
|
||||
|
||||
def record_audio():
|
||||
for i in range(0, int(hz * record_second / buffer)):
|
||||
data = stream.read(buffer)
|
||||
audio += AudioSegment(data, sample_width=p.get_sample_size(bits), frame_rate=hz, channels=channel)
|
||||
return audio
|
||||
|
||||
audio = record_audio()
|
||||
audio.export("f:\\music\\test.flac", format="flac")
|
||||
|
||||
# 关闭流和PyAudio对象
|
||||
stream.stop_stream()
|
||||
stream.close()
|
||||
p.terminate()
|
||||
|
||||
```
|
||||
# 音频格式转换
|
||||
```python
|
||||
import os
|
||||
from pydub import AudioSegment
|
||||
def convert(file_name,file_format):
|
||||
AudioSegment.from_file(audio_file_path)
|
||||
audio.export(path2+i.replace(file_name.spilt('.')[1], file_format), format=file_format)
|
||||
def batch_convert(**kwargs):
|
||||
'''source_path: 源文件路径,destination_path: 目标文件路径, file_format: 要转换的文件格式'''
|
||||
source_path = kwargs['source_path']
|
||||
destination_path = kwargs['destination_path']
|
||||
file_format = kwargs['file_format']
|
||||
for i in os.listdir(source_path):
|
||||
try:
|
||||
convert(file_name=i,file_format=file_format)
|
||||
except:
|
||||
print(i,'转换失败!')
|
||||
source_path = "D:\\10-百果园-工作资料\\01-常用音乐\\"
|
||||
destination_path="D:\\10-百果园-工作资料\\new\\"
|
||||
file_format = 'flac'
|
||||
batch_convert(source_path=source_path,destination_path=destination_path,file_format=file_format)
|
||||
```
|
||||
102
开发文档/python/后端/Flask用法简单示例.md
Normal file
102
开发文档/python/后端/Flask用法简单示例.md
Normal file
@@ -0,0 +1,102 @@
|
||||
# 示例app.py文件
|
||||
```shell
|
||||
# 需要安装的库
|
||||
pip install flask flask_cors ulid flask_sslify
|
||||
```
|
||||
```python
|
||||
# 项目根目录文件包含:templates,static
|
||||
# templates文件包含模板页.static包含静态文件,如:js,css文件,图片视频等.
|
||||
# 文件名app.py
|
||||
# 文件路径:/app.py
|
||||
# 运行环境python3.7以上版本
|
||||
|
||||
from flask import Flask, render_template, request, url_for, make_response
|
||||
from flask_cors import *
|
||||
from OpenSSL import SSL
|
||||
from flask_sslify import SSLify
|
||||
import json
|
||||
|
||||
# 创建flask应用
|
||||
app = Flask(__name__)
|
||||
# 解决跨域问题
|
||||
CORS(app, supports_credentials=True)
|
||||
# 使用https
|
||||
sslify=SSLify(app)
|
||||
# 测试数据
|
||||
data={
|
||||
'appid':'123456',
|
||||
'secret':'123456',
|
||||
'js_code':'123456',
|
||||
'grant_type':'authorization_code'
|
||||
}
|
||||
# 不指定请求方式,返回json数据或字符串
|
||||
@app.route('/page1')
|
||||
def get_cj_name():
|
||||
return json.dumps(data)
|
||||
|
||||
# 指定请求方式,可指定多个以列表字符串形式
|
||||
@app.route('/page2',methods=['POST','OPTIONS'])
|
||||
def registrationInfo():
|
||||
# 返回模板html和数据
|
||||
return render_template('page2.html',data=data)
|
||||
|
||||
if __name__ == '__main__':
|
||||
# 使用https协议
|
||||
#app.run(host='127.0.0.1',port=443,ssl_context=(example.pem,example.key),debug=False)
|
||||
# 使用http协议
|
||||
app.run(host='127.0.0.1', port=5000, debug=True)
|
||||
```
|
||||
# 示例template页
|
||||
```html
|
||||
<!--
|
||||
文件名:template.html
|
||||
文件路径:/templates/template.html
|
||||
用途:用于页面使用同样的header或footer
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
|
||||
<title>{% block title%}example标题{% endblock %} </title>
|
||||
<!-- 新 Bootstrap5 核心 CSS 文件 -->
|
||||
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css">
|
||||
<!-- 页面中引用static文件的方法,使用url_for('static',filename='文件在static的路径')-->
|
||||
<link rel="stylesheet" href="{{ url_for('static',filename='style.css') }}">
|
||||
<!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
|
||||
<script src="https://cdn.staticfile.org/popper.js/2.9.3/umd/popper.min.js"></script>
|
||||
<!-- 最新的 Bootstrap5 核心 JavaScript 文件 -->
|
||||
<script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.min.js"></script>
|
||||
|
||||
{% block head %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body scroll="no">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
# 示例内容页
|
||||
```html
|
||||
<!-- 导入模板页 -->
|
||||
{% extends 'template.html' %}
|
||||
|
||||
<!-- content和footer等名字可以自定义,需要和模板页的名字对应即可 -->
|
||||
{% block content %}
|
||||
这里的内容会添加到模板页content处
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
这里的内容会添加到模板页footer处
|
||||
{% endblock %}
|
||||
|
||||
```
|
||||
# 模板数据
|
||||
```html
|
||||
|
||||
```
|
||||
18
开发文档/python/机器学习/AI大模型.md
Normal file
18
开发文档/python/机器学习/AI大模型.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Mixtral AI -8x22B模型
|
||||
```
|
||||
# bt下载链接
|
||||
magnet:?xt=urn:btih:9238b09245d0d8cd915be09927769d5f7584c1c9&dn=mixtral-8x22b&tr=udp%3A%2F%2Fopen.demonii.com%3A1337%2Fannounce&tr=http%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce
|
||||
```
|
||||
|
||||
# Databricks-DBRX-132B
|
||||
```
|
||||
4 块英伟达 H100 GPU 运行
|
||||
```
|
||||
|
||||
# 昆仑万维-天工4.0 - 400B
|
||||
```
|
||||
Skywork-13B模型下载地址
|
||||
https://modelscope.cn/organization/skywork
|
||||
```
|
||||
|
||||
xAI-Grok1-314B
|
||||
521
开发文档/python/机器学习/stablediffusion.md
Normal file
521
开发文档/python/机器学习/stablediffusion.md
Normal file
@@ -0,0 +1,521 @@
|
||||
# sd-webui使用
|
||||
## 启动参数
|
||||
```sh
|
||||
set PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:32
|
||||
python webui.py --medvram --lowvram --xformers --upcast-sampling --no-half --disable-nan-check --always-batch-cond-uncond
|
||||
|
||||
### GPU低内存运行添加参数
|
||||
python webui.py --medvram --lowvram --always-batch-cond-uncond --xformers
|
||||
### 关闭单精度浮点数检查参数
|
||||
--no-half --disable-nan-check
|
||||
|
||||
--disable-safe-unpickle
|
||||
|
||||
|
||||
使用 OR 可选依赖项将许多卡上的 GPU 内存使用量减少一半。
|
||||
--opt-sdp-no-mem-attention--xformers
|
||||
如果您有 4GB 显存,并且想要制作 ~1.3 倍大的图像,请使用 。
|
||||
--medvram
|
||||
如果您有 4GB VRAM,但出现内存不足错误,请改用。
|
||||
--medvram--lowvram --always-batch-cond-uncond
|
||||
如果您有 4GB VRAM,并且想要使图像大于使用 ,请使用 。
|
||||
--medvram--lowvram
|
||||
如果您有 4GB VRAM,并且在加载全权重模型时出现内存不足错误,请使用(在 v1.6.0 中添加)
|
||||
--disable-model-loading-ram-optimization
|
||||
|
||||
显卡 某些 GPU 视频卡不支持半精度:可能会出现绿色或黑色屏幕,而不是生成的图片。用。如果您正在使用,这应该与此堆叠。 如果仍未修复,请在 VRAM 使用量显著增加时使用命令行参数,这可能需要 .
|
||||
--upcast-sampling --xformers --precision full --no-half --medvram
|
||||
|
||||
NVIDIA 16XX 和 10XX 卡应使用 --upcast-sampling 和 --xformers 以同等速度运行。如果问题仍然存在,请尝试在 fp32 中运行 vae 如果失败,您将不得不回退到运行 ,这将是最慢的 + 使用最多的 gpu 内存。
|
||||
--no-half-vae--no-half
|
||||
```
|
||||
## Tiled Diffusion(分块扩散)
|
||||
```
|
||||
当生成之前或之后看到CUDA内存不足错误时,请降低 tile 大小
|
||||
当您使用的 tile 太小且图片变得灰暗和不清晰时,请启用编码器颜色修复。
|
||||
从图中可以看到如何将图像分割成块。
|
||||
在每个步骤中,潜在空间中的每个小块都将被发送到 Stable Diffusion UNet。
|
||||
小块一遍遍地分割和融合,直到完成所有步骤。
|
||||
块要多大才合适?
|
||||
较大的块大小将提升处理速度,因为小块数量会较少。
|
||||
然而,最佳大小取决于您的模型。SD1.4仅适用于绘制512 * 512图像(SD2.1是768 * 768)。由于大多数模型无法生成大于1280 * 1280的好图片。因此,在潜在空间中将其除以8后,你将得到64-160。
|
||||
因此,您应该选择64-160之间的值。
|
||||
个人建议选择96或128以获得更快的速度。
|
||||
重叠要多大才合适?
|
||||
重叠减少了融合中的接缝。显然,较大的重叠值意味着更少接缝,但会显著降低速度,因为需要重新绘制更多的小块。
|
||||
与 MultiDiffusion 相比,Mixture of Diffusers 需要较少的重叠,因为它使用高斯平滑(因此可以更快)。
|
||||
个人建议使用 MultiDiffusion 时选择32或48,使用 Mixture of Diffusers 选择16或32
|
||||
放大算法(Upscaler) 选项将在图生图(img2img)模式中可用,你可选用一个合适的前置放大器。
|
||||
```
|
||||
## 提高分辨率
|
||||
```
|
||||
提高分辨率的推荐参数
|
||||
采样器(Sampler) = Euler a,步数(steps) = 20,去噪强度(denoise) = 0.35,方法(method) = Mixture of Diffusers,潜变量块高和宽(Latent tile height & width) = 128,重叠(overlap) = 16,分块批处理规模(tile batch size)= 8(如果 CUDA 内存不足,请减小块批量大小)。
|
||||
支持蒙版局部重绘(mask inpaint)
|
||||
如果你想保留某些部分,或者 Tiled Diffusion 给出的结果很奇怪,只需对这些区域进行蒙版。
|
||||
所用的模型很重要
|
||||
MultiDiffusion 与 highres.fix 的工作方式非常相似,因此结果非常取决于你所用的模型。
|
||||
一个能够绘制细节的模型可以为你的图像添加惊人的细节。
|
||||
使用完整的模型而不是剪枝版(pruned)模型可以产生更好的结果。
|
||||
不要在主提示语中包含任何具体对象,否则结果会很糟糕。
|
||||
只需使用像“highres, masterpiece, best quality, ultra-detailed 8k wallpaper, extremely clear”之类的词语。
|
||||
如果你喜欢,可以使用区域提示语控制来控制具体对象。
|
||||
不需要使用太大的块大小、过多的重叠和过多的降噪步骤,否则速度会非常慢。
|
||||
提示词相关性(CFG scale)可以显著影响细节
|
||||
较大的提示词相关性(例如 14)可以提供更多的细节。
|
||||
你可以通过0.1 - 0.6 的降噪强度来控制你想要多大程度地改变原始图像.
|
||||
```
|
||||
# sd-webui插件
|
||||
|
||||
## After Detailer/人脸修复
|
||||
```
|
||||
After Detailer 这是一款非常强大的、专门针对人脸进行修复的插件,可以解决生成全身图时人物面部扭曲/模糊的问题。
|
||||
https://github.com/Bing-su/adetailer.git
|
||||
```
|
||||
|
||||
## 提示词翻译:sd-webui-prompt-all-in-one
|
||||
```
|
||||
这一款插件提供提示词的翻译功能,这对于多语言用户群体来说非常有帮助。
|
||||
https://github.com/Physton/sd-webui-prompt-all-in-one.git
|
||||
```
|
||||
## 抠图工具:sd-webui-segment-anything
|
||||
```
|
||||
抠图工具,可以帮助用户从背景中分离出想要的对象。
|
||||
```
|
||||
## 视频转图片:sd-webui-IS-NET-pro
|
||||
```
|
||||
这个插件可以将视频转换成一系列图片,对于想要从视频中提取静态帧并进行编辑的用户来说非常有用。
|
||||
```
|
||||
## 转换模型格式:sd-webui-model-converter
|
||||
```
|
||||
用于转换模型格式的插件,这可能对于将模型部署到不同的环境或软件中非常有用。
|
||||
```
|
||||
## 宽高比选择器:Aspect Ratio selector
|
||||
```
|
||||
它可能快速的根据不同的分辨率的比例在调整宽高。不需要我们挨个的调整长宽了。
|
||||
https://github.com/alemelis/sd-webui-ar.git
|
||||
```
|
||||
## SDXL 1.0 的风格选择器:SDXL 1.0
|
||||
```
|
||||
它能够支持通过选择出图风格自动生成对应风格的图。
|
||||
|
||||
```
|
||||
## C站模型直接下载:Civitai Helper
|
||||
```
|
||||
这个插件允许我们直接在 webui 上搜索/下载 C 站上的模型,并且直接安装在合适的位置。
|
||||
https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper.git
|
||||
```
|
||||
## 区域提示器:Regional Prompter
|
||||
```
|
||||
区域提示器允许我们将图像分成几个部分并为每个部分设置独特的提示词。提供了极大的灵活性:比如可以准确定位对象并为图像的某些部分选择特定颜色,而无需更改其余部分。
|
||||
```
|
||||
|
||||
## 高清放大神器:Ultimate SD Upscale
|
||||
```
|
||||
小显存的福音,高清放大后不用在担心爆显存了
|
||||
https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git
|
||||
```
|
||||
|
||||
## StableSR / 图片高清放大
|
||||
```
|
||||
StableSR 可以放大写实、动漫、摄影等各种类型的图像,并在不修改人物面部特征的前提下,为画面添加更丰富的细节,让锐度有明显提升,很适合用来制作高清图像。
|
||||
https://github.com/pkuliyi2015/sd-webui-stablesr.git
|
||||
|
||||
将图片导入图生图
|
||||
DPM++ SDE Karras
|
||||
重绘幅度:0.01-0.2
|
||||
(如果不开启 control幅度不要太高)
|
||||
Ultimate SD upscale
|
||||
Scale from image size:2(进行2次高清放大,可以得到4k图)
|
||||
R-ESRGAN 4x如果同时开启Tneart realistic重绘幅度建议:0.2
|
||||
```
|
||||
## 画布缩放:Canvas Zoom
|
||||
```
|
||||
当我们在使用局部重绘的时候,画布的编辑非常头疼,体验很差。
|
||||
Canvas Zoom 画布缩放 可以非常方便的支持我们的日常操作,缩放、全屏、画笔调整等。
|
||||
```
|
||||
## 图片浏览器:Image Browser
|
||||
```
|
||||
Stable Diffusion 默认不支持通过在页面上查看历史出图的记录,想要查看历史图片,只能在电脑文件夹里面慢慢找。
|
||||
Image Browser | 图片浏览器 允许我们直接在 webui 上直接查看历史图片。
|
||||
https://github.com/yfszzx/stable-diffusion-webui-images-browser.git
|
||||
```
|
||||
|
||||
## 关键词反推:Wd14 Tagger
|
||||
```
|
||||
Wd14 Tagger 插件可以从上传的图像中识别并提取内容关键词,方便我们生成类似的图像。安装完成后上传一张图像,然后选择一个反推模型(一般使用 wd14-vit-v2.git ),点击 Interregats 进行反推,就能得到关于图像的一组提示,并显示每个关键词的相关性权重。
|
||||
https://github.com/toriato/stable-diffusion-webui-wd14-tagger.git
|
||||
```
|
||||
## ControlNet
|
||||
```
|
||||
https://github.com/Mikubill/sd-webui-controlnet
|
||||
```
|
||||
## AddNet
|
||||
```
|
||||
https://github.com/kohya-ss/sd-webui-additional-networks.git
|
||||
```
|
||||
## 防止爆显存:Tiled VAE
|
||||
```
|
||||
如果我们的电脑配置不够,GPU比较小,那么在生成分辨率稍微大一点的图像就会带不动,出现错误提示,而启用 Tiled VAE 插件后,它会先生成一个个小的图块,然后拼合在一起形成高分辨率图像,这样就有效防止爆显存情况的出现,不过生成时间会更长一些
|
||||
https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git
|
||||
```
|
||||
## 精准控制物体颜色:Cut Off
|
||||
```
|
||||
在使用 AI 绘画时,如果提示词中设定的颜色过多,很容易出现不同物体之间颜色混杂的情况,Cut off 插件能很好的帮我们解决这个问题,让画面中物体的颜色不会相互污染。
|
||||
https://github.com/hnmr293/sd-webui-cutoff.git
|
||||
```
|
||||
## 背景移除:Remove Background
|
||||
```
|
||||
这个插件可以快速的删除图像的无用背景。
|
||||
https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg.git
|
||||
```
|
||||
## 艺术二维码:sd-webui-qrcode-toolkit
|
||||
```
|
||||
二维码美化工具,可以一键生成超具有艺术气息的二维码。
|
||||
远比传统二维码好看,效果非常惊艳,还能私人定制个人二维码。
|
||||
```
|
||||
|
||||
## 提示词库:sd-webui-oldsix-prompt
|
||||
```
|
||||
提供提示词功能,上千个提示词,可能帮助用户更好地指导图像生成的方向。
|
||||
https://github.com/thisjam/sd-webui-oldsix-prompt.git
|
||||
```
|
||||
## 双语对照插件
|
||||
```
|
||||
https://github.com/journey-ad/sd-webui-bilingual-localization
|
||||
```
|
||||
## 简体中文语言包
|
||||
```
|
||||
https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN
|
||||
https://github.com/VinsonLaro/stable-diffusion-webui-chinese
|
||||
```
|
||||
## 提示词自动补齐插件:Tag Complete
|
||||
```
|
||||
使用这个插件可以直接输入中文,调取对应的英文提示词。并且能够根据未写完的英文提示词提供补全选项,在键盘上按↓箭头选择,按 enter 键选中
|
||||
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git
|
||||
```
|
||||
|
||||
# 提示词
|
||||
## **Prompt格式优化**
|
||||
```
|
||||
第一段:画质tag,画风tag
|
||||
第二段:画面主体,主体强调,主体细节概括(主体可以是人、事、物、景)画面核心内容
|
||||
第三段:画面场景细节,或人物细节,embedding tag。画面细节内容
|
||||
第二段一般提供人数,人物主要特征,主要动作(一般置于人物之前),物体主要特征,主景或景色框架等
|
||||
```
|
||||
## 模型权重
|
||||
```
|
||||
(tag):增加权重5%
|
||||
[tag]:降低权重5%
|
||||
(tag:0~2):设置具体权重
|
||||
[tag1|tag2]:将tag1和tag2混合
|
||||
{tag1|tag2|tag3}:从标签中随机选择一个
|
||||
[tag:tag2:0.5]:表示先用tag1生成50%后,该用tag2生成,如果是整数,就是生成tag1,n步长之后改用tag2
|
||||
|
||||
lora模型引用
|
||||
放在提示语最开头
|
||||
<lora:模型名称:占用比重0~1>
|
||||
```
|
||||
## 正向提示词
|
||||
```
|
||||
<lora:lora_file_name:0.7>,
|
||||
```
|
||||
|
||||
## 负面提示词
|
||||
```
|
||||
去除绘画风/简笔画/低质量/灰度图/去除雀斑痤疮等皮肤瑕疵
|
||||
paintings,sketches,(worst quality:2),(low quality:2),(normal quality:2),lowres,normal quality,((monocrome)),((grayscale)),skin spots,acnes,skin blemishes,age spot,glan
|
||||
```
|
||||
|
||||
# 采样器
|
||||
## 采样器介绍
|
||||
```markdown
|
||||
1. 经典ODE求解器
|
||||
Euler采样器:欧拉采样方法。
|
||||
Heun采样器:欧拉的一个更准确但是较慢的版本。
|
||||
LMS采样器:线性多步法,与欧拉采样器速度相仿,但是更准确。
|
||||
|
||||
2. 祖先采样器
|
||||
名称中带有a标识的采样器表示这一类采样器是祖先采样器。这一类采样器在每个采样步骤中都会向图像添加噪声,采样结果具有一定的**随机性**。
|
||||
Euler a
|
||||
DPM2 a
|
||||
DPM++ 2S a
|
||||
DPM++ 2S a Karras
|
||||
由于这一类采样器的特性,图像不会收敛。因此为了保证重现性,例如在通过多帧组合构建动画时,应当尽量避免采用具有随机性的采样器。需要注意的是,部分采样器的名字中虽然没有明确标识属于祖先采样器,但也属于随机采样器。如果希望生成的图像具有细微的变化,推荐使用variation seed进行调整。
|
||||
|
||||
3. Karras Noise Schedule
|
||||
带有Karras字样的采样器,最大的特色是使用了[Karras论文](https://link.zhihu.com/?target=https%3A//arxiv.org/abs/2206.00364)中建议的噪音计划表。主要的表现在于噪点步长在接近尾声时会更小,有助于图像的质量提升。
|
||||
|
||||
4. DDIM与PLMS(已过时,不再使用)
|
||||
DDIM(去噪扩散隐式模型)和PLMS(伪线性多步方法)是伴随Stable Diffusion v1提出的采样方法,DDIM也是最早被用于扩散模型的采样器。PLMS是DDIM的一种更快的替代方案。当前这两种采样方法都不再广泛使用。
|
||||
|
||||
5. DPM与DPM++
|
||||
DPM(扩散概率模型求解器)这一系列的采样器于2022年发布,代表了具有类似体系结构的求解器系列。
|
||||
由于DPM会自适应调整步长,不能保证在约定的采样步骤内完成任务,整体速度可能会比较慢。**对Tag的利用率较高**,在使用时建议适当放大采样的步骤数以获得较好的效果。
|
||||
DPM++是对DPM的改进,DPM2采用二阶方法,其结果**更准确**,但是相应的也会**更慢**一些。
|
||||
|
||||
6. UniPC
|
||||
UniPC(统一预测校正器),一种可以在5-10个步骤中实现高质量图像生成的方法。
|
||||
|
||||
7. K-diffusion
|
||||
用于指代Katherine Crowson's [k-diffusion](https://link.zhihu.com/?target=https%3A//github.com/crowsonkb/k-diffusion)项目中实现的[Karras 2022](https://link.zhihu.com/?target=https%3A//arxiv.org/abs/2206.00364)论文中提及的的相关采样器。当前常用的采样器中,除了DDIM、PLMS与UniPC之外的采样器均来自于k-diffusion。
|
||||
```
|
||||
## 采样器选择
|
||||
```markdown
|
||||
1. 如果只是想得到一些较为简单的结果,选用欧拉(Eular)或者Heun,并可适当减少Heun的步骤数以减少时间
|
||||
|
||||
2. 对于侧重于速度、融合、新颖且质量不错的结果,建议选择:
|
||||
DPM++ 2M Karras, Step Range:20-30
|
||||
UniPc, Step Range: 20-30
|
||||
|
||||
3. 期望得到高质量的图像,且不关心图像是否收敛:
|
||||
DPM ++ SDE Karras, Step Range:8-12
|
||||
DDIM, Step Range:10-15
|
||||
|
||||
4. 如果期望得到稳定、可重现的图像,避免采用任何祖先采样器
|
||||
|
||||
```
|
||||
|
||||
# models
|
||||
```
|
||||
models checkpoint:
|
||||
LORA:
|
||||
```
|
||||
|
||||
# 图片提示示例
|
||||
|
||||
## 丛林写真美女
|
||||
```
|
||||
<lora:FilmVelvia3:0.6>, Best portrait photography, RAW photo, 8K UHD, film grain, cinematic lighting, elegant 1girl, offshoulder dress, (natural skin texture), intricate (fishnet stockings), forest, natural pose, embellishments, cinematic texture, 35mm lens, shallow depth of field, silky long hair
|
||||
|
||||
Negative prompt: ((worst quality, low quality), bad_pictures, negative_hand-neg:1.2),
|
||||
|
||||
models checkpoint:majicMIX realistic 麦橘写实
|
||||
LORA:FilmGirl 胶片风
|
||||
Steps: 27, Size: 512x832, Seed: 2914668718, Model: majicmixRealistic_v6, Version: v1.4.0, Sampler: DPM++ 2M Karras, CFG scale: 7, Clip skip: 2, Model hash: e4a30e4607, Hires steps: 21, "FilmVelvia3: 6e93473d6228", Hires upscale: 2, Hires upscaler: R-ESRGAN 4x+, Denoising strength: 0.4
|
||||
```
|
||||
|
||||
## 性感内衣装美女
|
||||
```
|
||||
masterpiece, best quality, 1girl, blonde_hair, blue_eyes, blush, breasts, cleavage, cross_earrings, day, ear_piercing, earrings, indoors, jewelry, large_breasts long_hair, looking_at_viewer, panties, skindentation, smile, solo, thighhighs, underwear, white_panties, (in luxury bedroom:1.2), (pov:1.1), full body, white bra, standing, arms behind back
|
||||
|
||||
Negative prompt: (worst quality, low quality, normal quality:1.6), lowres, blurry, bad anatomy,
|
||||
|
||||
models checkpoint:Asian Mix
|
||||
LORA:
|
||||
Steps: 25, VAE: vae-ft-mse-840000-ema-pruned.ckpt, NGMS: 0.2, Size: 704x896, Seed: 1840280510, Model: ASIAN_MIX_FINAL_V1, Version: v1.6.0, Sampler: Euler a, VAE hash: df3c506e51, CFG scale: 7, Clip skip: 2, Model hash: 7c0b397190, ADetailer model: face_yolov8n.pt, ADetailer prompt: "masterpiece, iris blue eyes, realistic, realism,", ADetailer version: 23.11.0, Denoising strength: 0.25, ADetailer mask blur: 4, Token merging ratio: 0.2, ADetailer confidence: 0.3, ADetailer dilate erode: 4, ADetailer inpaint padding: 32, Ultimate SD upscale padding: 32, ADetailer denoising strength: 0.4, Ultimate SD upscale upscaler: 4x-UltraSharp, ADetailer inpaint only masked: True, Ultimate SD upscale mask_blur: 8, Ultimate SD upscale tile_width: 512, Ultimate SD upscale tile_height: 512
|
||||
```
|
||||
## 都市多风格漂亮美女
|
||||
```
|
||||
anime artwork ((preety portrait)), digital photo, smooth photo, beautiful girl 25 y.o. natural skin, light frecles, small thight top, very short skirt, eastern european look. little makeup, mouth wide open. Photo realistic look. glossy lipstick <lora:ReaLora:0.6> . anime style, key visual, vibrant, studio anime, highly detailed
|
||||
|
||||
Negative prompt: 2d art, 3d art, ((illustration)), anime, cartoon, bad_pictures, bad-artist, EasyNegative,(worst quality:1.6), (low quality:1.6), (normal quality:1.6), lowres, bad anatomy, bad hands, ((monochrome)), ((grayscale)), collapsed eyeshadow, multiple eyebrow, (cropped), oversaturated, extra limb, missing limbs, deformed hands, long neck, long body, imperfect, (bad hands), signature, watermark, username, artist name, conjoined fingers, deformed fingers, ugly eyes, imperfect eyes, skewed eyes, unnatural face, unnatural body, error, bad image, bad photo, photo, deformed, black and white, realism, disfigured, low contrast
|
||||
|
||||
models checkpoint:Asian Mix
|
||||
LORA:
|
||||
Steps: 20, VAE: vae-ft-mse-840000-ema-pruned.ckpt, NGMS: 0.2, Size: 704x960, Seed: 3006517226, Model: ASIAN_MIX_FINAL_V1, Version: v1.6.0, Sampler: Euler a, VAE hash: df3c506e51, CFG scale: 7, Clip skip: 2, Model hash: 7c0b397190, "easynegative: c74b4e810b03", ADetailer model: face_yolov8n.pt, ADetailer prompt: "masterpiece, iris brown eyes, realistic, ", ADetailer version: 23.11.0, Denoising strength: 0.3, ADetailer mask blur: 4, Token merging ratio: 0.2, ADetailer confidence: 0.3, ADetailer dilate erode: 4, ADetailer inpaint padding: 32, Ultimate SD upscale padding: 32, ADetailer denoising strength: 0.4, Ultimate SD upscale upscaler: 4x-UltraSharp, ADetailer inpaint only masked: True, Ultimate SD upscale mask_blur: 8, Ultimate SD upscale tile_width: 512, Ultimate SD upscale tile_height: 512
|
||||
```
|
||||
## 都市多风格漂亮美女2
|
||||
```
|
||||
masterpiece, best quality, 1girl, cute lady, high priest, (colorful),(finely detailed beautiful eyes and detailed face),cinematic lighting, bust shot, extremely detailed CG unity 8k wallpaper, white hair, solo, smile, intricate skirt,((flying petal)),(Flowery meadow) sky, cloudy_sky, building, moonlight, moon, night, dark theme, light, fantasy,
|
||||
|
||||
Negative prompt: (worst quality, low quality, normal quality:1.6), lowres, blurry, bad anatomy,
|
||||
|
||||
models checkpoint:Asian Mix
|
||||
LORA:
|
||||
Steps: 25, VAE: vae-ft-mse-840000-ema-pruned.ckpt, NGMS: 0.2, Size: 704x896, Seed: 242223120, Model: ASIAN_MIX_FINAL_V1, Version: v1.6.0, Sampler: Euler a, VAE hash: df3c506e51, CFG scale: 7, Clip skip: 2, Model hash: 7c0b397190, ADetailer model: face_yolov8n.pt, ADetailer prompt: "masterpiece, iris blue eyes, realistic, realism,", ADetailer version: 23.11.0, Denoising strength: 0.25, ADetailer mask blur: 4, Token merging ratio: 0.2, ADetailer confidence: 0.3, ADetailer dilate erode: 4, ADetailer inpaint padding: 32, Ultimate SD upscale padding: 32, ADetailer denoising strength: 0.4, Ultimate SD upscale upscaler: 4x-UltraSharp, ADetailer inpaint only masked: True, Ultimate SD upscale mask_blur: 8, Ultimate SD upscale tile_width: 512, Ultimate SD upscale tile_height: 512
|
||||
```
|
||||
|
||||
## 清纯多风格纯欲妹子
|
||||
```
|
||||
Best quality, masterpiece, ultra high res, (photorealistic:1.4), raw photo, (Authentic skin texture:1.3), (film grain:1.3), panorama, character portrait, very wide shot, half body, narrow waist, cowboy shot, in the dark, deep shadow, low key, cold light, night,
|
||||
indoor, a beam of light, dust, Tyndall effect, sad, disappointed, gloom (expression), hollow eyes, against window,
|
||||
1girl, beautiful detailed eyes and face, white jabot, off shoulder, head down, brown eyes,
|
||||
<lora:FilmgirlLora_v30:0.6> <lora:asianGirlsFace_v1:0.4:FACE>
|
||||
|
||||
Negative prompt: ng_deepnegative_v1_75t, badhandv4 (worst quality:2), (low quality:2), (normal quality:2), lowres, bad anatomy, bad hands, normal quality, ((monochrome)), ((grayscale)),lowres,badanatomy, badfoots,wrong,badfingers,text,error,missingfingers,extradigit,fewerdigits,cropped,worstquality,lowquality,normalquality,jpegartifacts,signature,watermark,usemame,blury,badfeet,futa,futanari,small_penis,yaoi,huge_breasts,large_breasts,three legs,wrong hand,wrong feet,wrong fingers,deformed leg,abnormal,malformation, nsfw,watermark, character watermark,
|
||||
|
||||
models checkpoint:majicmixRealistic_v3
|
||||
LORA:Asian girls face
|
||||
Steps: 40, ENSD: 31337, Size: 512x768, Seed: 1222752426, Model: majicmixRealistic_v3, Sampler: DPM++ 2M alt Karras, CFG scale: 7, Clip skip: 2, Hires steps: 15, Hires upscale: 2, Hires upscaler: 4x-UltraSharp, Denoising strength: 0.3
|
||||
```
|
||||
|
||||
## 可爱泳装美女
|
||||
```
|
||||
<lora:Yui_v2:1>, 20d, an asian photomodel girl, wearing leopard print lingerie in a sexy pose, long hair, lace around her leg, flake around her neck, cosplay leopard ears, leopard gloves, stockings, beautifull hands, medium breast,full body, look at viewer, (8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37), professional lighting, photon mapping, radiosity, physically-based rendering, <lora:asian_sexy_lingerie:0.4>
|
||||
|
||||
Negative prompt: bad-picture-chill-75v EasyNegative (((girls))), NG_DeepNegative_V1_75, (wierd hands, poorly drawn hands:1.2),paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers,fewer fingers,strange fingers,bad hand (low quality, worst quality:1.4), (bad_prompt:0.8), (monochrome), (greyscale)
|
||||
|
||||
models checkpoint:ChilloutMix
|
||||
LORA:Asian_sexy_lingerie
|
||||
Steps: 30, Size: 512x904, Seed: 3240473696, Model: chilloutmix_NiPrunedFp32Fix, Sampler: DPM++ SDE Karras, CFG scale: 8, Model hash: fc2511737a, Face restoration: CodeFormer
|
||||
```
|
||||
## 泳装美女
|
||||
```
|
||||
<lora:sarah-05:1>,
|
||||
good hand,4k, high-res, masterpiece, best quality, head:1.3,((Hasselblad photography)), finely detailed skin, sharp focus, (cinematic lighting), collarbone, morning, soft lighting, dynamic angle, [:(detailed face:1.2):0.2], armpit crease, thigh gap, red clothes, slender, medium breasts, cleavage,
|
||||
|
||||
Negative prompt: NG_DeepNagetive_V1_75T,(greyscale:1.2),
|
||||
paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans
|
||||
|
||||
models checkpoint:chilloutMix
|
||||
LORA:Asian Beauty Collection
|
||||
Steps: 30, Size: 512x768, Seed: 293435040, Model: chilloutmix_NiPrunedFp32Fix, Sampler: DPM++ 2M Karras, CFG scale: 7, Model hash: fc2511737a, Face restoration: CodeFormer
|
||||
```
|
||||
|
||||
## 走秀模特
|
||||
```
|
||||
girlvn01, 1girl, (smile:1.4) Stunningly Beautiful Girl, Haute_Couture, designer dress, wearing Haute_Couture, posing for a picture, fashion show, Long shaped face, angry, crazy, dark red eyes, Sandy Blonde side-swept hair, short hair, long ringlets, catwalk \(walkway\), , colorful, vivid colors, masterpiece, best quality, absurdres, highest quality, amazing details, 8k, aesthetic, <lora:girl_SDLife_Chiasedamme_v1.6:0.4> <lora:girlvn01_SDLifr_Chiasedamme_v1.0:0.6> <lora:add_detail:0.2> <lora:more_details:0.2>
|
||||
|
||||
Negative prompt: (worst quality,low quality:2), BadArtist, BadHands, badhandv4, BadImage, BadPrompt, ng_deepnegative_v1_75t
|
||||
|
||||
models checkpoint:AsianRealistic_SDLife_ChiasedammeV6.0
|
||||
LORA:Detail Tweaker LORA(细节调整LORA)
|
||||
LORA:Add More Details - Detail Enhancer/Tweaker(细节调整LORA)
|
||||
Steps: 31, Size: 512x768, Seed: 3484302777, Model: AsianRealistic_SDLife_ChiasedammeV6.0, Version: v1.4.1, Sampler: DPM++ 2M Karras, CFG scale: 7.5, Clip skip: 2, Model hash: a8852b72b2, add_detail: 7c6bad76eb54, Hires steps: 10, more_details: 3b8aa1d351ef", Hires upscale: 2, Hires upscaler: 4x-UltraSharp, ADetailer model: face_yolov8n.pt, ADetailer version: 23.6.4, Denoising strength: 0.35, ADetailer mask blur: 4, ADetailer confidence: 0.3, ADetailer dilate/erode: 4, ADetailer inpaint padding: 32, ADetailer denoising strength: 0.4, "girl_SDLife_Chiasedamme_v1.6: e0e86d42bc01, ADetailer inpaint only masked: True, girlvn01_SDLifr_Chiasedamme_v1.0: 6aa1c3353068
|
||||
```
|
||||
## 性感美女
|
||||
```
|
||||
1girl, solo,(best quality),(masterpiece:1.1), dynamic angle, upper body, looking_at_viewer, small breast, cute, clear facial skin,
|
||||
|
||||
Negative prompt: EasyNegative, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers,fewer fingers,, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans, (only body)
|
||||
|
||||
models checkpoint:chilloutMix
|
||||
LORA:Asian Cute Face
|
||||
Steps: 20, Size: 384x512, Seed: 2095757859, Model: Chilloutmix-Ni, Sampler: DPM++ SDE Karras, CFG scale: 7, Model hash: 7234b76e42, Hires upscale: 2, AddNet Enabled: True, AddNet Model 1: CuteAsianFace(67fccf510549), Hires upscaler: Latent, AddNet Module 1: LoRA, ControlNet Model: None, AddNet Weight A 1: 0.8, AddNet Weight B 1: 0.8, ControlNet Weight: 1, ControlNet Enabled: True, Denoising strength: 0.7, ControlNet Ending Step: 1, ControlNet Resize Mode: Crop and Resize, ControlNet Control Mode: ControlNet is more important, ControlNet Preprocessor: openpose_full, ControlNet Pixel Perfect: False, ControlNet Starting Step: 0, ControlNet Preprocessor Parameters: "(512, 100, 200)"
|
||||
```
|
||||
## 清纯妹纸
|
||||
```
|
||||
<lora:christmas_sweater_v3:0.7>,1girl,red virgin killer sweater,christmas hat,
|
||||
solo,long hair,breasts,looking at viewer,black hair,dress,sitting,full body,earrings,barefoot,blurry,black eyes,realistic,sitting on chair,
|
||||
DSLR,(Good structure),HDR,UHD,8K,A real person,Highly detailed,best quality,masterpiece,1girl,realistic,Highly detailed,(EOS R8, 50mm, F1.2, 8K, RAW photo:1.2),ultra realistic 8k,(best illumination, best shadow, extremely delicate and beautiful),(official art, beautiful and aesthetic:1.2),
|
||||
|
||||
Negative prompt: bad-hands-5 bad_prompt_version2,bhands-neg EasyNegative,ng_deepnegative_v1_75t,verybadimagenegative_v1.3,multiple breasts,(mutated hands and fingers:1.5 ),(long body :1.3),(mutation, poorly drawn :1.2),black-white,bad anatomy,liquid body,liquid tongue,disfigured,malformed,mutated,anatomical nonsense,text font ui,error,malformed hands,long neck,blurred,lowers,lowres,bad anatomy,bad proportions,bad shadow,uncoordinated body,unnatural body,fused breasts,bad breasts,huge breasts,poorly drawn breasts,extra breasts,liquid breasts,heavy breasts,missing breasts,huge haunch,huge thighs,huge calf,bad hands,fused hand,missing hand,disappearing arms,disappearing thigh,disappearing calf,disappearing legs,fused ears,bad ears,poorly drawn ears,extra ears,liquid ears,heavy ears,missing ears,fused animal ears,bad animal ears,poorly drawn animal ears,extra animal ears,liquid animal ears,heavy animal ears,missing animal ears,text,ui,error,missing fingers,missing limb,fused fingers,one hand with more than 5 fingers,one hand with less than 5 fingers,one hand with more than 5 digit,one hand with less than 5 digit,extra digit,fewer digits,fused digit,missing digit,bad digit,liquid digit,colorful tongue,black tongue,cropped,watermark,username,blurry,JPEG artifacts,signature,3D,3D game,3D game scene,3D character,malformed feet,extra feet,bad feet,poorly drawn feet,fused feet,missing feet,extra shoes,bad shoes,fused shoes,more than two shoes,poorly drawn shoes,bad gloves,poorly drawn gloves,fused gloves,bad cum,poorly drawn cum,fused cum,bad hairs,poorly drawn hairs,fused hairs,big muscles,ugly,bad face,fused face,poorly drawn face,cloned face,
|
||||
|
||||
models checkpoint:真人写实majicmixRealistic_v6
|
||||
LORA:真人清纯可爱christmas_sweater_v1
|
||||
Steps: 20, CFG scale: 7, Sampler: DPM++ 2M Karras, Seed: 3580579492
|
||||
```
|
||||
## 清纯妹子大尺度
|
||||
```
|
||||
(full body:1.2),(8k, raw photo:1.2), (hyper realistic, photo realistic:1.2), (hyper supreme extreme quality beautiful women:1.2),(supreme hyper extreme realistic skin texture:1.2), femme fatale, (1girl, solo:1.0), (beautiful quality huge eyes:1.1), (dynamic pose:1.1), (supreme beautiful girl mixed:1.2), (Kpop idol:1.2), (angular face:1.2), (supreme beauty quality huge eyes:1.2), (teenager:1.2), (erotic choker:1.2), (small breasts+skiny body:1.1), depth of field, (cinematic lighting, cinematic shadow, realistic lighting, realistic shadow:1.2), smart sharpe, hard focus, highres, uhd, completed eyes, completed face, upscaled, Crisp, presence, (sense of volume:1.2),
|
||||
|
||||
Negative prompt: (Not REAL, 2D, manga, sketch, anime, unreal, not realistic:1.1), (monochrome skin:1.2), (black hair, monochrome hair:1.1), big breasts, small eyes, ugly, lowest quality, worst quality, bad anatomy, black-white, monochrome, out of perspective, flat perspective, [네거티브 DeepNegative:0.2], lowres meat, low quality lowres gundam, low quality lowres multiple views, low quality lowres cut, low quality lowres concept art, low quality lowres reference sheet, low quality lowres turnaround, low quality lowres chart, low quality lowres comparison, low quality lowres artist progress, low quality lowres lineup, low quality lowres before and after, low quality lowres orc, low quality lowres tusks, low quality lowres goblin, low quality lowres kobold, low quality lowres pony, low quality lowres Humpbacked, low quality lowres text error, low quality lowres extra digits, low quality lowres standard quality, low quality lowres large breasts, low quality lowres shadow, low quality lowres nude, low quality lowres artist name, low quality lowres skeleton girl, low quality lowres bad legs, low quality lowres missing fingers, low quality lowres extra digit, low quality lowres artifacts, low quality lowres bad body, low quality lowres optical illusion, low quality lowres Glasses, low quality lowres girl, low quality lowres women, low quality lowres more than 1 moon, low quality lowres Multi foot, low quality lowres Multifold, low quality lowres Multi fingering, low quality lowres colored sclera, low quality lowres monster girl, low quality lowres Black hands, low quality lowres The background is incoherent, low quality lowres abnormal eye proportion, low quality lowres Abnormal hands, low quality lowres abnormal legs, low quality lowres abnormal feet abnormal fingers, low quality lowres sharp face, low quality lowres tranny, low quality lowres mutated hands, low quality lowres extra limbs, low quality lowres too many fingers, low quality lowres unclear eyes, low quality lowres bad, low quality lowres mutated hand and finger, low quality lowres malformed mutated, low quality lowres broken limb, low quality lowres incorrect limb, low quality lowres fusion finger, low quality lowres lose finger, low quality lowres multiple finger, low quality lowres multiple digit, low quality lowres fusion hand, low quality lowres lose leg, low quality lowres fused leg, low quality lowres multiple leg, low quality lowres bad cameltoe, low quality lowres colorful cameltoe, low quality lowres extra nipples, low quality lowres low polygon 3D game
|
||||
|
||||
models checkpoint:Asian girl亚洲女孩_m1228
|
||||
LORA:
|
||||
Steps: 30, Seed: 3659185283, Sampler: DPM++ SDE Karras, CFG scale: 7
|
||||
```
|
||||
|
||||
## 清纯萝莉
|
||||
```
|
||||
1girl on beach, twintails, sand, sea, wind, cloud, (wet, white_sundress, sleeveless), (best quality, masterpiece, 16k, raw photo, ultra high res:1.2), sharp focus, blurry background, close up
|
||||
|
||||
Negative prompt: easynegative, ng_deepnegative_v1_75t, badhandv4, negative_hand, (child, teen, little girl:2) ,(bad hands:2), (pubic hair:2), (bad nipples:2), (worst quality:2), (low quality:2), (normal quality:2), (lowres, bad anatomy), ((monochrome)), ((grayscale)), ((3d rendering)), watermark, logo, makeup, freckles, mole
|
||||
|
||||
models checkpoint:
|
||||
LORA:Asian cute girl mix
|
||||
Steps: 50, Sampler: DPM++ 2M Karras, CFG scale: 4
|
||||
```
|
||||
## 真人裸体美女
|
||||
```
|
||||
amateur , beautiful face, blonde woman, ((ful naked)), (playful pose), ((small breasts)), (perfect nipples), (( in a night club)) , RAW, real life photo , dramatic, atmospheric, ( at night :1.3), high quality, photo (suicide girls style) of a nude (young:0.9) twitch streamer with perfect small breasts and poofy hair, tattoo, hair moving, blowing hair, professional makeup, detailed eyes, smirk, parted lips, bokeh, dynamic pose, (realistic face, perfect eyes, eyes catchlights, perfect face:1.2, perfect hands, realistic hands), colourful hair, [[goth makeup]], winged eyeliner, perfect lips, naked, realistic, nude, no panties, realistic hands, realistic skin, fine texture, skin details, perfect figure, sexy body, dreamlike , blonde fine hairs, wearing a choker, black bands around thighs, dancing, open legs, showcasing pussy, short female pubic hair, smirking at viewer in a strip club, wrapped in stringlights, glowing ropes wrapped around her body, lasers, bright lights, hair moving, (lens_flare:1.4), wide angle lens, glow, CyberpunkAI, (low_angle:1.3), pink walls with many leds, high quality, rim light, flares, neon lights background, indoors, low light, moody light, <lora:CyberPunkAI:0.6> <lora:more_details:0.6>
|
||||
|
||||
Negative prompt: (smartphone), (child), (childish), (watermark), bad art, ugly face, messed up face, poorly drawn hands, bad hands,doll, plastic_doll, silicone, anime, cartoon, fake, 3d max, infant, featureless, colourless, impassive, shaders, bad-hands-5, ng_deepnegative_v1_75t, Unspeakable-Horrors-64v, Unspeakable-Horrors-Composition-4v, ((logo)), ((watermark)), text, (duo), distorted eyes, distorted iris, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (worst quality), (big breasts),,(((censored))), asymmetrical, fat,dialog, words, fonts, (malformed teeth), ((((ugly)))), (((duplicate))), ((morbid)), \[out of frame\], extra fingers, (((six fingers))),mutated hands, ((poorly drawn hands)),((wrong thumbs)), ((poorly drawn face)), ((missing legs)), (((extra arms))), (((extra legs))), mutated hands, ((penis)),(fused fingers), (too many fingers)
|
||||
|
||||
models: PicX_real
|
||||
Steps: 30, Size: 512x768, Seed: 4278598768, Sampler: Heun, CFG scale: 6, Clip skip: 2
|
||||
```
|
||||
|
||||
## 大尺度真人美女
|
||||
```
|
||||
(masterpiece:1.4),(best quality:1.4),beautiful,detailed eyes,extremely detailed,feminine features,perfect body,very detailed face,Depth of field,extremely detailed CG,8k,wallpaper,1girl,detailed background,shiny skin,beautiful face,(big boobs:1.3),<lora:asianGirlsFace_v1:0.4>,<lora:st louis v2 epoch 5:1>,stlouis,blue hair,(standing:1.2),expose breasts,undressing,naked,red pupils,(high heels:1.2),beautify someone 's legs,(outdoors:1.1),(the whole body:1.3),
|
||||
|
||||
Negative prompt: Paintings,sketches,(worst quality, low quality, normal quality:1.7),lowres,blurry,text,logo,((monochrome)),((grayscale)),skin spots,acnes,skin blemishes,age spot,strabismus,wrong finger,lowres,bad anatomy,bad hands,text,error,missing fingers,extra digit,fewer digits,cropped,wort quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,bad feet,(worst quality, low quality:1.4),hand,feet,foot,(dark skin:1.1),fused girls,fushion,bad-hands-5,lowres,bad anatomy,bad hands,text,error,missing fingers,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,signature,watermark,username,blurry,(bad feet:1.1),monochrome,jpeg artifacts,ugly,pregnant,vore,duplicate,morbid,mutilated,tran nsexual,hermaphrodite,long neck,mutated hands,poorly drawn hands,poorly drawn face,mutation,deformed,bad proportions,malformed limbs,extra limbs,cloned face,disfigured,gross proportions,(missing arms:1.331),(missing legs:1.331),(extra arms:1.331),(extra legs:1.331),plump,bad legs,lowres,bad anatomy,bad hands,text,error,missing fingers,extra digit,fewer digits,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,long body,lowres,bad anatomy,bad hands,missing fingers,pubic hair,extra digit,fewer digits,cropped,worst quality,low quality,lowres,bad anatomy,bad hands,text,error,missing fingers,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,extra hands,extra arms,((disfigured)),((bad art)),((deformed)),ugly face,deformed face,malformed face,extra head,easynegative,multiple girls,multiple views,Multiple Face,Simple BackGround,((((badhandv4:1.3)))),
|
||||
|
||||
models checkpoint:Dream2Reality
|
||||
LORA:st Louis(Luxurious Wheels)
|
||||
Steps: 25, Size: 512x768, Seed: 3598267831, Model: dream2reality_v10, Version: v1.4.0, Sampler: DPM++ SDE Karras, CFG scale: 7, Clip skip: 2, (big boobs: 1.2), Model hash: 3eabdd94e2, Hires steps: 15, (group photo: 1.2),lineup,imperial harem or seraglio,3 girls,4 girls,5 girls,6+girls,stand,silk stockings,cover_page,cover, "(masterpiece: 1.4), (best quality: 1.4),beautiful,detailed eyes,extremely detailed,feminine features,perfect body,very detailed face,Depth of field,extremely detailed CG,8k,wallpaper,1girl,detailed background,shiny skin,beautiful face, Hires upscale: 2, av_cover_v1.0: 0.8>,", Hires upscaler: R-ESRGAN 4x+, (multiple girls: 1.2), ADetailer model: mediapipe_face_full, ADetailer version: 23.7.11, asianGirlsFace_v1: 0.4>, "asianGirlsFace_v1: 53040ed45427, Denoising strength: 0.4, ADetailer mask blur: 4, st louis v2 epoch 5: 3818f26b5a49", ADetailer confidence: 0.3, multiple_penises_v0.4: 1>, ADetailer dilate/erode: 4, ADetailer inpaint padding: 32, ADetailer denoising strength: 0.4, ADetailer inpaint only masked: True
|
||||
```
|
||||
|
||||
## 真人全裸流浆1
|
||||
```
|
||||
(masterpiece, best quality, hires, high resolution:1.2), extremely detailed, highres, <lora:aftersex:.8>, <lora:cum_b1:.5>, woman, AFTER SEX, CUM, (((lying down))), asleep, CUMDRIP, ASS, ON STOMACH, legs spread, FUCKED SILLY, CUM in pussy, TREMBLING, blonde, on an operating table, medical equipment
|
||||
|
||||
Negative prompt: (worst quality, low quality:1.4), gaps in teeth, asymmetrical eyes, bad anatomy, bad hands, cropped, oversaturated, extra limbs, disfigured, deformed, blurry, poorly drawn face, mutation, mutated, extra limbs, ugly, poorly drawn hands, Asian-Less-Neg
|
||||
|
||||
models checkpoint:fennfoto
|
||||
LORA:Murky's-After Sex Lying LoRA
|
||||
Steps: 32, VAE: vae-ft-mse-840000-ema-pruned-new.safetensors, Size: 512x768, Seed: 3033180042, Model: fennfoto (ff2), cum_b1: 4fb65cea17d4", Version: v1.6.0, Sampler: DPM++ SDE Karras, VAE hash: 95f26a5ab0, CFG scale: 6.5, "aftersex: 11d81cc5455e, Model hash: e2a30c4ec8, Hires upscale: 2, Hires upscaler: R-ESRGAN 4x+, "Asian-Less-Neg: 22d2f003e76f", ADetailer model: face_yolov8n.pt, ADetailer prompt: asleep, ADetailer version: 23.11.1, Denoising strength: 0.27, ADetailer mask blur: 4, ADetailer model 2nd: hand_yolov8n.pt, ADetailer confidence: 0.3, ADetailer dilate erode: 4, ADetailer mask blur 2nd: 4, ADetailer confidence 2nd: 0.3, ADetailer inpaint padding: 32, ADetailer dilate erode 2nd: 4, ADetailer denoising strength: 0.4, ADetailer inpaint only masked: True, ADetailer inpaint padding 2nd: 32, ADetailer denoising strength 2nd: 0.4, ADetailer inpaint only masked 2nd: True
|
||||
```
|
||||
## 真人全裸流浆2
|
||||
```
|
||||
ultra realistic 8k cg, 8k,picture-perfect face, flawless, clean,nsfw, {{masterpiece}},best quality, beautiful lighting, Intricate, High Detail, depth of field, film grain, artbook,dramatic, incredibly,absurdres,
|
||||
1girl, goddess, ((perfect female body, narrow waist)), gorgeous queen, royal, divine, goddess, godlike, (royal palace),queen,rich,skinny, WombTattoo, sexy, charming, alluring, seductive, erotic, enchanting, dreamlike, unreal, science fiction, fantasy,(mature female:1.4),white hair, blue eyes(looking at viewer:1.2), red lip, (trembling,Panting,blush,open mouth,tongue out,drooling saliva),<lora:murkysAfterSexLying_1:0.7> ((after sex, bukkake, lying on bed,on back, sweat,wet body, covered in cum, cum in pussy)),
|
||||
perfect large breasts(F cup:1),beautiful clothes, lace, lace trim, lace-trimmed legwear, hair ornament, necklace, earrings, bracelet, armlet,
|
||||
<lora:fashionGirl_v47:0.1> <lora:cuteGirlMix4_v10:0.5> <lora:photorealisticWombTattoos_v301:0.7> <lora:breastinclassBetter_v14:0.3> <lora:breastCurtains_v10:1>
|
||||
|
||||
Negative prompt: easynegative, ng_deepnegative_v1_75t, (bad_prompt_version2:0.8), (monochrome:1.1),(low quality, worst quality:1.4),
|
||||
|
||||
models checkpoint:
|
||||
LORA:Murky's-After Sex Lying LoRA
|
||||
Steps: 26, Size: 512x768, Seed: 4272630219, Model: perfectWorld_v2Baked, Sampler: Euler a, CFG scale: 8, Clip skip: 2, Hires steps: 20, Hires upscale: 1.5, Hires upscaler: Latent, Face restoration: CodeFormer, Denoising strength: 0.38
|
||||
```
|
||||
## 真人全裸
|
||||
```
|
||||
(masterpiece, best quality, hires, high resolution:1.2), extremely detailed, intricate details, highres, <lora:aftersex:1>, 1girl, 20yo, woman, AFTER SEX, CUM, LYING, (((lying down))), asleep, CUMDRIP, ASS, ON STOMACH, legs spread, FUCKED SILLY, SWEAT, CUM in pussy, TREMBLING, blonde, on an operating table, medical equipment
|
||||
|
||||
Negative prompt: (worst quality, low quality:1.4), gaps in teeth, asymmetrical eyes, bad anatomy, bad hands, cropped, oversaturated, extra limbs, disfigured, deformed, blurry, poorly drawn face, mutation, mutated, extra limbs, ugly, poorly drawn hands, Asian-Less-Neg
|
||||
|
||||
models checkpoint:fennfoto
|
||||
LORA:Murky's-After Sex Lying LoRA
|
||||
Steps: 32, VAE: vae-ft-mse-840000-ema-pruned-new.safetensors, Size: 512x768, Seed: 3660914911, Model: fennfoto (ff2), Version: v1.6.0, Sampler: DPM++ SDE Karras, VAE hash: 95f26a5ab0, CFG scale: 6.5, "aftersex: 11d81cc5455e", Model hash: e2a30c4ec8, Hires upscale: 2, Hires upscaler: R-ESRGAN 4x+, "Asian-Less-Neg: 22d2f003e76f", ADetailer model: face_yolov8n.pt, ADetailer prompt: asleep, ADetailer version: 23.11.1, Denoising strength: 0.27, ADetailer mask blur: 4, ADetailer model 2nd: hand_yolov8n.pt, ADetailer confidence: 0.3, ADetailer dilate erode: 4, ADetailer mask blur 2nd: 4, ADetailer confidence 2nd: 0.3, ADetailer inpaint padding: 32, ADetailer dilate erode 2nd: 4, ADetailer denoising strength: 0.4, ADetailer inpaint only masked: True, ADetailer inpaint padding 2nd: 32, ADetailer denoising strength 2nd: 0.4, ADetailer inpaint only masked 2nd: True
|
||||
```
|
||||
|
||||
## 真人可爱风全裸
|
||||
```
|
||||
(RAW photo, best quality), (realistic, photo-realistic:1.3), best quality ,masterpiece, an extremely delicate and beautiful, extremely detailed ,CG ,unity ,4k wallpaper, Amazing, finely detail, masterpiece, light smile, best quality, extremely detailed CG unity 8k wallpaper, ultra-detailed, extremely detailed, 2girls, maid,(nude:1.2),(moist pussy:1), (spread legs), hair ornament, looking at viewer, medium breasts, nipples, pink long hair. <lora:japaneseDollLikeness_v10:0.2>, <lora:koreanDollLikeness_v15:0.3>, <lora:cuteGirlMix4_v10:0.2>, <lora:chilloutmixss30_v30:0.3>,
|
||||
|
||||
Negative prompt: (multi nipples), lowres, bad anatomy, bad hands, text, error, missing fingers,extra digit, fewer digits, cropped, worst quality, low qualitynormal quality, jpeg artifacts, signature, watermark, username,bad feet, {Multiple people},lowres,bad anatomy,bad hands, text, error, missing fingers,extra digit, fewer digits, cropped, worstquality, low quality, normal quality,jpegartifacts,signature, watermark, blurry,bad feet,cropped,poorly drawn hands,poorly drawn face,mutation,deformed,worst quality,low quality,normal quality,jpeg artifacts,signature,extra fingers,fewer digits,extra limbs,extra arms,extra legs,malformed limbs,fused fingers,too many fingers,long neck,cross-eyed,mutated hands,polar lowres,bad body,bad proportions,gross proportions,text,error,missing fingers,missing arms,extra arms,missing legs,wrong feet bottom render,extra digit,abdominal stretch, glans, pants, briefs, knickers, kecks, thong, {{fused fingers}}, {{bad body}}, ((long hair))
|
||||
|
||||
models checkpoint:AbsoluteReality
|
||||
LORA:Yae Miko|Realistic Genshin LORA
|
||||
Steps: 30, Size: 512x768, Seed: 841769305, Sampler: DPM++ 2M Karras, CFG scale: 7, Clip skip: 2
|
||||
```
|
||||
|
||||
## 二次元全裸流浆
|
||||
```
|
||||
<lora:Murkys æ§ç±åæè° LoRA:0.8>,((best quality,extremely detailed,incredibly absurdres,extremely detailed cg,more details,ultra-detailed:1.2)),(no code:1),
|
||||
1girl,shiny_skin,thin,blonde hair,big breasts,wedding ring,female pubic hair,(golden drill bit curled princess curled long hair:1),exquisite eyes,(tiry:1.1),(exhausted:1.1),(hand_on_own_stomach:1.1),sweat,(heavy_breathing:1.1),(on side:1.1),(lying:1.1),naked,pussy,after sex,cum on body,fucked silly,cum,cumdrip,cum in pussy,bukkake,throwing a condom containing semen on the bed,used condoms on the bed,
|
||||
simple background,bedroom,bed,(The screen of the mobile phone abandoned on the bed is on:1.1),dutch angle,
|
||||
|
||||
Negative prompt: ((bad hands:1.2)),((missing fingers:1.2)),((badhandv4:1.2)),(EasyNegativeV2:1.2),((ng_deepnegative_v1_75t)),extra legs,(the girl is not holding a phone in her hand:1.1),((there is only one mobile phone on the bed:1.3)),(only 5 fingers:1.2),don't have extra hands:1.2,(not alone:1),(girls don't have a penis:1.4:1.1),girls are not bisexual,(bad anatomy:1.4),(only one girl:1.1),(only one penis:1.2),(the boy is not pregnant:1.2),lowres,text,error,missing fingers,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,lowres,text,error,extra digit,fewer digits,cropped,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,username,blurry,
|
||||
|
||||
models checkpoint:FiaMix Reboot H(NSFW)
|
||||
LORA:Murky's-After Sex Lying LoRA
|
||||
Steps: 40, VAE: vae-ft-mse-840000-ema-pruned.safetensors, Size: 512x512, Seed: 2948043399, Model: fiamixRebootHNSFW_v50, Version: v1.6.1, Sampler: DPM++ 2M Karras, VAE hash: 735e4c3a44, CFG scale: 8, Clip skip: 2, Model hash: e73e55fab1, Hires steps: 150, Hires upscale: 2, Hires upscaler: R-ESRGAN 4x+ Anime6B, Variation seed: 1927049667, Denoising strength: 0.5, Variation seed strength: 0.05, "Murkys æ§ç±åæè° LoRA: 11d81cc5455e"
|
||||
```
|
||||
|
||||
## 二次元全裸
|
||||
```
|
||||
(RAW photo, best quality), (realistic, photo-realistic:1.3), best quality ,masterpiece, an extremely delicate and beautiful, extremely detailed ,CG ,unity ,2k wallpaper, Amazing, finely detail, masterpiece, light smile, best quality, extremely detailed CG unity 8k wallpaper, ultra-detailed, highres, extremely detailed, 1girl, maid,(nude:1.2),(moist pussy:1), (spread legs), hair ornament, looking at looking at viewer, small breasts, <lora:japaneseDollLikeness_v10:0.2>, <lora:koreanDollLikeness_v15:0.2>, <lora:cuteGirlMix4_v10:0.4>, <lora:chilloutmixss30_v30:0.2>
|
||||
|
||||
Negative prompt: (multi nipples), lowres, bad anatomy, bad hands, text, error, missing fingers,extra digit, fewer digits, cropped, worst quality, low qualitynormal quality, jpeg artifacts, signature, watermark, username,bad feet, {Multiple people},lowres,bad anatomy,bad hands, text, error, missing fingers,extra digit, fewer digits, cropped, worstquality, low quality, normal quality,jpegartifacts,signature, watermark, blurry,bad feet,cropped,poorly drawn hands,poorly drawn face,mutation,deformed,worst quality,low quality,normal quality,jpeg artifacts,signature,extra fingers,fewer digits,extra limbs,extra arms,extra legs,malformed limbs,fused fingers,too many fingers,long neck,cross-eyed,mutated hands,polar lowres,bad body,bad proportions,gross proportions,text,error,missing fingers,missing arms,extra arms,missing legs,wrong feet bottom render,extra digit,abdominal stretch, glans, pants, briefs, knickers, kecks, thong, {{fused fingers}}, {{bad body}}, ((long hair))
|
||||
|
||||
models checkpoint:YesMix
|
||||
LORA:Yae Miko|Realistic Genshin LORA
|
||||
Steps: 20, Size: 512x768, Seed: 60205222, Sampler: DPM++ 2M Karras, CFG scale: 8, Clip skip: 2
|
||||
```
|
||||
|
||||
## 可爱小狗
|
||||
```
|
||||
Masterpiece pixar nickelodeon cartoon of ((a cute retriever puppy, fluffy)), puppy in a cage (behind bars), sadness, hope, digital painting, artstation, concept art, sharp focus, illustration, volumetric lighting, epic Composition, 8k, oil painting, cgsociety
|
||||
|
||||
Negative prompt: Realism, worst quality, bad quality, poor quality, blurry, zombie, ugly, cropped, out of frame, photo, Fujifilm XT3, depth of field, line art
|
||||
|
||||
models checkpoint:fustercluck_v2
|
||||
LORA:
|
||||
Steps: 50, Size: 832x1216, Seed: 1360617448, Model: FC_v2_Final, Version: v1.6.0, Sampler: Euler a, CFG scale: 3.5, Model hash: 4a200332e7
|
||||
```
|
||||
|
||||
#
|
||||
81
开发文档/python/机器学习/机器学习框架安装.md
Normal file
81
开发文档/python/机器学习/机器学习框架安装.md
Normal file
File diff suppressed because one or more lines are too long
39
开发文档/uniapp.md
Normal file
39
开发文档/uniapp.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# uni-app笔记
|
||||
|
||||
### uni-form
|
||||
+ 表单需要设置验证规则,才能在提交后获取验证通过的值
|
||||
|
||||
### 弹窗
|
||||
```javascript
|
||||
uni.showToast({
|
||||
title: '点击了悬浮按钮',
|
||||
icon: 'none'
|
||||
})
|
||||
// 在屏幕中央显示提示消息
|
||||
```
|
||||
|
||||
### 创建云对象
|
||||
> 在uniCloud/cloudfunctions目录下右键选择创建云函数,选择云对象,
|
||||
目录的名称即为云对象的名称,在目录下的index.obj.js文件创建方法或函数
|
||||
|
||||
### Error: Cannot find module 'uni-config-center'
|
||||
> 在相对应的云函数目录右键管理公共模块及扩展,把uni-config-center勾选上确定即可
|
||||
|
||||
### err Error: 公共模块[uni-config-center]只能存在一个,删除不使用的公共模块后再试
|
||||
> 错误原因:uniCloud/cloudfunctions/目录下存在uni_modules模块的文件,删除uni_modules模块的函数文件即可
|
||||
|
||||
### JQL语句在where中使用变量
|
||||
> 函数中:`_id=="${var}"`
|
||||
> 模板中: :"uid=='"+var+"'"
|
||||
> 使用computed方法
|
||||
```javascript
|
||||
computed:{
|
||||
where(){
|
||||
return `_id=="${var}"`
|
||||
}
|
||||
}
|
||||
//模板中写:
|
||||
:where="where"
|
||||
```
|
||||
### JQL语句field查询指定字段
|
||||
> field("字段1,字段2,字段3") 写在一个字符串内,用逗号分割字段
|
||||
112
开发文档/数据库/MySQL笔记.md
Normal file
112
开发文档/数据库/MySQL笔记.md
Normal file
@@ -0,0 +1,112 @@
|
||||
# mysql主备搭建
|
||||
```sql
|
||||
CREATE DATABASE IF NOT EXISTS kodbox1 DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
|
||||
create user 'sqladmin'@'%' identified by 'em123456';
|
||||
grant all on *.* to 'sqladmin'@'%';
|
||||
```
|
||||
## 1045(28000)错误解决方法
|
||||
|
||||
^055b1a
|
||||
|
||||
```
|
||||
原因:
|
||||
root用户不能远程登录,
|
||||
|
||||
解决方法:
|
||||
1.可以在容器内输入mysql直接以root用户进入数据库,修改root用户远程权限
|
||||
2.在mysql配置文件末尾添加skip-grant-tables,跳过权限检查,配置文件在/etc/mysql/my.cnf
|
||||
```
|
||||
# MySQL安装
|
||||
## centos使用yum安装mysql8.0
|
||||
```sh
|
||||
# centos7-mysql8.0版本
|
||||
wget https://dev.mysql.com/get/mysql80-community-release-el7-8.noarch.rpm
|
||||
# 安装存储库
|
||||
yum install -y mysql80-community-release-el7-8.noarch.rpm
|
||||
# 禁用5.7的存储库,启用8.0的存储库
|
||||
yum-config-manager --disable mysql57-community
|
||||
yum-config-manager --enable mysql80-community
|
||||
# 安装服务端和客户端
|
||||
yum install -y mysql-community-server mysql-community-client
|
||||
# 启动mysql服务端
|
||||
systemctl start mysqld
|
||||
# 查询root密码
|
||||
grep 'temporary password' /var/log/mysqld.log
|
||||
```
|
||||
## 创建MySQL容器
|
||||
|
||||
^a6aefb
|
||||
|
||||
```sh
|
||||
# 创建容器网络
|
||||
docker network create -d bridge vlan100
|
||||
# mysql8.0版本
|
||||
docker run -itd --name ms10 -h ms10 --restart=always --network vlan100 -e MYSQL_ROOT_PASSWORD=abc123456 -v /var/mysql/ms10/data:/var/lib/mysql -v /var/mysql/ms10/log:/var/log -p 8010:3306 mysql:latest
|
||||
|
||||
# mysql5.7版本
|
||||
docker run -itd --name ms10 --restart=always --network vlan100 -e MYSQL_ROOT_PASSWORD=abc123456 -p 9901:3306 mysql:5.7
|
||||
|
||||
|
||||
```
|
||||
# mysql基本用法
|
||||
```mysql
|
||||
# 创建数据库
|
||||
CREATE DATABASE IF NOT EXISTS dbname DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
|
||||
# 查看数据库字符集
|
||||
show variables like %character%;
|
||||
show variables like %collation%;
|
||||
# 创建用户,%代表任意主机访问权限,localhost代表本地访问权限
|
||||
create user 'username'@'%' identified by 'password';
|
||||
# 查询所有用户
|
||||
select user,host from mysql.user;
|
||||
# 查询当前用户
|
||||
select current_user;
|
||||
select user();
|
||||
# 修改用户名
|
||||
rename user 'user1'@'%' to 'user2'@'%';
|
||||
# 删除用户
|
||||
drop user 'user1'@'%';
|
||||
delete from mysql.user where user='user1'
|
||||
# 修改密码
|
||||
alter user 'user1'@'%' identified by 'newpassword';
|
||||
# 查看用户权限
|
||||
show grants for 'user1'@'%';
|
||||
# 查看所有数据库
|
||||
show databases;
|
||||
# 查看所有数据表;
|
||||
show tables;
|
||||
# 添加权限,赋予用户user1对testdb数据库的所有权限,*代表所有数据表,权限有select,delete,update,create,drop
|
||||
grant all on testdb.* to 'user1'@'%';
|
||||
# 添加查询权限,给user1用户添加testdb的name表的查询权限
|
||||
grant select on testdb.name to 'user1'@'%';
|
||||
# 撤销权限,
|
||||
revoke all on testdb.* from 'user1'@'%';
|
||||
# 刷新系统权限表,即时生效
|
||||
flush privileges;
|
||||
|
||||
```
|
||||
# MySQL常用操作
|
||||
```sh
|
||||
# 主配置文件:
|
||||
/etc/my.cnf
|
||||
# 数据库文件:
|
||||
/var/lib/mysql
|
||||
# 日志文件:
|
||||
/var/log
|
||||
|
||||
# 获取5.7版本以上的随机密码
|
||||
grep 'temporary password' /var/log/mysqld.log
|
||||
|
||||
# 登录
|
||||
mysql -uroot -p
|
||||
# 修改密码
|
||||
SET PASSWORD = PASSWORD('new password')
|
||||
|
||||
# 跳过密码验证
|
||||
echo "skip-grant-tables" >> /etc/my.cnf
|
||||
# 重启msql
|
||||
|
||||
# 重置密码
|
||||
update user set password=password("你的新密码") where user="root"
|
||||
|
||||
```
|
||||
15
开发文档/数据库/MySQL高可用搭建.canvas
Normal file
15
开发文档/数据库/MySQL高可用搭建.canvas
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"nodes":[
|
||||
{"type":"text","text":"mysql8.0主\nhostname:my10","id":"a4b7ff2bdd13b52a","x":-35,"y":40,"width":190,"height":60},
|
||||
{"type":"text","text":"mysql8.0备\nhostname:my11\n\n","id":"8c94d79c781a4a9f","x":-35,"y":-120,"width":190,"height":60},
|
||||
{"type":"text","text":"mysql8.0从\nhost:my30","id":"bb1d77000dd5f28c","x":200,"y":186,"width":190,"height":60},
|
||||
{"type":"text","text":"mysql8.0从\nhostname:my20","id":"98fd69a7ec5b933b","x":-260,"y":186,"width":190,"height":60},
|
||||
{"type":"text","text":"mysql8.0从\nhost:my40","id":"e525fd668744c8ee","x":-35,"y":185,"width":190,"height":60}
|
||||
],
|
||||
"edges":[
|
||||
{"id":"ab7f810638419fa8","fromNode":"a4b7ff2bdd13b52a","fromSide":"top","toNode":"8c94d79c781a4a9f","toSide":"bottom"},
|
||||
{"id":"d579137292cf2cb7","fromNode":"a4b7ff2bdd13b52a","fromSide":"bottom","toNode":"98fd69a7ec5b933b","toSide":"top"},
|
||||
{"id":"b7df10c334e3bfba","fromNode":"a4b7ff2bdd13b52a","fromSide":"bottom","toNode":"bb1d77000dd5f28c","toSide":"top"},
|
||||
{"id":"5a5ff79bdb9a71f0","fromNode":"a4b7ff2bdd13b52a","fromSide":"bottom","toNode":"e525fd668744c8ee","toSide":"top"}
|
||||
]
|
||||
}
|
||||
275
开发文档/数据库/PostgreSQL笔记.md
Normal file
275
开发文档/数据库/PostgreSQL笔记.md
Normal file
@@ -0,0 +1,275 @@
|
||||
|
||||
## SQL语句
|
||||
### 查询操作
|
||||
#### 查询json类型数据中指定字符串
|
||||
```sql
|
||||
-- store_ids为json字段
|
||||
select phone from account_store_list where exists(select 1 from json_array_elements(store_ids) as elem where elem::text like '%842897384838094848%');
|
||||
```
|
||||
#### 查询字段重复数据
|
||||
```sql
|
||||
-- 表名dh_org,字段org_id, org_code,org_name,
|
||||
select org_id,count(*) from dh_org group by org_id having count(*) >1;
|
||||
```
|
||||
#### 基础查询操作
|
||||
```sql
|
||||
-- 查询
|
||||
select from video_info where links like '%74002-1-1.html%';
|
||||
select id_name,sour_name,links from video_info where id_name='666486376699';
|
||||
select links from video_info where links='https://dgs--2023093012e67.um2a-23616.bd1th1yrt.com:23616/vodplay/75358-1-1.html';
|
||||
select * from video_info where data_size>0;https://dgs--2023093012e67.um2a-23616.bd1th1yrt.com:23616/vodplay/87607-1-1.html
|
||||
SELECT * from video_info where links like '%7836-1-1%';
|
||||
|
||||
|
||||
--使用where查询uuid,uuid必须要单引号
|
||||
update new_video_info set m3u8_link='https://muji2.laoyacdn.com/20240511/Q19ypQo6/2000kb/hls/index.m3u8' where id_name='232b5827-f930-4ff7-9bb0-f98e1699c2a5'::UUID
|
||||
```
|
||||
### 更新操作
|
||||
```sql
|
||||
-- 更新表数据
|
||||
update video_info set id_name='658836077826' where key like 'baf0fdabe9f8dd8c';
|
||||
update video_info set key='',m3u8_link='' where img_link!='' and m3u8_link!='';
|
||||
```
|
||||
|
||||
### 更改字段类型
|
||||
```sql
|
||||
-- 该字段类型的数据为空时
|
||||
alter table table_name
|
||||
alter column column_name type new_type;
|
||||
```
|
||||
### 删除操作
|
||||
#### 删除字段重复数据
|
||||
```sql
|
||||
--示例1
|
||||
-- 表名dh_org,字段org_id, org_code,org_name,删除org_id字段的重复数据
|
||||
WITH ranked_data AS (
|
||||
SELECT
|
||||
org_id,
|
||||
org_code,
|
||||
org_name,
|
||||
ROW_NUMBER() OVER (PARTITION BY org_id ORDER BY org_id) AS row_num
|
||||
FROM dh_org
|
||||
)
|
||||
DELETE FROM dh_org
|
||||
WHERE org_id IN (
|
||||
SELECT org_id
|
||||
FROM ranked_data
|
||||
WHERE row_num > 1
|
||||
);
|
||||
|
||||
--示例2
|
||||
-- 删除m3u8_link字段的重复数据
|
||||
DELETE FROM video_info a
|
||||
USING (
|
||||
SELECT MIN(id_name) as min_id, m3u8_link
|
||||
FROM video_info
|
||||
GROUP BY m3u8_link
|
||||
HAVING COUNT(m3u8_link) > 1
|
||||
) b
|
||||
WHERE a.m3u8_link = b.m3u8_link AND a.id_name > b.min_id;
|
||||
```
|
||||
#### 删除表
|
||||
```sql
|
||||
delete from user_info ;
|
||||
```
|
||||
#### 删除指定行数据
|
||||
```sql
|
||||
delete from video_info where id_name= '878586287727';
|
||||
```
|
||||
|
||||
#### 删除表格全部数据,而不删除架构
|
||||
```sql
|
||||
truncate table table_name
|
||||
```
|
||||
|
||||
```
|
||||
### 插入操作
|
||||
|
||||
```sql
|
||||
-- 插入数据
|
||||
INSERT INTO user_info(uid,key) VALUES ('123asada','sadasda3322');
|
||||
insert into video_info(id) values('584653085792') where links != '';
|
||||
-- 使用sql语句插入uuid4
|
||||
insert into video_info(id) select uuid_generate_v4();
|
||||
|
||||
--通过查询其他表的值插入新表
|
||||
INSERT INTO video_2024 (id, sour_name, m3u8_link)
|
||||
SELECT
|
||||
get_date_string() AS id, -- 假设这个函数返回的是适合作为ID的字符串
|
||||
(SELECT sour_name FROM new_video_info WHERE key = '0' LIMIT 1) AS sour_name,
|
||||
(SELECT m3u8_link FROM new_video_info WHERE key = '0' LIMIT 1) AS m3u8_link;
|
||||
delete from new_video_info where sour_name=(SELECT sour_name FROM new_video_info WHERE key = '0' LIMIT 1);
|
||||
```
|
||||
|
||||
## 插入触发器
|
||||
```sql
|
||||
%% 要创建一个触发器,在插入new_video_info表的m3u8_link列之前检查值是否重复,并且如果重复则不插入并提醒,您可以遵循以下步骤:
|
||||
|
||||
首先,您需要创建一个触发器函数,该函数将执行检查并抛出异常(如果m3u8_link值已存在)。以下是这个函数的SQL语句: %%
|
||||
|
||||
sql
|
||||
CREATE OR REPLACE FUNCTION check_m3u8_link_unique()
|
||||
RETURNS TRIGGER AS
|
||||
$$
|
||||
|
||||
BEGIN
|
||||
IF EXISTS (SELECT 1 FROM new_video_info WHERE m3u8_link = NEW.m3u8_link) THEN
|
||||
RAISE EXCEPTION 'm3u8_link "%" already exists.', NEW.m3u8_link;
|
||||
RETURN NULL; -- 阻止插入
|
||||
END IF;
|
||||
RETURN NEW; -- 允许插入
|
||||
END;
|
||||
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
%% 接下来,您需要创建一个触发器,该触发器在每次尝试向new_video_info表插入新行之前调用上述函数: %%
|
||||
|
||||
sql
|
||||
CREATE TRIGGER trg_check_m3u8_link_unique
|
||||
BEFORE INSERT ON new_video_info
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION check_m3u8_link_unique();
|
||||
|
||||
%% 现在,当您尝试向new_video_info表插入数据时,如果m3u8_link列的值已经存在,触发器会抛出一个异常,并显示您定义的错误消息。否则,如果不存在重复值,记录将被正常插入到表中。
|
||||
您可以在psql命令行工具或pgAdmin的SQL编辑器中执行这些SQL语句来创建函数和触发器。请注意,在创建触发器之前,您必须首先确保函数check_m3u8_link_unique已经存在。
|
||||
如果您正在使用pgAdmin,则可以按照以下步骤执行这些SQL语句:
|
||||
打开pgAdmin并连接到您的PostgreSQL数据库。
|
||||
在SQL编辑器中打开一个新的查询标签页。
|
||||
复制并粘贴创建函数check_m3u8_link_unique的SQL语句到查询编辑器中,并执行它。
|
||||
接下来,复制并粘贴创建触发器trg_check_m3u8_link_unique的SQL语句到查询编辑器中,并执行它。
|
||||
执行这些步骤后,触发器将被创建,并在每次尝试向new_video_info表插入数据时自动执行所需的检查。 %%
|
||||
```
|
||||
## 创建容器
|
||||
```sh
|
||||
# 使用ubuntu手动安装
|
||||
docker run -itd -h ps10 --name ps10 --network vlan100 -v /var/postgre
|
||||
sql/ps10:/var/lib/pgsql/data -p 8110:5432 ubuntu /bin/bash
|
||||
|
||||
# 使用官方镜像
|
||||
docker run --restart=always --name=ps10 --network vlan100 -p 9900:5432 -e POSTGRES_PASSWORD=vm123456 -d -v /data/docker_data/database/ps10:/var/lib/pgsql/data postgres:12
|
||||
|
||||
# 创建pgadmin
|
||||
docker run -p 9905:5050 -e PGADMIN_DEFAULT_EMAIL=adhsite@qq.com -e PGADMIN_DEFAULT_PASSWORD=Abc123456 -e PGADMIN_LISTEN_PORT=5050 -v /data/docker_data/pgadmin:/var/data --network vlan100 --name=pgadmin -d dpage/pgadmin4
|
||||
```
|
||||
## 注意事项
|
||||
```sh
|
||||
# 创建时注意指定schema,默认的schema是public
|
||||
|
||||
# 客户端连接权限配置,容器的配置文件路径/var/lib/postgresql/data/pg_hba.conf
|
||||
|
||||
# 系统用户和数据库用户映射,/var/lib/postgresql/data/pg_ident.conf
|
||||
echo -e "映射名称 \t 系统用户 \t 数据库用户" >> /var/lib/postgresql/data/pg_ident.conf
|
||||
# 使用postgres用户重载配置,其他用户无法重载
|
||||
pg_ctl reload
|
||||
|
||||
# 使用pg_ctl reload,调用SQL函数pg_reload_conf(), 或用kill -HUP)重新读取配置文件
|
||||
|
||||
```
|
||||
### uuid类型的问题
|
||||
```python
|
||||
# 使用psycopg2连接查询
|
||||
from psycopg2 import extras
|
||||
with pg.connect(
|
||||
database="video_data",
|
||||
user="videos",
|
||||
password="Vi2023**",
|
||||
host="124.71.39.185",
|
||||
port="9900"
|
||||
) as conn:
|
||||
with conn.cursor() as cursor:
|
||||
# 注册uuid扩展
|
||||
extras.register_uuid()
|
||||
ddl_sql="UPDATE new_video_info SET key=%s,data_size=%s WHERE id_name=%s;"
|
||||
ddl_data=(key,data_size,uuid.UUID(id_name))
|
||||
# 执行ddl_sql查询
|
||||
cursor.execute(ddl_sql,ddl_data)
|
||||
# 提交事务
|
||||
conn.commit()
|
||||
|
||||
# 使用psql,将uuid字符串强制转化为uuid类型
|
||||
UPDATE new_video_info SET key='645fc757fe9fb9ce',data_size='100' WHERE id_name='29793471-8c61-54a7-9dbd-65d8adde1a09'::uuid;
|
||||
|
||||
# 在psql命令行安装uuid模块
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
select uuid_generate_v4() # 返回一个uuid
|
||||
|
||||
# 可以在创建表时将ID设为主键,默认值为uuid,即可自动生成uuid
|
||||
CREATE TABLE my_table (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
);
|
||||
|
||||
# uids扩展
|
||||
CREATE EXTENSION IF NOT EXISTS uids;
|
||||
SELECT generate_typeid('user');
|
||||
```
|
||||
## 常用命令
|
||||
```postgresql
|
||||
-- psql连接数据库
|
||||
psql -U username -h hostname -p port -d dbname
|
||||
|
||||
-- 创建用户,可以在linux系统创建同名用户,可以在本地直连
|
||||
create user username with password 'abc123456';
|
||||
|
||||
-- 创建用户数据库
|
||||
create database dbname owner username;
|
||||
|
||||
-- 设置用户拥有数据库所有权限
|
||||
grant all privileges on database dbname to username;
|
||||
-- 设置用户具有数据表所有权限
|
||||
grant all privileges on table to username;
|
||||
|
||||
--更改用户密码
|
||||
alter user postgres with password 'Amv2024*';
|
||||
|
||||
-- 退出postsql命令行
|
||||
\q
|
||||
|
||||
-- 查看用户数据库
|
||||
\du
|
||||
|
||||
-- 查看所有数据库
|
||||
\l
|
||||
|
||||
-- 切换数据库
|
||||
\c dbname
|
||||
|
||||
-- 查看自定义类型的值
|
||||
\dT+ typename;
|
||||
|
||||
-- 查看数据表列的类型
|
||||
\d tablename;
|
||||
|
||||
-- 指定schema
|
||||
set search_path to schemaname;
|
||||
|
||||
-- 修改schema所有人
|
||||
grant all privileges on all tables in schema schemaname to username;
|
||||
-- alter schema schemaname owner to username;
|
||||
|
||||
-- 创建类型
|
||||
create type typename as enum('M','F');
|
||||
|
||||
-- 查询枚举类型的值
|
||||
select * from pg_enum;
|
||||
|
||||
-- 删除枚举类型
|
||||
drop type public.typename;
|
||||
|
||||
-- 删除枚举类型的值
|
||||
delete from pg_enum where enumlabel='M';
|
||||
|
||||
-- 更改原枚举名称
|
||||
ALTER TYPE "public"."et_type" RENAME TO "et_type2";
|
||||
|
||||
-- 创建用于替换的枚举
|
||||
CREATE TYPE "public"."et_type" AS ENUM ('type1', 'type2', 'type3');
|
||||
|
||||
-- 更改枚举拥有者
|
||||
ALTER TYPE "public"."et_type" OWNER TO "postgres";
|
||||
|
||||
-- 更改表对枚举的引用
|
||||
ALTER TABLE "public"."table" ALTER COLUMN "type" TYPE "et_type" USING "type"::text::et_type;
|
||||
|
||||
|
||||
INSERT INTO "testdata"."employee" ( "emp_no","birth_date","first_name","last_name","gender","hire_date" ) VALUES ( 100000,'1953/9/2','test1','test2','F','1968/3/5' )
|
||||
```
|
||||
115
开发文档/香橙派3B开发板.md
Normal file
115
开发文档/香橙派3B开发板.md
Normal file
@@ -0,0 +1,115 @@
|
||||
- 密码:orangepi
|
||||
## 连接wifi
|
||||
```sh
|
||||
#查看wifi信号列表
|
||||
nmcli dev wifi
|
||||
sudo nmcli dev wifi connect wifi名称 password wifi密码
|
||||
# wifi和有线同时只有一个通
|
||||
```
|
||||
## 创建热点
|
||||
- 注意: linux5.10的Debian12需要修改eth0为end1,linux6.6 的Debian12 需要修改eth0为end0。
|
||||
### 创建NAT模式热点
|
||||
```sh
|
||||
# 以NAT模式创建名称为orangepi、密码为orangepi的WIFI热点
|
||||
sudo create_ap--no-virt-m nat wlan0 eth0 orangepi orangepi
|
||||
|
||||
# 指定热点的网段
|
||||
sudo create_ap--no-virt-m nat wlan0 eth0 orangepi orangepi -g 192.168.2.1
|
||||
|
||||
# 创建5G频段,默认为2.4G频段
|
||||
sudo create_ap--no-virt-m nat wlan0 eth0 orangepi orangepi --freq-band 5
|
||||
|
||||
# 隐藏热点SSID
|
||||
sudo create_ap--no-virt-m nat wlan0 eth0 orangepi orangepi --hidden
|
||||
```
|
||||
### 创建 bridge模式热点
|
||||
```sh
|
||||
# 以bridge模式创建名称为orangepi、密码为orangepi的WIFI 热点
|
||||
sudo create_ap--no-virt-m bridge wlan0 eth0 orangepi orangepi
|
||||
|
||||
```
|
||||
|
||||
## 查看温度
|
||||
```sh
|
||||
# 查看系统温度
|
||||
sensors
|
||||
|
||||
# 查看nvme固态温度
|
||||
sudo smartctl -a /dev/nvme0n1 |grep "Temperature:"
|
||||
```
|
||||
## 40pin接口说明
|
||||
```sh
|
||||
# 查看所有接口信息
|
||||
gpio readall
|
||||
```
|
||||
|
||||
### GPIO接口
|
||||
- 40pin中有28个gpio接口,电压为3.3v
|
||||
- 以下命令均在root账号下执行
|
||||
```
|
||||
#### 手动设置gpio接口模式
|
||||
```sh
|
||||
gpio mode 2 out # 2为gpio引脚的wpi序号,out为输出
|
||||
gpio mode 2 in # 2为gpio引脚的wpi序号,in为输入
|
||||
```
|
||||
#### 设置gpio引脚高低电平
|
||||
```sh
|
||||
gpio write 2 0 #设置wpi序号为2的gpio引脚为低电平
|
||||
gpio write 2 1 #设置wpi序号为2的gpio引脚为高电平
|
||||
|
||||
# 测试gpio接口高低电平
|
||||
blink_all_gpio #会不停切换所有gpio引脚高低电平
|
||||
```
|
||||
#### 设置gpio接口上下拉电阻
|
||||
- 3,5,27,28号引脚无法设置下拉电阻
|
||||
```sh
|
||||
gpio mode 5 in #首先设置wpi序号5的接口为输入模式
|
||||
gpio mode 5 up #设置上拉电阻
|
||||
gpio read 5 # 读取电平为1说明设置上拉成功
|
||||
gpio mode 5 down #设置下拉电阻
|
||||
gpio read 5 # 读取电平为0说明设置下拉成功
|
||||
```
|
||||
### PWM模式
|
||||
- 3B只有2路pwm接口在针脚7和32
|
||||
- #占空比公式 PWM占空比 = CCR/ARR
|
||||
```
|
||||
CCR的取值范围是0~65535,默认值是500。
|
||||
ARR的取值范围是0~65535,默认值是1000。
|
||||
需要注意的是,我们CCR值需要小于ARR值,因为占空比不能大于1。 当设置CCR>ARR时,会提示如下错误信息: gpio: CCR should be less than or equal toARR (XXX) 当设置ARR
|
||||
```
|
||||
- #pwm频率公式 PWM频率 = 时钟来源频率 /(分频系数 *ARR)
|
||||
```
|
||||
时钟来源频率的默认值是24000000Hz。
|
||||
分频系数的取值范围是2~512,默认值是120。
|
||||
ARR的取值范围是0~65535,默认值是1000。
|
||||
PWM频率的默认值是24000000/(120*1000)=200Hz。
|
||||
需要注意的是,如果设置分频系数为奇数,实际的分频系数为设置值减一。
|
||||
```
|
||||
#### 开启pwm接口
|
||||
```sh
|
||||
sudo orangepi-config
|
||||
# 在图形界面选择System -> Hardware 使用空格打开接口配置,save后重启
|
||||
```
|
||||
#### 通过wiringOP调整pwm参数
|
||||
|
||||
```sh
|
||||
# 设置wpi序号为2,针脚为7的接口为pwm
|
||||
gpio mode 2 pwm
|
||||
|
||||
# 设置wpi序号2的ARR为960
|
||||
gpio pwmr 2 960
|
||||
|
||||
# 设置wpi序号2的CRR为480
|
||||
gpio pwm 2 480
|
||||
|
||||
# 设置wpi序号2的分频系数为4
|
||||
gpio pwmc 2 4
|
||||
```
|
||||
#### 直接设置pwm频率
|
||||
```sh
|
||||
# 设置wpi序号为2的引脚频率为500Hz
|
||||
gpio pwmTone 2 500
|
||||
#在设置PWM频率时,需要保证: 设置的频率值 <24000000/(分频系数 *2)。 比如,默认的分频系数为120,在没有修改分频系数的情况下,设置的频率值 应小于100000Hz。
|
||||
#如果设置值过大,会出现如下报错: gpio: The PWMfrequency you set is too high to be possible
|
||||
```
|
||||
opi3b.uavv.cn 的id,1914160092371976192
|
||||
Reference in New Issue
Block a user