akhaliq's picture
akhaliq HF staff
Install dependencies (#1)
386979b
raw
history blame
464 Bytes
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()