一、开启Google Colab网址
官网:https://colab.research.google.com/
点击添加代码:
二、执行如下代码指令
!pip install --upgrade fastapi==0.90.1
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
!git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser /content/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser
!curl -Lo chilloutmixni.safetensors https://huggingface.co/nolanaatama/chomni/resolve/main/chomni.safetensors
!curl -Lo ulzzang-6500.pt https://huggingface.co/nolanaatama/chomni/resolve/main/ulzzang-6500.pt
!mv "/content/chilloutmixni.safetensors" "/content/stable-diffusion-webui/models/Stable-diffusion"
!mv "/content/ulzzang-6500.pt" "/content/stable-diffusion-webui/embeddings"
%cd /content/stable-diffusion-webui
!COMMANDLINE_ARGS="--share --disable-safe-unpickle --skip-torch-cuda-test --no-half-vae --xformers --reinstall-xformers --enable-insecure-extension-access" REQS_FILE="requirements.txt" python launch.py
点击执行按钮
会自动安装相关的套件、模型,然后等待运行完
注意:如果发生如下错误,该如何解决 RuntimeError:No CUDA GPUs are available
解决办法:
1、点击右上角点选硬件资源
2、打开后,只有两栏,没有GPU的资源 ,请点击下方更改运行时类型
3、选择硬件加速器GPU
4、点击保存
5、资源中即可显示出GPU RAM
6、重新运行,就能看到运行成功所提供的网址链接
三、进入Stable Diffusion的管理网页
点击网址后就能看见Stable Diffusion的管理界面
四、案例测试
算图参数(上面的框)
(8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.37), ultra-detailed,full body,1 girl, solo,beautiful detailed sky,detailed tokyo street,night,beautiful detailed eyes,beautiful detailed lips,professional lighting, photon mapping, radiosity, physically-based rendering,extremely detailed eyes and face, beautiful detailed eyes,light on face,cinematic lighting, short jacket,hoodie,school uniform,1girl,full body,full-body shot,see-through,looking at viewer,outdoors,((white hair)),
算图参数(下面的框)
EasyNegative, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers,fewer fingers,strange fingers,bad hand,signature, watermark, username, blurry, bad feet,bad leg, duplicate, extra limb, ugly, disgusting, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, blurry,mutated hands and fingers, EasyNegative, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers,fewer fingers,strange fingers,bad hand,signature, watermark, username, blurry, bad feet,bad leg
调整其他参数,然后点击运行
等待计算完毕
最后效果:
五、其他在线使用
如果只是想玩玩,也可以去网站中直接使用:
Hugging Face:https://huggingface.co/spaces/stabilityai/stable-diffusion 这个要稍微排队一下
DreamStudio:https://beta.dreamstudio.ai/dream 这个DreamStudio测试版需要注册,支持一些参数,但不用排队