Spaces:
Runtime error
Runtime error
File size: 600 Bytes
5047ba0 d853533 96dbd4f a060266 96dbd4f 8648c73 96dbd4f a060266 96dbd4f 609815e 08c822c 96dbd4f a060266 96dbd4f a060266 96dbd4f a060266 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import os
# os.system("""pip install "modelscope[multi-modal]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html""")
import gradio as gr
import cv2
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
text2image = pipeline(Tasks.text_to_image_synthesis,"damo/multi-modal_chinese_stable_diffusion_v1.0")
def inference(text):
result = text2image({"text":text})
cv2.imwrite("result.png", result["output_imgs"][0])
return "result.png"
title = "chinese stable diffusion"
gr.Interface(inference, "text","image", title=title).launch() |