当前位置:   article > 正文

【xinference】(4):在autodl上,使用xinference部署sd-turbo模型,可以根据文本生成图片,在RTX3080-20G上耗时1分钟,占用显存11G_3080ti跑sd

3080ti跑sd

1,视频地址

https://www.bilibili.com/video/BV1kp421d7eE/

【xinference】(4):在autodl上,使用xinference部署sd-turbo模型,可以根据文本生成图片,在RTX3080-20G上耗时1分钟

2,关于sdxl-turbo

https://hf-mirror.com/stabilityai/sd-turbo

SD-Turbo是基于SD 2.1架构的蒸馏模型。
在这里插入图片描述

2,sd-turbo下载模型

https://inference.readthedocs.io/zh-cn/latest/models/builtin/image/index.html

xinference launch --model-name sd-turbo --model-type image
  • 1

下载进度:

sd_turbo.safetensors: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 5.21G/5.21G [04:51<00:00, 14.8MB/s]
model.fp16.safetensors: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 681M/681M [06:24<00:00, 1.73MB/s]
Fetching 22 files:  50%|█████████████████████████████████████████████████                                                 | 11/22 [06:37<07:19, 39.95s/it]
model.fp16.safetensors:  69%|█████████████████████████████████████████████████████████████▋                            | 467M/681M [04:36<01:46, 2.01MB/s]
model.fp16.safetensors: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 681M/681M [06:24<00:00, 2.09MB/s]
  • 1
  • 2
  • 3
  • 4
  • 5

3,然后就可以测试图片了

https://inference.readthedocs.io/zh-cn/latest/user_guide/client_api.html#id3

python3 测试代码:

from xinference.client import Client
client = Client("http://127.0.0.1:9997")

model = client.get_model("sd-turbo")
input_text = "an apple"
out = model.text_to_image(input_text)
print(out)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

生成图片:
在这里插入图片描述

4,总结

效果上还是不错的,可以画出苹果的细节。
但是还是粗糙点,确实因为模型比较小。速度还是不错的。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/362801
推荐阅读
相关标签
  

闽ICP备14008679号