赞
踩
https://www.bilibili.com/video/BV1kp421d7eE/
【xinference】(4):在autodl上,使用xinference部署sd-turbo模型,可以根据文本生成图片,在RTX3080-20G上耗时1分钟
https://hf-mirror.com/stabilityai/sd-turbo
SD-Turbo是基于SD 2.1架构的蒸馏模型。
https://inference.readthedocs.io/zh-cn/latest/models/builtin/image/index.html
xinference launch --model-name sd-turbo --model-type image
下载进度:
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]
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)
生成图片:
效果上还是不错的,可以画出苹果的细节。
但是还是粗糙点,确实因为模型比较小。速度还是不错的。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。