File size: 716 Bytes
4dcb901 8adddfa 1894a81 2243ad7 195f198 8d2a10d 2243ad7 8d2a10d 2243ad7 4dcb901 2243ad7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import gradio as gr
from diffusers import PNDMPipeline, PNDMScheduler
def update():
try:
pipeline.to("cuda")
except:
pass
images= pipeline().images
print(images)
im = images[0]
return im
scheduler = PNDMScheduler(num_train_timesteps=1100)
pipeline = PNDMPipeline.from_pretrained("uripper/GIANNIS", scheduler=scheduler)
css = """
.container {
max-width: 512px;
max-height: 512px;
margin: auto;
padding-top: 1.5rem;
}
"""
block = gr.Blocks(css=css)
with block as demo:
with gr.Row():
out = gr.Image()
btn = gr.Button("Generate")
btn.click(update, inputs=None, outputs=out)
demo.launch() |