|
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() |