负一.警告

AI 模型的 pickle 文件可能包含隐藏的恶意代码,再加上该模型从 4chan 流出,请三思后使用。建议部署:WEBUI,WEBUI对pickle漏洞有相关防御措施

零.前言

本来官端需要至少11GB+的显存,但有位4chan上的匿名大佬优化了官端的模型,让它的显存减少到了8G+(如果开启float16可以降到5G),今天就来谈谈这玩意的部署教程。~~~~给了我水文章的机会。~~~~

一.准备工作

1.Python 3.x (必须)

直接去Python官网下载最新的版本3.x版本即可 别忘了把PIP源改成清华

pip config set global.index-url
https://pypi.tuna.tsinghua.edu.cn/simple

2.优化版官端

这里提供磁链(我自己加了好多tracker )和 Onedrive 分流

磁链:

magnet:?xt=urn:btih:4a4b483d4a5840b6e1fee6b0ca1582c979434e4d&dn=naifu&tr=http%3a%2f%2f1337.abcvg.info%3a80%2fannounce&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce&tr=udp%3a%2f%2f207.241.226.111%3a6969%2fannounce&tr=udp%3a%2f%2f207.241.231.226%3a6969%2fannounce&tr=udp%3a%2f%2f%5b2001%3a1b10%3a1000%3a8101%3a0%3a242%3aac11%3a2%5d%3a6969%2fannounce&tr=udp%3a%2f%2f%5b2a04%3aac00%3a1%3a3dd8%3a%3a1%3a2710%5d%3a2710%2fannounce&tr=udp%3a%2f%2fchouchou.top%3a8080%2fannounce&tr=udp%3a%2f%2ffe.dealclub.de%3a6969%2fannounce&tr=http%3a%2f%2ffxtt.ru%3a80%2fannounce&tr=http%3a%2f%2fi-p-v-6.tk%3a6969%2fannounce&tr=http%3a%2f%2fincine.ru%3a6969%2fannounce&tr=http%3a%2f%2fipv6.1337.cx%3a6969%2fannounce&tr=http%3a%2f%2fipv6.govt.hu%3a6969%2fannounce&tr=udp%3a%2f%2fmovies.zsw.ca%3a6969%2fannounce&tr=http%3a%2f%2fnyaa.tracker.wf%3a7777%2fannounce&tr=http%3a%2f%2fopen-v6.demonoid.ch%3a6969%2fannounce&tr=http%3a%2f%2fopen.acgnxtracker.com%3a80%2fannounce&tr=http%3a%2f%2fopen.acgtracker.com%3a1096%2fannounce&tr=udp%3a%2f%2fretracker.hotplug.ru%3a2710%2fannounce&tr=http%3a%2f%2fshare.camoe.cn%3a8080%2fannounce&tr=http%3a%2f%2ft.acg.rip%3a6699%2fannounce&tr=http%3a%2f%2ft.nyaatracker.com%3a80%2fannounce&tr=http%3a%2f%2ft.overflow.biz%3a6969%2fannounce&tr=http%3a%2f%2ftorrentsmd.com%3a8080%2fannounce&tr=udp%3a%2f%2ftracker.birkenwald.de%3a6969%2fannounce&tr=http%3a%2f%2ftracker.bt4g.com%3a2095%2fannounce&tr=udp%3a%2f%2ftracker.dler.com%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.dler.org%3a6969%2fannounce&tr=http%3a%2f%2ftracker.electro-torrent.pl%3a80%2fannounce&tr=http%3a%2f%2ftracker.files.fm%3a6969%2fannounce&tr=http%3a%2f%2ftracker.gbitt.info%3a80%2fannounce&tr=http%3a%2f%2ftracker.ipv6tracker.ru%3a80%2fannounce&tr=http%3a%2f%2ftracker.k.vu%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.lelux.fi%3a6969%2fannounce&tr=http%3a%2f%2ftracker.mywaifu.best%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.srv00.com%3a6969%2fannounce&tr=http%3a%2f%2ftracker.vrpnet.org%3a6969%2fannounce&tr=udp%3a%2f%2ftracker1.itzmx.com%3a8080%2fannounce&tr=udp%3a%2f%2ftracker2.dler.org%3a80%2fannounce&tr=http%3a%2f%2ftrackme.theom.nz%3a80%2fannounce&tr=http%3a%2f%2fvps-dd0a0715.vps.ovh.net%3a6969%2fannounce&tr=http%3a%2f%2fvps02.net.orel.ru%3a80%2fannounce&tr=udp%3a%2f%2fwepzone.net%3a6969%2fannounce&tr=http%3a%2f%2fwww.all4nothin.net%3a80%2fannounce.php&tr=http%3a%2f%2fwww.wareztorrent.com%3a80%2fannounce&tr=https%3a%2f%2f1337.abcvg.info%3a443%2fannounce&tr=udp%3a%2f%2fopentracker.i2p.rocks%3a6969%2fannounce&tr=https%3a%2f%2ft1.hloli.org%3a443%2fannounce&tr=https%3a%2f%2ftr.abiir.top%3a443%2fannounce&tr=https%3a%2f%2ftr.abir.ga%3a443%2fannounce&tr=https%3a%2f%2ftr.burnabyhighstar.com%3a443%2fannounce&tr=https%3a%2f%2ftr.fuckbitcoin.xyz%3a443%2fannounce&tr=https%3a%2f%2ftracker.cyber-hub.net%3a443%2fannounce&tr=https%3a%2f%2ftracker.expli.top%3a443%2fannounce&tr=https%3a%2f%2ftracker.foreverpirates.co%3a443%2fannounce&tr=https%3a%2f%2ftracker.gbitt.info%3a443%2fannounce&tr=https%3a%2f%2ftracker.jiesen.life%3a8443%2fannounce&tr=https%3a%2f%2ftracker.kuroy.me%3a443%2fannounce&tr=https%3a%2f%2ftracker.lilithraws.cf%3a443%2fannounce&tr=https%3a%2f%2ftracker.lilithraws.org%3a443%2fannounce&tr=https%3a%2f%2ftracker.loligirl.cn%3a443%2fannounce&tr=https%3a%2f%2ftracker.m-team.cc%3a443%2fannounce.php&tr=https%3a%2f%2ftracker.moeblog.cn%3a443%2fannounce&tr=https%3a%2f%2ftracker.nanoha.org%3a443%2fannounce&tr=https%3a%2f%2ftracker.srv00.com%3a443%2fannounce&tr=https%3a%2f%2ftracker.tamersunion.org%3a443%2fannounce&tr=https%3a%2f%2ftracker1.520.jp%3a443%2fannounce&tr=https%3a%2f%2ftrackme.theom.nz%3a443%2fannounce&tr=https%3a%2f%2fxtremex.herokuapp.com%3a443%2fannounce&tr=udp%3a%2f%2f184.105.151.166%3a6969%2fannounce&tr=http%3a%2f%2f207.241.226.111%3a6969%2fannounce&tr=http%3a%2f%2f207.241.231.226%3a6969%2fannounce&tr=udp%3a%2f%2f52.58.128.163%3a6969%2fannounce&tr=udp%3a%2f%2f6ahddutb1ucc3cp.ru%3a6969%2fannounce&tr=udp%3a%2f%2f9.rarbg.com%3a2810%2fannounce&tr=udp%3a%2f%2f91.216.110.52%3a451%2fannounce&tr=udp%3a%2f%2f94-227-232-84.access.telenet.be%3a6969%2fannounce&tr=udp%3a%2f%2f960303.xyz%3a6969%2fannounce&tr=http%3a%2f%2f%5b2001%3a1b10%3a1000%3a8101%3a0%3a242%3aac11%3a2%5d%3a6969%2fannounce&tr=udp%3a%2f%2f%5b2001%3a470%3a1%3a189%3a0%3a1%3a2%3a3%5d%3a6969%2fannounce&tr=udp%3a%2f%2f%5b2a03%3a7220%3a8083%3acd00%3a%3a1%5d%3a451%2fannounce&tr=http%3a%2f%2f%5b2a04%3aac00%3a1%3a3dd8%3a%3a1%3a2710%5d%3a2710%2fannounce&tr=udp%3a%2f%2f%5b2a0f%3ae586%3af%3af%3a%3a220%5d%3a6969%2fannounce&tr=udp%3a%2f%2faarsen.me%3a6969%2fannounce&tr=udp%3a%2f%2fadmin.52ywp.com%3a6969%2fannounce&tr=udp%3a%2f%2fadmin.videoenpoche.info%3a6969%2fannounce&tr=udp%3a%2f%2fapp.icon256.com%3a8000%2fannounce&tr=udp%3a%2f%2fastrr.ru%3a6969%2fannounce&tr=udp%3a%2f%2fben.kerbertools.xyz%3a6969%2fannounce&tr=udp%3a%2f%2fblack-bird.ynh.fr%3a6969%2fannounce&tr=udp%3a%2f%2fbt.ktrackers.com%3a6666%2fannounce&tr=udp%3a%2f%2fbt1.archive.org%3a6969%2fannounce&tr=udp%3a%2f%2fbt2.archive.org%3a6969%2fannounce&tr=udp%3a%2f%2fbubu.mapfactor.com%3a6969%2fannounce&tr=udp%3a%2f%2fbuddyfly.top%3a6969%2fannounce&tr=udp%3a%2f%2fcamera.lei001.com%3a6969%2fannounce&tr=udp%3a%2f%2fcancela-tu.creditofiscal.mx%3a3074%2fannounce&tr=http%3a%2f%2fchouchou.top%3a8080%2fannounce&tr=udp%3a%2f%2fconcen.org%3a6969%2fannounce&tr=udp%3a%2f%2fcreative.7o7.cx%3a6969%2fannounce&tr=udp%3a%2f%2fcutiegirl.ru%3a6969%2fannounce&tr=udp%3a%2f%2fcutscloud.duckdns.org%3a6969%2fannounce&tr=udp%3a%2f%2fepider.me%3a6969%2fannounce&tr=udp%3a%2f%2fexodus.desync.com%3a6969%2fannounce&tr=udp%3a%2f%2ff1sh.de%3a6969%2fannounce&tr=http%3a%2f%2ffe.dealclub.de%3a6969%2fannounce&tr=udp%3a%2f%2ffh2.cmp-gaming.com%3a6969%2fannounce&tr=udp%3a%2f%2fhtz3.noho.st%3a6969%2fannounce&tr=udp%3a%2f%2fipv4.tracker.harry.lu%3a80%2fannounce&tr=udp%3a%2f%2fipv6.tracker.monitorit4.me%3a6969%2fannounce&tr=udp%3a%2f%2fjutone.com%3a6969%2fannounce&tr=udp%3a%2f%2fkeke.re%3a6969%2fannounce&tr=udp%3a%2f%2flaze.cc%3a6969%2fannounce&tr=udp%3a%2f%2fleefafa.tk%3a6969%2fannounce&tr=udp%3a%2f%2fmail.artixlinux.org%3a6969%2fannounce&tr=udp%3a%2f%2fmail.zasaonsk.ga%3a6969%2fannounce&tr=udp%3a%2f%2fmirror.aptus.co.tz%3a6969%2fannounce&tr=udp%3a%2f%2fmoonburrow.club%3a6969%2fannounce&tr=http%3a%2f%2fmovies.zsw.ca%3a6969%2fannounce&tr=udp%3a%2f%2fnew-line.net%3a6969%2fannounce&tr=udp%3a%2f%2fopen.4ever.tk%3a6969%2fannounce&tr=udp%3a%2f%2fopen.demonii.com%3a1337%2fannounce&tr=udp%3a%2f%2fopen.dstud.io%3a6969%2fannounce&tr=udp%3a%2f%2fopen.free-tracker.ga%3a6969%2fannounce&tr=udp%3a%2f%2fopen.publictracker.xyz%3a6969%2fannounce&tr=udp%3a%2f%2fopen.stealth.si%3a80%2fannounce&tr=udp%3a%2f%2fopen.tracker.ink%3a6969%2fannounce&tr=udp%3a%2f%2fopentor.org%3a2710%2fannounce&tr=https%3a%2f%2fopentracker.i2p.rocks%3a443%2fannounce&tr=udp%3a%2f%2fp4p.arenabg.com%3a1337%2fannounce&tr=udp%3a%2f%2fpsyco.fr%3a6969%2fannounce&tr=udp%3a%2f%2fpublic.publictracker.xyz%3a6969%2fannounce&tr=udp%3a%2f%2fpublic.tracker.vraphim.com%3a6969%2fannounce&tr=udp%3a%2f%2fqtstm32fan.ru%3a6969%2fannounce&tr=udp%3a%2f%2frep-art.ynh.fr%3a6969%2fannounce&tr=http%3a%2f%2fretracker.hotplug.ru%3a2710%2fannounce&tr=udp%3a%2f%2fretracker.lanta-net.ru%3a2710%2fannounce&tr=udp%3a%2f%2frun.publictracker.xyz%3a6969%2fannounce&tr=udp%3a%2f%2fsanincode.com%3a6969%2fannounce&tr=udp%3a%2f%2fslicie.icon256.com%3a8000%2fannounce&tr=udp%3a%2f%2fsmtp-relay.odysseylabel.com.au%3a6969%2fannounce&tr=udp%3a%2f%2fstatic.202.35.76.144.clients.your-server.de%3a6969%2fannounce&tr=udp%3a%2f%2fstatic.54.161.216.95.clients.your-server.de%3a6969%2fannounce&tr=udp%3a%2f%2ftamas3.ynh.fr%3a6969%2fannounce&tr=udp%3a%2f%2fthouvenin.cloud%3a6969%2fannounce&tr=udp%3a%2f%2ftorrentclub.space%3a6969%2fannounce&tr=udp%3a%2f%2ftorrents.artixlinux.org%3a6969%2fannounce&tr=udp%3a%2f%2ftr.cili001.com%3a8070%2fannounce&tr=udp%3a%2f%2ftracker-udp.gbitt.info%3a80%2fannounce&tr=udp%3a%2f%2ftracker.4.babico.name.tr%3a3131%2fannounce&tr=udp%3a%2f%2ftracker.altrosky.nl%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.artixlinux.org%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.auctor.tv%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.beeimg.com%3a6969%2fannounce&tr=http%3a%2f%2ftracker.birkenwald.de%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.bitsearch.to%3a1337%2fannounce&tr=udp%3a%2f%2ftracker.blacksparrowmedia.net%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.cyberia.is%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.ddunlimited.net%3a6969%2fannounce&tr=http%3a%2f%2ftracker.dler.com%3a6969%2fannounce&tr=http%3a%2f%2ftracker.dler.org%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.filemail.com%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.jonaslsa.com%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.joybomb.tw%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.leech.ie%3a1337%2fannounce&tr=http%3a%2f%2ftracker.lelux.fi%3a80%2fannounce&tr=udp%3a%2f%2ftracker.moeking.me%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.monitorit4.me%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.openbtba.com%3a6969%2fannounce&tr=http%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce&tr=udp%3a%2f%2ftracker.pomf.se%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publictracker.xyz%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.skynetcloud.site%3a6969%2fannounce&tr=http%3a%2f%2ftracker.srv00.com%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.swateam.org.uk%3a2710%2fannounce&tr=udp%3a%2f%2ftracker.tcp.exchange%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.theoks.net%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.tiny-vps.com%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.torrent.eu.org%3a451%2fannounce&tr=udp%3a%2f%2ftracker.yangxiaoguozi.cn%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.zemoj.com%3a6969%2fannounce&tr=udp%3a%2f%2ftracker1.bt.moack.co.kr%3a80%2fannounce&tr=http%3a%2f%2ftracker1.itzmx.com%3a8080%2fannounce&tr=udp%3a%2f%2ftracker2.dler.com%3a80%2fannounce&tr=http%3a%2f%2ftracker2.dler.org%3a80%2fannounce&tr=udp%3a%2f%2ftracker2.itzmx.com%3a6961%2fannounce&tr=udp%3a%2f%2ftracker3.itzmx.com%3a6961%2fannounce&tr=udp%3a%2f%2ftracker4.itzmx.com%3a2710%2fannounce&tr=udp%3a%2f%2ftracker6.lelux.fi%3a6969%2fannounce&tr=udp%3a%2f%2fu4.trakx.crim.ist%3a1337%2fannounce&tr=udp%3a%2f%2fuploads.gamecoast.net%3a6969%2fannounce&tr=udp%3a%2f%2fv1046920.hosted-by-vdsina.ru%3a6969%2fannounce&tr=udp%3a%2f%2fvibe.sleepyinternetfun.xyz%3a1738%2fannounce&tr=http%3a%2f%2fwepzone.net%3a6969%2fannounce&tr=udp%3a%2f%2fwww.torrent.eu.org%3a451%2fannounce&tr=udp%3a%2f%2fyahor.ftp.sh%3a6969%2fannounce&tr=udp%3a%2f%2fzecircle.xyz%3a6969%2fannounce&tr=ws%3a%2f%2fhub.bugout.link%3a80%2fannounce&tr=wss%3a%2f%2ftracker.openwebtorrent.com%3a443%2fannounce

