Stable Diffusion 是一种开源的机器学习模型,可以根据文本生成图像、基于文本修改图像以及增强低分辨率或低细节图像。它已经过数十亿张图像的训练,可以产生与 DALL-E 2 和 MidJourney 生成的结果相当的结果。
Stable Diffusion Web UI 是基于稳定扩散的 Gradio 库的浏览器界面。我们将逐步介绍如何在 Windows 上安装流行的 Stable Diffusion 软件 AUTOMATIC1111。完成本教程后,您可以在自己的 PC 上或租赁的GPU服务器上自由地创建 AI 图像。
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
PS D:\github>git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git Cloning into 'stable-diffusion-webui'... remote: Enumerating objects: 18979, done. remote: Counting objects: 100% (573/573), done. remote: Compressing objects: 100% (248/248), done. remote: Total 18979 (delta 359), reused 480 (delta 325), pack-reused 18406 Receiving objects: 100% (18979/18979), 28.88 MiB | 9.87 MiB/s, done. Resolving deltas: 100% (13233/13233), done.
模型有时称为检查点文件,是预先训练的稳定扩散权重,旨在生成一般或特定类型的图像。请打开 CompVis 或 Stable Diffusion Art 并下载您喜欢的任何模型,例如 1.5,并将其放入 models 目录。
(StableDiffusion) D:\github\stable-diffusion-webui\models\Stable-diffusion\
(StableDiffusion) D:\github\stable-diffusion-webui>webui.bat --xformers venv "D:\github\stable-diffusion-webui\venv\Scripts\Python.exe" Python 3.10.11 | packaged by Anaconda, Inc. | (main, Apr 20 2023, 18:56:50) [MSC v.1916 64 bit (AMD64)] Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89 Installing xformers Collecting xformers==0.0.17 Downloading xformers-0.0.17-cp310-cp310-win_amd64.whl (112.6 MB) …… Model loaded in 12.8s (calculate hash: 6.1s, load weights from disk: 0.3s, create model: 1.7s, apply weights to model: 1.1s, apply half(): 1.2s, move model to device: 1.0s, load textual inversion embeddings: 1.3s). Running on local URL: http://127.0.0.1:7860
使用浏览器打开本地Stable Diffusion WebUI URL,在输入提示的字段中,输入要生成的图像的描述。然后,单击生成按钮。以下是一些最佳 Stable Diffusion 1.5 提示词示例,供您参考。
提示词:
Pixar style little girl, 4k, 8k, unreal engine, octane render photorealistic by cosmicwonder, hdr, photography by cosmicwonder, high definition, symmetrical face, volumetric lighting, dusty haze, photo, octane render, 24mm, 4k, 24mm, DSLR, high quality, 60 fps, ultra realistic
提示词:
(masterpiece:1.0), (best quality:1.4), (ultra highres:1.2), (photorealistic:1.4), (8k, RAW photo:1.2), (soft focus:1.4), 1 woman, posh, (sharp focus:1.4), (korean:1.2), (american:1.1), detailed beautiful face, black hair, (detailed open blazer:1.4), tie, beautiful white shiny humid skin, smiling
负提示词:
illustration, 3d, sepia, painting, cartoons, sketch, (worst quality:2), (low quality:2), (normal quality:2), lowres, bad anatomy, bad hands, normal quality, ((monochrome)), ((grayscale:1.2)),newhalf, collapsed eyeshadow, multiple eyebrows, pink hair, analog, analogphoto
Stable Diffusion 在 AI 艺术模型中脱颖而出,您既可以在具有GPU支持的本地 PC 上运行它,从而允许您微调算法生成各种艺术作品,直到您对结果感到满意为止。如果您已经拥有功能强大的游戏电脑或其他GPU服务器,那么您只需点击几下即可在任何地方创作令人难以置信的艺术作品。
如果您没有合适的GPU服务器,可以到鹄望云GPU服务器站点申请专用GPU服务器试用。我们推荐 Nvidia A40、Tesla V100 和 GeForce RTX 4090 GPU。请大胆地开始您的旅程,我们很乐意帮助您解决任何困难。