glyffuser / app.py
yue-here
app bugfix
4bf9eb4
raw
history blame contribute delete
642 Bytes
import gradio as gr
from glyffuser_utils import GlyffuserPipeline
from diffusers import DPMSolverMultistepScheduler
pipeline = GlyffuserPipeline.from_pretrained("yuewu/glyffuser")
pipeline.scheduler = DPMSolverMultistepScheduler()
def infer(text, steps):
generated_images = pipeline(
text,
batch_size=1,
num_inference_steps=int(steps)
).images
return generated_images[0]
demo = gr.Interface(fn=infer, inputs=["text", "number"], outputs="image",
description="English text to Chinese glyph. Recommend <10 steps as this space is not running on GPU",
)
demo.launch()