Onedrive 分流:

https://pan.xcwosjw.com/E5-/models.zip
https://pan.xcwosjw.com/E5-/program.zip
https://pan.xcwosjw.com/E5-/frontend-src.zip

3.一块好Nvidia显卡

记得安好CUDA驱动

二.部署

1.解压

在下载好后,你会得到models.zip,program.zip和frontend-src.zip等三个文件(如果你是从磁链下载,那么models.zip已经解压好了)

  • models.zip 优化后的final-pruned模型与其他的一些模型打包而成,要解压

  • program.zip 内含一把梭脚本和部分Python代码。解压到与models同目录

  • frontend-src.zip 暂时用不着,NovelAI官方的另一部分前端代码

然后你的文件夹就应该是这样

NAIFU
├── clip
├── hydra_node
├── k_diffusion
├── ldm
├── main.py
├── models
├── requirements.txt
├── run.bat
├── run.sh
├── setup.bat
├── setup.sh
├── static
└── taming

2.一把梭

运行setup.bat进行一把梭(可能要科学上网)

3.运行

运行run.bat,会输出一段类似INFO: Uvicorn running on XXXX 的文字,访问这个URL即可

三.优化

1.使用float16

用文本编辑软件打开run.bat,将第13行的set DTYPE=float32改为set DTYPE=float16,改完5G显存就能跑。

2.使用完整模型

(其实完整的final-pruned模型和优化版的final-pruned模型效果差不多,但显存需求差异显著) 将完整的final-pruned模型(详见:WEBUI部署,在NovelAI.leak.Part1中)复制过来即可 群里还有更多资料→https://t.me/StableDiffusion_CN

最后修改:2022 年 10 月 15 日 原文章地址:https://blog.xcwosjw.com/archives/4/

个性签名就是没有个性签名