Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ import diff
|
|
3 |
import os
|
4 |
from PIL import Image
|
5 |
import uuid
|
|
|
|
|
6 |
sky = "https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/sky.png"
|
7 |
platform = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/platform.png'
|
8 |
star = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/star.png'
|
@@ -22,13 +24,15 @@ def game_fn(sky=sky,platform=platform,star=star,bomb=bomb,dude=dude):
|
|
22 |
</div>"""
|
23 |
return html_mod
|
24 |
|
25 |
-
def update_game(
|
26 |
|
27 |
return game_fn(sky=sky)
|
28 |
|
29 |
def dif_fn(inp):
|
|
|
30 |
uid=uuid.uuid4()
|
31 |
-
output=diff.send_it(inp,5,1)
|
|
|
32 |
outp=Image.open(output[0])
|
33 |
width, height = outp.size
|
34 |
rat = width/height
|
|
|
3 |
import os
|
4 |
from PIL import Image
|
5 |
import uuid
|
6 |
+
dif = gr.Interface.load("stabilityai/stable-diffusion-2-1-base", live=True),
|
7 |
+
|
8 |
sky = "https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/sky.png"
|
9 |
platform = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/platform.png'
|
10 |
star = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/star.png'
|
|
|
24 |
</div>"""
|
25 |
return html_mod
|
26 |
|
27 |
+
def update_game():
|
28 |
|
29 |
return game_fn(sky=sky)
|
30 |
|
31 |
def dif_fn(inp):
|
32 |
+
|
33 |
uid=uuid.uuid4()
|
34 |
+
#output=diff.send_it(inp,5,1)
|
35 |
+
output=dif(inp)
|
36 |
outp=Image.open(output[0])
|
37 |
width, height = outp.size
|
38 |
rat = width/height
|