Spaces:
Runtime error
Runtime error
File size: 464 Bytes
a48c732 59fed44 a48c732 5ca34b7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
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/cv_diffusion_text-to-image-synthesis_tiny")
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()
|