关于人工智能:用Colab免费部署自己的AI绘画云平台-Stable-Diffusion

9次阅读

共计 2226 个字符,预计需要花费 6 分钟才能阅读完成。

AI 绘画门槛又又又升高了,从最开始须要花半天工夫折腾的 Disco-Diffusion,紧接着 Stable Diffusion 在 github 上开源,各家平台都推出了云平台,让用户通过轻松的点击、抉择、输出就能生成一张张 AI 图。

再到当初!!!应用 webui 在 github 上开源了,不仅有手动教程、docker 教程,还有 Colab 傻瓜式的集成计划。

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

((a point coloration cat by the lakeside)), big face, small ears, play in the snow, sharp focus, illustration, highly detailed, concept art, matte, anime, trending on artstation

prompt: Cyberpunk, 8k resolution, castle, the rose sea, dream

水墨画格调

prompt: a watercolor ink painting of a fallen angel with a broken halo wielding a jagged broken blade standing on top of a skyscraper in the style of anti – art trending on artstation deviantart pinterest detailed realistic hd 8 k high resolution

img2img

这个性能则是利用图片生成图片的性能。

这里须要留神的是,不晓得是不是我电脑的分辨率问题,默认宽高为 512 和 256,这个时候会报以下谬误,然而将宽度调整成 1024 * 512 就没有问题

RuntimeError: The size of tensor a (128) must match the size of tensor b (32) at non-singleton dimension 3

生成的一些案例:

A fantasy landscape, trending on artstation

A fantasy landscape, trending on artstation

a nike sneakers

人像优化

间接将老照片拖入框框。

案例:

清晰度优化

如果你感觉你生成的图片品质不够,能够应用这个性能进行 4 倍图进行放大。这个性能生成工夫比拟久,须要急躁期待, 大概 5 -10 分钟,最终生成的清晰度晋升还是蛮大的。

案例:

最初附上一个常见参数阐明

更多内容请查看我整顿的 Notion 文档 https://qiufeng.notion.site/06fab45ec290447ba41c3fd0f6e78fac,蕴含了 10+ 个 AI 绘画平台,SD 和 DD 应用教程,调参教程以及其余的文档。

正文完
 0