Spaces:
Running
Running
Commit
·
145e5fc
1
Parent(s):
8ca5a6f
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,18 +40,47 @@ def generate():
|
|
| 40 |
noise_pred = image_pipe.unet(model_input, t)["sample"]
|
| 41 |
x = scheduler.step(noise_pred, t, x).prev_sample
|
| 42 |
# View the results
|
| 43 |
-
return show_images_save(x)
|
| 44 |
-
|
| 45 |
|
| 46 |
-
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
|
| 56 |
-
if __name__ == "__main__":
|
| 57 |
-
demo.launch(enable_queue=True)
|
|
|
|
| 40 |
noise_pred = image_pipe.unet(model_input, t)["sample"]
|
| 41 |
x = scheduler.step(noise_pred, t, x).prev_sample
|
| 42 |
# View the results
|
| 43 |
+
return show_images_save(x)
|
|
|
|
| 44 |
|
| 45 |
+
def ex():
|
| 46 |
+
return generate(), generate(), generate(), generate()
|
| 47 |
|
| 48 |
+
demo = gr.Blocks()
|
| 49 |
+
|
| 50 |
+
with demo:
|
| 51 |
+
gr.HTML(
|
| 52 |
+
"""
|
| 53 |
+
<div style="text-align: center; margin: 0 auto;">
|
| 54 |
+
<div style="display: inline-flex;align-items: center;gap: 0.8rem;font-size: 1.75rem;">
|
| 55 |
+
<h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
|
| 56 |
+
Minecraft Skin Diffusion
|
| 57 |
+
</h1>
|
| 58 |
+
</div>
|
| 59 |
+
<p style="margin-bottom: 10px; font-size: 94%; line-height: 23px;">
|
| 60 |
+
Gradio demo for Minecraft Skin Diffusion. This is simple Unconditional Diffusion Model that will help you generate skins for game Minecraft.
|
| 61 |
+
</p>
|
| 62 |
+
</div>
|
| 63 |
+
"""
|
| 64 |
+
)
|
| 65 |
+
with gr.Column(scale=4):
|
| 66 |
+
with gr.Row():
|
| 67 |
+
out = gr.Image(shape=(64,64), image_mode='RGBA', type='pil')
|
| 68 |
+
out2 = gr.Image(shape=(64,64), image_mode='RGBA', type='pil')
|
| 69 |
+
with gr.Row():
|
| 70 |
+
out3 = gr.Image(shape=(64,64), image_mode='RGBA', type='pil')
|
| 71 |
+
out4 = gr.Image(shape=(64,64), image_mode='RGBA', type='pil')
|
| 72 |
+
greet_btn = gr.Button("Generate")
|
| 73 |
+
greet_btn.click(fn=ex, inputs=None, outputs=[out, out2, out3, out4])
|
| 74 |
+
gr.HTML(
|
| 75 |
+
"""
|
| 76 |
+
<div class="footer">
|
| 77 |
+
<div style='text-align: center;'>Minecraft Skin Diffusion by <a href='https://twitter.com/wine_ineff' target='_blank'>Artsem Holub (WiNE-iNEFF)</a> |
|
| 78 |
+
<center>
|
| 79 |
+
<img src='https://visitor-badge.glitch.me/badge?page_id=WiNE-iNEFF_MinecraftSkin-Diffusion' alt='visitor badge'>
|
| 80 |
+
</center>
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
"""
|
| 84 |
+
)
|
| 85 |
|
| 86 |
+
demo.launch()
|
|
|
|
|
|