【更新v1.7.0】强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南

【更新v1.7.0】强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南

Stable Diffusion(简称SD)是当今最流行的免费、开源的AI绘图机器人,很多收费的AI绘图底层就使用了Stable Diffusion。而 Stable Diffusion WebUI(简称SDW)是AUTOMATIC1111基于Stable Diffusion制作的一个友好操作界面,解决了Stable Diffusion用命令行操作的麻烦。

好消息,由大神cmdr2制作的Easy Diffusion懒人一键安装包已经发布,推荐:

Stable Diffusion WebUI安装后,用户通过浏览器就能操作Stable Diffusion,包括各项参数、指令、设置、看图等,让所有会使用电脑登的人都能制作令人惊叹的AI绘图。而且你不需要花一分钱、绘图没有数量限制、没有想象力限制,通过安装Qpipi.com里提供的各类绘图模型,你在自己电脑上就可以实现!

虽然SDW使用起来容易不少,但安装Stable Diffusion Webui并不是一件简单的事,特别是在国内。本篇文章主要是想帮助小白用户一步一步在自己电脑上安装Stable Diffusion Webui,虽然过程会有点麻烦,但我相信你再生成第一个AI绘图后,这些麻烦事都会被哪惊艳的绘图效果一扫而光。

注:本文内容所有内容、下载由 https://www.qpipi.com 提供。

好,我们开始啦吧!

第一步:下载 Stable Diffusion Webui

1.1、首先在Github下载Stable Diffusion Webui主程序

AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI (github.com)

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

但Github在国内访问不稳定(DNS污染),所以不一定所有用户都能打开,我也准备了安装包下载:

1.2、使用Qpipi国内Stable Diffusion Webui下载链接(不定期更新)

注:各版本可以用不同目录安装,相互独立,万一新版不能使用,还能用回旧版。

重点:SDW v1.5.0 开始默认支持 LyCORISSDXL 模型,无需另装插件。

