Spaces:
Running
on
Zero
Running
on
Zero
gokaygokay
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from gradio_pannellum import Pannellum
|
3 |
import torch
|
@@ -16,11 +17,13 @@ img2panoimg = Image2360PanoramaImagePipeline(model_path, torch_dtype=torch.float
|
|
16 |
# Load the default mask image
|
17 |
default_mask = Image.open("i2p-mask.jpg").convert("RGB")
|
18 |
|
|
|
19 |
def text_to_pano(prompt, upscale):
|
20 |
input_data = {'prompt': prompt, 'upscale': upscale}
|
21 |
output = txt2panoimg(input_data)
|
22 |
return output
|
23 |
|
|
|
24 |
def image_to_pano(image, mask, prompt, upscale):
|
25 |
image = image.resize((512, 512))
|
26 |
if mask is None:
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
from gradio_pannellum import Pannellum
|
4 |
import torch
|
|
|
17 |
# Load the default mask image
|
18 |
default_mask = Image.open("i2p-mask.jpg").convert("RGB")
|
19 |
|
20 |
+
@spaces.GPU(duration=200)
|
21 |
def text_to_pano(prompt, upscale):
|
22 |
input_data = {'prompt': prompt, 'upscale': upscale}
|
23 |
output = txt2panoimg(input_data)
|
24 |
return output
|
25 |
|
26 |
+
@spaces.GPU(duration=200)
|
27 |
def image_to_pano(image, mask, prompt, upscale):
|
28 |
image = image.resize((512, 512))
|
29 |
if mask is None:
|