Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,10 @@ from PIL import Image
|
|
5 |
import uuid
|
6 |
import random
|
7 |
|
8 |
-
proc1=
|
9 |
-
proc2=
|
|
|
|
|
10 |
|
11 |
sky = "https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/sky.png"
|
12 |
platform = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/platform.png'
|
@@ -41,10 +43,10 @@ def sky_fn(inp):
|
|
41 |
#dif = models[0]
|
42 |
uid=uuid.uuid4()
|
43 |
output=proc1(inp,5,1)
|
44 |
-
in_url=f'https://omnibus-fast-diff.hf.space/file={output[0]}'
|
45 |
#output=dif(inp)
|
46 |
print(output)
|
47 |
-
outp=Image.open(
|
48 |
width, height = outp.size
|
49 |
rat = width/height
|
50 |
if width > height:
|
@@ -66,13 +68,13 @@ def star_fn(inp):
|
|
66 |
#dif = gr.Interface.load("models/stabilityai/stable-diffusion-2-1-base", live=True),
|
67 |
#dif = models[0]
|
68 |
uid=uuid.uuid4()
|
69 |
-
output=proc2(inp,5,1)
|
70 |
-
|
71 |
#output=dif(inp)
|
72 |
-
in_url=f'https://omnibus-fast-diff.hf.space/file={output[0]}'
|
73 |
|
74 |
print(output)
|
75 |
-
outp=Image.open(
|
76 |
width, height = outp.size
|
77 |
rat = width/height
|
78 |
if width > height:
|
@@ -105,4 +107,4 @@ with gr.Blocks() as app:
|
|
105 |
btn.click(sky_fn,prompt,[out_im_sky,out_sky_url])
|
106 |
btn.click(star_fn,prompt,[out_im_star,out_star_url])
|
107 |
app.load(sky_fn,start_prompt,[out_im_sky,out_sky_url]).then(game_fn,[out_sky_url],html_game)
|
108 |
-
app.launch()
|
|
|
5 |
import uuid
|
6 |
import random
|
7 |
|
8 |
+
proc1=diff
|
9 |
+
proc2=diff
|
10 |
+
#proc1=gr.Interface.load("spaces/Omnibus/fast-diff")
|
11 |
+
#proc2=gr.Interface.load("spaces/Omnibus/fast-diff")
|
12 |
|
13 |
sky = "https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/sky.png"
|
14 |
platform = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/platform.png'
|
|
|
43 |
#dif = models[0]
|
44 |
uid=uuid.uuid4()
|
45 |
output=proc1(inp,5,1)
|
46 |
+
#in_url=f'https://omnibus-fast-diff.hf.space/file={output[0]}'
|
47 |
#output=dif(inp)
|
48 |
print(output)
|
49 |
+
outp=Image.open(output[0])
|
50 |
width, height = outp.size
|
51 |
rat = width/height
|
52 |
if width > height:
|
|
|
68 |
#dif = gr.Interface.load("models/stabilityai/stable-diffusion-2-1-base", live=True),
|
69 |
#dif = models[0]
|
70 |
uid=uuid.uuid4()
|
71 |
+
#output=proc2(inp,5,1)
|
72 |
+
output=proc2.send_it(inp,5,1)
|
73 |
#output=dif(inp)
|
74 |
+
#in_url=f'https://omnibus-fast-diff.hf.space/file={output[0]}'
|
75 |
|
76 |
print(output)
|
77 |
+
outp=Image.open(output[0])
|
78 |
width, height = outp.size
|
79 |
rat = width/height
|
80 |
if width > height:
|
|
|
107 |
btn.click(sky_fn,prompt,[out_im_sky,out_sky_url])
|
108 |
btn.click(star_fn,prompt,[out_im_star,out_star_url])
|
109 |
app.load(sky_fn,start_prompt,[out_im_sky,out_sky_url]).then(game_fn,[out_sky_url],html_game)
|
110 |
+
app.queue(concurrency_count=10).launch()
|