Spaces:
Runtime error
Runtime error
verkaDerkaDerk
commited on
Commit
•
b0e790f
1
Parent(s):
4b5e761
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,9 @@ MODEL_ID = "verkaDerkaDerk/tiki-based-128"
|
|
7 |
MODEL_ID = "verkaDerkaDerk/tiki-64"
|
8 |
PIPELINE = DDPMPipeline.from_pretrained(MODEL_ID)
|
9 |
|
10 |
-
|
11 |
def tiki(batch_size=1,seed=0):
|
12 |
generator = torch.manual_seed(seed)
|
13 |
return PIPELINE(generator=generator, batch_size=batch_size)["sample"]
|
14 |
-
return PIPELINE()["sample"]
|
15 |
|
16 |
def imagine4():
|
17 |
return tiki(batch_size=4)
|
@@ -54,7 +52,7 @@ def fancy():
|
|
54 |
#btn.click(imagine4, inputs=None, outputs=gallery)
|
55 |
|
56 |
with gr.Row(elem_id="tiki-options"):
|
57 |
-
batch_size = gr.Slider(label="
|
58 |
seed = gr.Slider(label="seed", minimum=0, maximum=2022, value=0, step=1)
|
59 |
|
60 |
btn.click(tiki, inputs=[batch_size,seed], outputs=gallery)
|
@@ -63,7 +61,7 @@ def fancy():
|
|
63 |
<p>Trained with <a href="https://github.com/huggingface/diffusers">huggingface/diffusers</a>.</p>
|
64 |
''')
|
65 |
# octet flavored I guess...
|
66 |
-
#
|
67 |
|
68 |
#block.queue(max_size=40).launch()
|
69 |
block.queue().launch()
|
@@ -76,7 +74,6 @@ def plain():
|
|
76 |
FIXME:
|
77 |
- runs very slow 120s - 240s
|
78 |
- image is weirdly stretched
|
79 |
-
- did this change make it to the front-end?
|
80 |
'''
|
81 |
article = gr.HTML('''
|
82 |
<p>Trained with <a href="https://github.com/huggingface/diffusers">diffusers</a>.</p>
|
|
|
7 |
MODEL_ID = "verkaDerkaDerk/tiki-64"
|
8 |
PIPELINE = DDPMPipeline.from_pretrained(MODEL_ID)
|
9 |
|
|
|
10 |
def tiki(batch_size=1,seed=0):
|
11 |
generator = torch.manual_seed(seed)
|
12 |
return PIPELINE(generator=generator, batch_size=batch_size)["sample"]
|
|
|
13 |
|
14 |
def imagine4():
|
15 |
return tiki(batch_size=4)
|
|
|
52 |
#btn.click(imagine4, inputs=None, outputs=gallery)
|
53 |
|
54 |
with gr.Row(elem_id="tiki-options"):
|
55 |
+
batch_size = gr.Slider(label="image count", minimum=1, maximum=4, value=1, step=1)
|
56 |
seed = gr.Slider(label="seed", minimum=0, maximum=2022, value=0, step=1)
|
57 |
|
58 |
btn.click(tiki, inputs=[batch_size,seed], outputs=gallery)
|
|
|
61 |
<p>Trained with <a href="https://github.com/huggingface/diffusers">huggingface/diffusers</a>.</p>
|
62 |
''')
|
63 |
# octet flavored I guess...
|
64 |
+
# img src="https://huggingface.co/spaces/verkaDerkaDerk/tiki-64/resolve/main/tiki-600e.png">
|
65 |
|
66 |
#block.queue(max_size=40).launch()
|
67 |
block.queue().launch()
|
|
|
74 |
FIXME:
|
75 |
- runs very slow 120s - 240s
|
76 |
- image is weirdly stretched
|
|
|
77 |
'''
|
78 |
article = gr.HTML('''
|
79 |
<p>Trained with <a href="https://github.com/huggingface/diffusers">diffusers</a>.</p>
|