Google Colab 版的 Stable Diffusion WebUI 1.4

webui github 地址:https://github.com/sd-webui/stable-diffusion-webui

平台搭建

今天就来交大家如果来搭建和使用这个云平台。

第一步:  打开链接

https://colab.research.google.com/github/altryne/sd-webui-colab/blob/main/Stable_Diffusion_WebUi_Altryne.ipynb

第二步: 连接运行时

打开后,点击右上角的连接

点击确定

等连接上后我们运行第一段脚本,就是查看当前使用的机器。一般是从 K80、T4、P100、V100 中随机分配一个。

第三步: 设置 Token

点击这个 1 - Setup stage 左边的小箭头进行展开

划到 1.4 Connect to Google Drive

勾选 download_if_missing ,然后到  https://huggingface.co/settings/tokens  复制你的 toekn 并填入,关于 huggingface 如何注册,可以看我上一篇文章《AI数字绘画 stable-diffusion 保姆级教程

第四步: 设置密码

划到 2 - Run the Stable Diffusion webui 部分,因为要部署一个服务,当然得设置一个密码,不然人人都可以随意使用你的服务了。

第五步:运行服务

将他们收起来,依次运行以下步骤

第六步:打开 Web 服务

账号为 webui,密码如果设置了就是你设置的密码。

使用教程

打开后就是这样一个界面,主要包含了4块功能,text2img,img2img,人脸修复算法,照片清晰化。

text2img

我们首先来看 text2img,也就是输入一段文字就可以生成一张照片。

prompt 案例:

  • a girl with lavender hair and black skirt, fairy tale style background, a beautiful half body illustration, top lighting, perfect shadow, soft painting, reduce saturation, leaning towards watercolor, art by hidari and krenz cushart and wenjun lin and akihiko yoshida
  • rimuru looking into the camera, beautiful face, ultra realistic, fully clothed, intricate details, highly detailed, 8 k, photorealistic, octane render, unreal engine, photorealistic, portrait

参考:

用Colab免费部署自己的AI绘画云平台—— Stable Diffusion

AI数字绘画 stable-diffusion 保姆级教程

prompt可参考:【Stable Diffusion】Prompt 篇 - 知乎

国内炼丹炉:https://www.liandange.com

一般报错处理

1. ModuleNotFoundError: No module named 'gradio'

在第2步点击显示代码,在末尾加上以下代码

!pip install gradio==3.20.1
!pip install k_diffusion
!pip install pynvml
!pip install omegaconf
!pip install pytorch_lightning
!pip install taming-transformers
!pip install taming-transformers-rom1504
!pip install transformers
!pip install pytorch-lightning==1.6.5

重新运行即可 

2. 运行一段时间提示:gradio No interface is running right now

可参考下:

当前没有正在运行的接口 ·问题 #3060 ·gradio-app/gradio (github.com)

不过我也没解决哈哈哈

最后,

可以了解一下colab:

免费的GPU——colab使用教程 - 知乎

Colaboratory( 简称"Colab")介绍与使用 - 知乎 (zhihu.com)

还有一套是不带界面的源代码执行的项目

CompVis/stable-diffusion: A latent text-to-image diffusion model (github.com)

有兴趣也可以搞搞

可参考:colab运行stable diffusion以及本地部署方法 - 知乎 (zhihu.com)

还有很多不同的colab-sd模板:

https://github.com/camenduru/stable-diffusion-webui-colab

【超详细教程】无需配置环境 | colab直接运行Stable Diffusion web UI并从civitai中导入lora模型_Everglowwwwww的博客-CSDN博客

免部署直接体验AI绘图:GPT问答+AI绘图

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