Li Yan
update css to limit the output image dispaly size
28e6e70
raw
history blame
679 Bytes
import gradio as gr
import torch
from diffusers import DiffusionPipeline, DDIMScheduler
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
scheduler = DDIMScheduler.from_pretrained('li-yan/diffusion-aurora-256')
scheduler.set_timesteps(num_inference_steps=40)
pipeline = DiffusionPipeline.from_pretrained(
'li-yan/diffusion-aurora-256', scheduler=scheduler).to(device)
def image_gen(name):
images = pipeline(num_inference_steps=40).images
return images[0]
css = ".output-image, .input-image, .image-preview {height: 256px !important; width: 256px !important;}"
demo = gr.Interface(fn=image_gen, inputs=None, outputs="image", css=css)
demo.launch()