stable-diffusion-webui-1.7.0.zip
下载密码
Qpipi2023
v1.7.0 更新记录
Features:
settings tab rework: add search field, add categories, split UI settings page into many
add altdiffusion-m18 support (#13364)
support inference with LyCORIS GLora networks (#13610)
add lora-embedding bundle system (#13568)
option to move prompt from top row into generation parameters
add support for SSD-1B (#13865)
support inference with OFT networks (#13692)
script metadata and DAG sorting mechanism (#13944)
support HyperTile optimization (#13948)
add support for SD 2.1 Turbo (#14170)
remove Train->Preprocessing tab and put all its functionality into Extras tab
initial IPEX support for Intel Arc GPU (#14171)
Minor:
allow reading model hash from images in img2img batch mode (#12767)
add option to align with sgm repo's sampling implementation (#12818)
extra field for lora metadata viewer: (#12838ss_output_name)
add action in settings page to calculate all SD checkpoint hashes (#12909)
add button to copy prompt to style editor (#12975)
add --skip-load-model-at-start option (#13253)
write infotext to gif images
read infotext from gif images (#13068)
allow configuring the initial state of InputAccordion in ui-config.json (#13189)
allow editing whitespace delimiters for ctrl+up/ctrl+down prompt editing (#13444)
prevent accidentally closing popup dialogs (#13480)
added option to play notification sound or not (#13631)
show the preview image in the full screen image viewer if available (#13459)
support for webui.settings.bat (#13638)
add an option to not print stack traces on ctrl+c
start/restart generation by Ctrl (Alt) + Enter (#13644)
update prompts_from_file script to allow concatenating entries with the general prompt (#13733)
added a visible checkbox to input accordion
added an option to hide all txt2img/img2img parameters in an accordion (#13826)
added 'Path' sorting option for Extra network cards (#13968)
enable prompt hotkeys in style editor (#13931)
option to show batch img2img results in UI (#14009)
infotext updates: add option to disregard certain infotext fields, add option to not include VAE in infotext, add explanation to infotext settings page, move some options to infotext settings page
add FP32 fallback support on sd_vae_approx (#14046)
support XYZ scripts / split hires path from unet (#14126)
allow use of mutiple styles csv files (#14125)
Extensions and API:
update gradio to 3.41.2
support installed extensions list api (#12774)
update pnginfo API to return dict with parsed values
add noisy latent to for callback (#12856ExtraNoiseParams)
show extension datetime in UTC (#12864, #12865, #13281)
add an option to choose how to combine hires fix and refiner
include program version in info response. (#13135)
sd_unet support for SDXL
patch DDPM.register_betas so that users can put given_betas in model yaml (#13276)
xyz_grid: add prepare (#13266)
allow multiple localization files with same language in extensions (#13077)
add onEdit function for js and rework token-counter.js to use it
fix the key error exception when processing override_settings keys (#13567)
ability for extensions to return custom data via api in response.images (#13463)
call state.jobnext() before postproces*() (#13762)
add option to set notification sound volume (#13884)
update Ruff to 0.1.6 (#14059)
add Block component creation callback (#14119)
catch uncaught exception with ui creation scripts (#14120)
use extension name for determining an extension is installed in the index (#14063)
update is_installed() from launch_utils.py to fix reinstalling already installed packages (#14192)
Bug Fixes:
fix pix2pix producing bad results
fix defaults settings page breaking when any of main UI tabs are hidden
fix error that causes some extra networks to be disabled if both lora: and lyco: are present in the prompt
fix for Reload UI function: if you reload UI on one tab, other opened tabs will no longer stop working
prevent duplicate resize handler (#12795)
small typo: vae resolve bug (#12797)
hide broken image crop tool (#12792)
don't show hidden samplers in dropdown for XYZ script (#12780)
fix style editing dialog breaking if it's opened in both img2img and txt2img tabs
hide --gradio-auth and --api-auth values from /internal/sysinfo report
add missing infotext for RNG in options (#12819)
fix notification not playing when built-in webui tab is inactive (#12834)
honor for extension installers (#12832--skip-install)
don't print blank stdout in extension installers (#12833, #12855)
get progressbar to display correctly in extensions tab
keep order in list of checkpoints when loading model that doesn't have a checksum
fix inpainting models in txt2img creating black pictures
fix generation params regex (#12876)
fix batch img2img output dir with script (#12926)
fix #13080 - Hypernetwork/TI preview generation (#13084)
fix bug with sigma min/max overrides. (#12995)
more accurate check for enabling cuDNN benchmark on 16XX cards (#12924)
don't use multicond parser for negative prompt counter (#13118)
fix data-sort-name containing spaces (#13412)
update card on correct tab when editing metadata (#13411)
fix viewing/editing metadata when filename contains an apostrophe (#13395)
fix: --sd_model in "Prompts from file or textbox" script is not working (#13302)
better Support for Portable Git (#13231)
fix issues when webui_dir is not work_dir (#13210)
fix: lora-bias-backup don't reset cache (#13178)
account for customizable extra network separators whyen removing extra network text from the prompt (#12877)
re fix batch img2img output dir with script (#13170)
fix path separator and option use for checkpoint dropdown (#13139--ckpt-dirshort name)
consolidated allowed preview formats, Fix extra network not woking as preview (#13121.gif)
fix venv_dir=- environment variable not working as expected on linux (#13469)
repair unload sd checkpoint button
edit-attention fixes (#13533)
fix bug when using --gfpgan-models-path (#13718)
properly apply sort order for extra network cards when selected from dropdown
fixes generation restart not working for some users when 'Ctrl+Enter' is pressed (#13962)
thread safe extra network list_items (#13014)
fix not able to exit metadata popup when pop up is too big (#14156)
fix auto focal point crop for opencv >= 4.8 (#14121)
make 'use-cpu all' actually apply to 'all' (#14131)
extras tab batch: actually use original filename
make webui not crash when running with --disable-all-extensions option
Other:
non-local condition (#12814)
fix minor typos (#12827)
remove xformers Python version check (#12842)
style: file-metadata word-break (#12837)
revert SGM noise multiplier change for img2img because it breaks hires fix
do not change quicksettings dropdown option when value returned is (#12854None)
[RC 1.6.0 - zoom is partly hidden] Update style.css (#12839)
chore: change extension time format (#12851)
WEBUI.SH - Use torch 2.1.0 release candidate for Navi 3 (#12929)
add Fallback at images.read_info_from_image if exif data was invalid (#13028)
update cmd arg description (#12986)
fix: update shared.opts.data when add_option (#12957, #13213)
restore missing tooltips (#12976)
use default dropdown padding on mobile (#12880)
put enable console prompts option into settings from commandline args (#13119)
fix some deprecated types (#12846)
bump to torchsde==0.2.6 (#13418)
update dragdrop.js (#13372)
use orderdict as lru cache:opt/bug (#13313)
XYZ if not include sub grids do not save sub grid (#13282)
initialize state.time_start befroe state.job_count (#13229)
fix fieldname regex (#13458)
change denoising_strength default to None. (#13466)
fix regression (#13475)
fix IndexError (#13630)
fix: checkpoints_loaded:{checkpoint:state_dict}, model.load_state_dict issue in dict value empty (#13535)
update bug_report.yml (#12991)
requirements_versions httpx==0.24.1 (#13839)
fix parenthesis auto selection (#13829)
fix #13796 (#13797)
corrected a typo in (#13855modules/cmd_args.py)
feat: fix randn found element of type float at pos 2 (#14004)
adds tqdm handler to logging_config.py for progress bar integration (#13996)
hotfix: call shared.state.end() after postprocessing done (#13977)
fix dependency address patch 1 (#13929)
save sysinfo as .json (#14035)
move exception_records related methods to errors.py (#14084)
compatibility (#13936)
json.dump(ensure_ascii=False) (#14108)
dir buttons start with / so only the correct dir will be shown and no… (#13957)
alternate implementation for unet forward replacement that does not depend on hijack being applied
re-add setting lost as part of commit e294e46 (#14178keyedit_delimiters_whitespace)
fix being checked early when saving masked composite (#14177save_samples)
slight optimization for mask and mask_composite (#14181)
add import_hook hack to work around basicsr/torchvision incompatibility (#14186)
stable-diffusion-webui-1.6.0.zip
下载密码
Qpipi2023
v1.6.0 更新记录
Features:
refiner support #12371
add NV option for Random number generator source setting, which allows to generate same pictures on CPU/AMD/Mac as on NVidia videocards
add style editor dialog
hires fix: add an option to use a different checkpoint for second pass (#12181)
option to keep multiple loaded models in memory (#12227)
new samplers: Restart, DPM++ 2M SDE Exponential, DPM++ 2M SDE Heun, DPM++ 2M SDE Heun Karras, DPM++ 2M SDE Heun Exponential, DPM++ 3M SDE, DPM++ 3M SDE Karras, DPM++ 3M SDE Exponential (#12300, #12519, #12542)
rework DDIM, PLMS, UniPC to use CFG denoiser same as in k-diffusion samplers:
makes all of them work with img2img
makes prompt composition posssible (AND)
makes them available for SDXL
always show extra networks tabs in the UI (#11808)
use less RAM when creating models (#11958, #12599)
textual inversion inference support for SDXL
extra networks UI: show metadata for SD checkpoints
checkpoint merger: add metadata support
prompt editing and attention: add support for whitespace after the number ([ red : green : 0.5 ]) (seed breaking change) (#12177)
VAE: allow selecting own VAE for each checkpoint (in user metadata editor)
VAE: add selected VAE to infotext
options in main UI: add own separate setting for txt2img and img2img, correctly read values from pasted infotext, add setting for column count (#12551)
add resize handle to txt2img and img2img tabs, allowing to change the amount of horizontable space given to generation parameters and resulting image gallery (#12687, #12723)
change default behavior for batching cond/uncond -- now it's on by default, and is disabled by an UI setting (Optimizatios -> Batch cond/uncond) - if you are on lowvram/medvram and are getting OOM exceptions, you will need to enable it
show current position in queue and make it so that requests are processed in the order of arrival (#12707)
add --medvram-sdxl flag that only enables --medvram for SDXL models
prompt editing timeline has separate range for first pass and hires-fix pass (seed breaking change) (#12457)
Minor:
img2img batch: RAM savings, VRAM savings, .tif, .tiff in img2img batch (#12120, #12514, #12515)
postprocessing/extras: RAM savings (#12479)
XYZ: in the axis labels, remove pathnames from model filenames
XYZ: support hires sampler (#12298)
XYZ: new option: use text inputs instead of dropdowns (#12491)
add gradio version warning
sort list of VAE checkpoints (#12297)
use transparent white for mask in inpainting, along with an option to select the color (#12326)
move some settings to their own section: img2img, VAE
add checkbox to show/hide dirs for extra networks
Add TAESD(or more) options for all the VAE encode/decode operation (#12311)
gradio theme cache, new gradio themes, along with explanation that the user can input his own values (#12346, #12355)
sampler fixes/tweaks: s_tmax, s_churn, s_noise, s_tmax (#12354, #12356, #12357, #12358, #12375, #12521)
update README.md with correct instructions for Linux installation (#12352)
option to not save incomplete images, on by default (#12338)
enable cond cache by default
git autofix for repos that are corrupted (#12230)
allow to open images in new browser tab by middle mouse button (#12379)
automatically open webui in browser when running "locally" (#12254)
put commonly used samplers on top, make DPM++ 2M Karras the default choice
zoom and pan: option to auto-expand a wide image, improved integration (#12413, #12727)
option to cache Lora networks in memory
rework hires fix UI to use accordion
face restoration and tiling moved to settings - use "Options in main UI" setting if you want them back
change quicksettings items to have variable width
Lora: add Norm module, add support for bias (#12503)
Lora: output warnings in UI rather than fail for unfitting loras; switch to logging for error output in console
support search and display of hashes for all extra network items (#12510)
add extra noise param for img2img operations (#12564)
support for Lora with bias (#12584)
make interrupt quicker (#12634)
configurable gallery height (#12648)
make results column sticky (#12645)
more hash filename patterns (#12639)
make image viewer actually fit the whole page (#12635)
make progress bar work independently from live preview display which results in it being updated a lot more often
forbid Full live preview method for medvram and add a setting to undo the forbidding
make it possible to localize tooltips and placeholders
add option to align with sgm repo's sampling implementation (#12818)
Restore faces and Tiling generation parameters have been moved to settings out of main UI
if you want to put them back into main UI, use Options in main UI setting on the UI page.
Extensions and API:
gradio 3.41.2
also bump versions for packages: transformers, GitPython, accelerate, scikit-image, timm, tomesd
support tooltip kwarg for gradio elements: gr.Textbox(label='hello', tooltip='world')
properly clear the total console progressbar when using txt2img and img2img from API
add cmd_arg --disable-extra-extensions and --disable-all-extensions (#12294)
shared.py and webui.py split into many files
add --loglevel commandline argument for logging
add a custom UI element that combines accordion and checkbox
avoid importing gradio in tests because it spams warnings
put infotext label for setting into OptionInfo definition rather than in a separate list
make StableDiffusionProcessingImg2Img.mask_blur a property, make more inline with PIL GaussianBlur (#12470)
option to make scripts UI without gr.Group
add a way for scripts to register a callback for before/after just a single component's creation
use dataclass for StableDiffusionProcessing
store patches for Lora in a specialized module instead of inside torch
support http/https URLs in API (#12663, #12698)
add extra noise callback (#12616)
dump current stack traces when exiting with SIGINT
add type annotations for extra fields of shared.sd_model
Bug Fixes:
Don't crash if out of local storage quota for javascriot localStorage
XYZ plot do not fail if an exception occurs
fix missing TI hash in infotext if generation uses both negative and positive TI (#12269)
localization fixes (#12307)
fix sdxl model invalid configuration after the hijack
correctly toggle extras checkbox for infotext paste (#12304)
open raw sysinfo link in new page (#12318)
prompt parser: Account for empty field in alternating words syntax (#12319)
add tab and carriage return to invalid filename chars (#12327)
fix api only Lora not working (#12387)
fix options in main UI misbehaving when there's just one element
make it possible to use a sampler from infotext even if it's hidden in the dropdown
fix styles missing from the prompt in infotext when making a grid of batch of multiplie images
prevent bogus progress output in console when calculating hires fix dimensions
fix --use-textbox-seed
fix broken Lora/Networks: use old method option (#12466)
properly return None for VAE hash when using --no-hashing (#12463)
MPS/macOS fixes and optimizations (#12526)
add second_order to samplers that mistakenly didn't have it
when refreshing cards in extra networks UI, do not discard user's custom resolution
fix processing error that happens if batch_size is not a multiple of how many prompts/negative prompts there are (#12509)
fix inpaint upload for alpha masks (#12588)
fix exception when image sizes are not integers (#12586)
fix incorrect TAESD Latent scale (#12596)
auto add data-dir to gradio-allowed-path (#12603)
fix exception if extensuions dir is missing (#12607)
fix issues with api model-refresh and vae-refresh (#12638)
fix img2img background color for transparent images option not being used (#12633)
attempt to resolve NaN issue with unstable VAEs in fp32 mk2 (#12630)
implement missing undo hijack for SDXL
fix xyz swap axes (#12684)
fix errors in backup/restore tab if any of config files are broken (#12689)
fix SD VAE switch error after model reuse (#12685)
fix trying to create images too large for the chosen format (#12667)
create Gradio temp directory if necessary (#12717)
prevent possible cache loss if exiting as it's being written by using an atomic operation to replace the cache with the new version
set devices.dtype_unet correctly
run RealESRGAN on GPU for non-CUDA devices (#12737)
prevent extra network buttons being obscured by description for very small card sizes (#12745)
fix error that causes some extra networks to be disabled if both lora: and lyco: are present in the prompt
fix defaults settings page breaking when any of main UI tabs are hidden
fix incorrect save/display of new values in Defaults page in settings
fix for Reload UI function: if you reload UI on one tab, other opened tabs will no longer stop working
fix an error that prevents VAE being reloaded after an option change if a VAE near the checkpoint exists (#12797)
hide broken image crop tool (#12792)
don't show hidden samplers in dropdown for XYZ script (#12780)
fix style editing dialog breaking if it's opened in both img2img and txt2img tabs
fix a bug allowing users to bypass gradio and API authentication (reported by vysecurity)
fix notification not playing when built-in webui tab is inactive (#12834)
honor --skip-install for extension installers (#12832)
don't print blank stdout in extension installers (#12833, #12855)
do not change quicksettings dropdown option when value returned is None (#12854)
get progressbar to display correctly in extensions tab
stable-diffusion-webui-1.5.2.zip
下载密码
Qpipi2023
v1.5.2 Bug Fixes:
fix memory leak when generation fails
update doggettx cross attention optimization to not use an unreasonable amount of memory in some edge cases -- suggestion by MorkTheOrk
stable-diffusion-webui-1.5.1.zip
v1.5.1更新记录
Minor:
support parsing text encoder blocks in some new LoRAs
delete scale checker script due to user demand
Extensions and API:
add postprocess_batch_list script callback
Bug Fixes:
fix TI training for SD1
fix reload altclip model error
prepend the pythonpath instead of overriding it
fix typo in SD_WEBUI_RESTARTING
if txt2img/img2img raises an exception, finally call state.end()
fix composable diffusion weight parsing
restyle Startup profile for black users
fix webui not launching with --nowebui
catch exception for non git extensions
fix some options missing from /sdapi/v1/options
fix for extension update status always saying "unknown"
fix display of extra network cards that have in the name<>
update lora extension to work with python 3.8
v1.5.0更新记录
SD XL support
Requires . See #11757 for more details.--no-half-vae
user metadata system for custom networks
extended Lora metadata editor: set activation text, default weight, view tags, training info
Lora extension rework to include other types of networks (all that were previously handled by LyCORIS extension)
show github stars for extenstions
img2img batch mode can read extra stuff from png info
img2img batch works with subdirectories
hotkeys to move prompt elements: alt+left/right
restyle time taken/VRAM display
add textual inversion hashes to infotext
optimization: cache git extension repo information
move generate button next to the generated picture for mobile clients
hide cards for networks of incompatible Stable Diffusion version in Lora extra networks interface
skip installing packages with pip if they all are already installed - startup speedup of about 2 seconds
stable-diffusion-webui-1.4.0
下载密码
Qpipi2023
stable-diffusion-webui-1.3.2
下载密码
Qpipi2023
stable-diffusion-webui-1.3.1
下载密码
Qpipi2023
stable-diffusion-webui-1.2.1
下载密码
Qpipi2023
Stable Diffusion Webui v1.1.0
下载密码
Qpipi2023

1.3、下载完成,开始解压

将下载好的安装包解压到足够空间的硬盘里(剩余容量建议>10G,空间越大越好),例如放在 d:/stable-diffusion-webui ,或者短一点的 d:/sdw,名字随意,但最好用字母或数字的。

虽然主体看起来不大,但后面要装的绘图模型可不小。解压后先不用运行,还要安装两样软件,分别是python和Git。

第二步、安装GIT

2.1、首先到官网下载GIT

官网网址: https://git-scm.com/

下载最新版的就行,一般选64-bit版的,以下是不同系统的下载链接:

官网Windows:64-bit版 | 32-bit版

国内Windows:(备用,如果官网打不开):

官网MacOS:安装指引

官网Liunx:安装指引

2.2、安装GIT

安装步骤注意以下几点选项,其它步骤没啥好说的,按Next下一步直到完成即可。(借用网上的图)

图片[1]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
图1、默认选项即可
图片[2]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
图2、选第一项(最长的)即可
图片[3]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
图3、选Let Git decide即可
图片[4]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
图4、选Git from the command line and also…这一项即可
图片[5]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
图5、选Use bundled OpenSSH即可

最后Finish完成,跳出个官网,可以不用理会直接关掉。开始进行下一步安装python。

第三步、安装Python

注意:目前推荐的 python 版本为>=3.8.x至3.10.xx,新版 3.11 暂时有兼容问题。

Python是SDW运行所必需的编程语言环境,可以在官网下载最新版:https://www.python.org

3.1、下载python集中链接

官网下载页:https://www.python.org/downloads/

windows版:64-bit/32-bit通用下载

MacOS版: 通用下载

3.2、安装python

步骤比较简单,只要注意以下选项即可(借用网上的图):

图片[6]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
注意选择Add python.exe to PATH这一项再点Install Now。安装路径你可以先记下,后面用的上。

安装完成后,准备进行下一步。

第四步、启动前的文件参数修改(关键-海外用户可以跳过)

由于国内网络环境(大墙)会影响Stable Diffusion Webui的安装成败(安装时会下载组件),所以我们需要多做些准备,不然安装速度和一堆错误会让99%的小白暴走(包括我),很多人就是安装这搞不定被迫放弃。但海外安装可以无视这一步。

4.1、修改webui-user.bat (注意:现在可以不用修改这步了,程序会自动关联,除非关联失败再设。

点进你解压的Stable Diffusion Webui目录,找到 webui-user.bat(国内的现在不要双击!不要执行!不然会被网速、错误折磨疯的…)

右键点文件(更多选项里),选编辑(记事本打开):

图片[7]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
图1、将你刚刚安装的python.exe文件路径放在set PYTHON=后面即可,保存退出

什么?忘记python.exe在哪了? 那就到你的 C:/用户/ 文件夹里按上图的路径找一找,或者搜索python.exe ,然后copy路径…

4.2、编辑launch.py(注意:v1.3.1版变更!

Stable Diffusion Webui目录找到 launch.py 右键文件,选择打开方式,可以选用记事本或者editplus、emeditor等编辑。按以下步骤修改,解决国内Github不能直接git获取下载的问题。这里感谢ghproxy.com

注意:v1.3.1版后,launch.py 此文件修改变为你的stable-diffusion-webui/modules/launch_utils.py 文件

CTRL+F 搜索 def prepare_environment() (不同版本在约224~271行),在所有https://github.com的前面加上https://ghproxy.com/。 解决一部分国内无法访问的情况。见下图:

图片[8]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
图2.1、 1.3.1~1.4.0版launch_utils.py参考图片进行修改
图片[9]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
图2.2、1.2.1版launch.py参考图片进行修改

如果不想动手改,可以重命名launch.py 为 launch-old.py后,用下载我改好的1.2.1版文件使用,其它版本请自行修改:

1.2.1版 launch.zip
Qpipi2023

4.3、修改pip下载为国内镜像 (NEW新增)

pip国内下载也很慢怎么办,按照这样修改可以快数倍!

1、在 C:\user\你的用户名目录\里新建一个名为pip目录

2、然后在这个pip目录里新建一个pip.ini文件。

3、记事本打开pip.ini,复制以下代码保存后重启,可以启用阿里云的pip镜像加速。

4.4、修改HOSTS文件,解决Git无法下载和下载缓慢问题

首先编辑你的hosts文件,文件路径默认在 C:/WINDOWS/system32/drivers/etc/(视乎你的Windows安装路径,windows安装安在什么盘就去什么盘里找)

右键hosts文件,选择打开方式,可以用记事本编辑

在文件最后增加两行,对应IPv4/IPv6访问:

修改完成后保存即可。

4.5、完成基本文件修改总结

经过以上文件修改,基本上解决90%的国内无法访问和下载速度缓慢的问题。接下来我们再准备一些文件,增加安装效率!

第五步、启动前的必要文件下载(海外用户可以跳过)

虽然第四步已经解决了大多数无法下载和下载缓慢的问题,但有备无患,先把需要下载的文件放好,帮助处理安装失败时的补救!

5.1、下载 CodeFormer-master

首先下载 CodeFormer-master压缩包,解压到你的 /stable-diffusion-webui/venv/Scripts/ 目录里名为CodeFormer-master的目录中,备用

5.2、下载 open-clip-main

同5.1,下载open-clip-2.19.0.zip,解压到你的 /stable-diffusion-webui/venv/Scripts/ 目录里名为open-clip-main的目录中,备用

open_clip-2.19.0.zip
Qpipi2023

5.3、下载 gfpgan-master

同5.1,下载gfpganv1.4.zip,解压到你的 /stable-diffusion-webui/models/GFPGAN/ 目录里GFPGANv1.4.pth,备用

GFPGAN-1.3.8.zip
Qpipi2023
GFPGANv1.4.zip
Qpipi2023

5.4、下载 taming-transformers-master

同5.1,下载taming-transformers-master.zip,解压到你的 /stable-diffusion-webui/venv/Scripts/ 目录里名为taming-transformers-master的目录中,备用

taming-transformers-master.zip
Qpipi2023

5.5、下载 k-diffusion-master

同5.1,下载k-diffusion-0.0.14.zip,解压到你的 /stable-diffusion-webui/venv/Scripts/ 目录里名为k-diffusion-master的目录中,备用

5.6、重磅下载,你的第一个SD模型库!

智能绘图的主体模型决定了你的SD的绘画结果,这些模型都是经过数千万次训练出来的种子,所以开始前必须要有一个模型主体。下面提供是官方的通用模型,作为基础模型练手是足够用的。

模型主体文件后缀名是 .safetensors 、.ckpt、.pt等,目前模型主体多数用安全性高的 .safetensors 后缀名。

模型主体存放目录为,你的 stable-diffusion-webui/models/Stable-diffusion/ 里面

SDW默认模型:sd-v1-4

sd-v1-4.ckpt
Qpipi2023

ESD默认模型:v1-5-pruned-emaonly

注:Qpipi.com的 SD模型栏目汇聚数百个精选模型库,从人物、风景、动漫、机械、建筑、艺术、奇幻、动物等都有,请多捧场支持!Stable Diffusion-Qpipi

5.7、完成文件下载总结

其实海外用户可以跳过第四步和第五步,因为不存在大墙的速度慢和无法访问。国内用户只能麻烦一些了。

本部下载的文件在后期安装遇到问题时,就很有用了。如果你还遇到安装时无法下载的文件,请截图或者告诉我什么安装包出错,我会加上。

第六步、启动Stable Diffusion Webui安装

6.1、首次启动会比较慢,正常!

做了真么多准备,我们要开始第一次运行SDW了。进入你的stable-diffusion-webui目录,双击webui-user.bat

弹出命令提示符界面,等待第一次的准备完成,不用着急,第一次运行过程应该会下载一些程序,并且编译一些代码,所以可能需要等几十分钟,中间记得不要让电脑休眠了。

图片[10]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南

等到提示中出现一段本地IP,就代表启动成功!恭喜你!复制这个IP地址到浏览器,你就可以开始尽情的使用Stable Diffusion Webui啦~

放心,只有第一次启动慢,以后再启动SDW就会很快乐~

注意:Stable Diffusion Webui运行过程中不要关闭这个命令提示符界面!

图片[11]_强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南
注意:AI绘图需要指令告诉他你想要什么,Qpipi收集了大量大神的指令集,可以前往查看

6.2、指令绘图(提示Prompt、负面提示Negative prompt

什么是指令绘图?

就是你告诉AI你想要什么样式的图,就像你告诉画师朋友你想要他帮你画啥图一个道理。

那么,啥也不说可以直接绘图吗?

当然可以,AI会按自己训练过的内容随便乱画… 嗯?!乱画好像也比我画的好。

那么指令的提示(Prompt)和负面提示(Negative Prompt)是什么?

这两种提示在使用中非常重要,以后Qpipi也会提供各路大神的指令给大家尝试。

原则上,提示Prompt是指你想要的东西,而负面提示Negative Prompt则相反,是你不想出现的东西。

但在目前实际使用过程中,受到底层架构影响、矛盾词汇影响、理解能力影响等,是有可能出现偏差的,通过调整指令细节减轻偏差。

指令相同,AI绘制的图片会一模一样吗?

目前而言,就算相同指令,AI绘制出来的画,整体风格相同,但在细节方面会有所不同,也就是目前基本上没有两张细节完全一样的AI绘图(可以玩找不同了)。

提供两套指令给大家练练手用,更多指令请移步SD绘图作品展示-Qpipi,每张作品都带有完整提示指令!

提示指令1:

a girl is standing in the amusement park,1girl,lipstick,ldisheveled hair,colored inner hair,shushing,{steam},Looking at Viewer,golden hour lighting,comic,atmospheric perspective,bokeh,detailed,Cinematic light, intricate detail, highres, detailed facial features, high detail, sharp focus, smooth, aesthetic, extremely detailed, stamp, octane render,{{{masterpiece}}}

multiple people, lowres, bad anatomy, bad hands, text, error, missing fingers,extra digit, fewer digits, cropped, worstquality, low quality, normal quality,jpegartifacts,signature, watermark, username,blurry,bad feet,cropped,poorly drawn hands,poorly drawn face,mutation,deformed,worst quality,low quality,normal quality,jpeg artifacts,signature,watermark,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,missing legs,extra digit

第七步:优化SDW,老电脑也能跑

Stable Diffusion Webui对显卡显存有较高要求,直接影响绘图速度。4G显存算入门、24G显存也能全吃光。对CPU要求还好,没有显卡要求高,除非没有独立显卡才用CPU跑(噩梦)。

在测试中我用差不多10年前的GTX970 4G +16GDDR老爷机也能跑默认的512,2-3分钟一张图吧。

建议低于6G显存使用 txt to img 时默认绘图px大小不要调太高,后面可以用 Img to Img 拉升尺寸。

7.1、使用SDW的优化

这些优化有常见的:

1、缓解显存不足 CUDA out of memory 的问题(无论有多大显存都可能出现)

2、优化nvidia系列显卡的性能及内存消耗。

3、解决小于4G显存跑不动的问题(2G显存可跑)

7.2、如何安全关闭Stable Diffusion Webui

一般情况,直接关闭命令提示行窗口,关闭浏览器就可以的。这样可能资源释放不够完全,或者正在跑绘图任务或者程序出错呢?

7.3、其它可能遇到的问题

Stable Diffusion Webui安装、使用过程中你可能会遇到的问题,首先百度一下看看有没有热心网友解答了,或者在这留言给我,大家会尽量解答。

如果这篇文章对你有帮助,请多点赞、分享、收藏~

你还想知道关于Stable Diffusion的内容,欢迎留言告知。

常见问题解答

SD绘图作品和绘图提示指令

AI绘图模型主体CP

相关来源:

SD相关的下载 Stable Diffusion-Qpipi

SD绘图作品展示 SD绘图作品展示-Qpipi

SD精选模型下载SD绘图模型主体-Qpipi

SD优化/美化模型下载SD绘图美化优化-Qpipi

SD插件下载SD绘图插件-Qpipi

希望你喜欢使用这个AI模型,就像我们创造它一样!如果您有任何问题或建议,请在Qpipi社区分享。

使用Qpipi读图提示功能,获取图片TAG Prompt提示

Stable Diffusion AI绘图软件常见问题解答

强大的开源AI绘图工具Stable Diffusion Webui最全本地安装指南

Stable Diffusion一键安装懒人包新版,Easy Diffusion支持Windows、Mac绿色安装包

找不到你想要的AI绘画模型下载?请在SD社区或者评论留言告诉我们!

🎨享受创造惊人AI图像的乐趣!

© 版权声明
THE END
喜欢就支持一下吧!
点赞31 分享
评论 共271条

请登录后发表评论