Spaces:
Running
on
L40S
Running
on
L40S
Upload app_hg.py with huggingface_hub
Browse files
app_hg.py
CHANGED
@@ -201,7 +201,7 @@ if BAKE_AVAILEBLE:
|
|
201 |
|
202 |
|
203 |
### functional modules
|
204 |
-
@spaces.GPU
|
205 |
def stage_0_t2i(text, image, seed, step):
|
206 |
os.makedirs('./outputs/app_output', exist_ok=True)
|
207 |
exists = set(int(_) for _ in os.listdir('./outputs/app_output') if not _.startswith("."))
|
@@ -226,7 +226,7 @@ def stage_0_t2i(text, image, seed, step):
|
|
226 |
dst = worker_xbg(image, save_folder)
|
227 |
return dst, save_folder
|
228 |
|
229 |
-
@spaces.GPU
|
230 |
def stage_1_xbg(image, save_folder, force_remove):
|
231 |
if isinstance(image, str):
|
232 |
image = Image.open(image)
|
@@ -235,7 +235,7 @@ def stage_1_xbg(image, save_folder, force_remove):
|
|
235 |
rgba.save(dst)
|
236 |
return dst
|
237 |
|
238 |
-
@spaces.GPU
|
239 |
def stage_2_i2v(image, seed, step, save_folder):
|
240 |
if isinstance(image, str):
|
241 |
image = Image.open(image)
|
@@ -250,7 +250,7 @@ def stage_2_i2v(image, seed, step, save_folder):
|
|
250 |
show_img = Image.fromarray(show_img)
|
251 |
return views_img, cond_img, show_img
|
252 |
|
253 |
-
@spaces.GPU
|
254 |
def stage_3_v23(
|
255 |
views_pil,
|
256 |
cond_pil,
|
@@ -273,7 +273,7 @@ def stage_3_v23(
|
|
273 |
obj_dst = save_folder + '/mesh_vertex_colors.obj' # gradio just only can show vertex shading
|
274 |
return obj_dst, glb_dst
|
275 |
|
276 |
-
@spaces.GPU
|
277 |
def stage_3p_baking(save_folder, color, bake):
|
278 |
if color == "texture" and bake:
|
279 |
obj_dst = worker_baker(save_folder)
|
|
|
201 |
|
202 |
|
203 |
### functional modules
|
204 |
+
@spaces.GPU(duration=180)
|
205 |
def stage_0_t2i(text, image, seed, step):
|
206 |
os.makedirs('./outputs/app_output', exist_ok=True)
|
207 |
exists = set(int(_) for _ in os.listdir('./outputs/app_output') if not _.startswith("."))
|
|
|
226 |
dst = worker_xbg(image, save_folder)
|
227 |
return dst, save_folder
|
228 |
|
229 |
+
@spaces.GPU(duration=180)
|
230 |
def stage_1_xbg(image, save_folder, force_remove):
|
231 |
if isinstance(image, str):
|
232 |
image = Image.open(image)
|
|
|
235 |
rgba.save(dst)
|
236 |
return dst
|
237 |
|
238 |
+
@spaces.GPU(duration=180)
|
239 |
def stage_2_i2v(image, seed, step, save_folder):
|
240 |
if isinstance(image, str):
|
241 |
image = Image.open(image)
|
|
|
250 |
show_img = Image.fromarray(show_img)
|
251 |
return views_img, cond_img, show_img
|
252 |
|
253 |
+
@spaces.GPU(duration=180)
|
254 |
def stage_3_v23(
|
255 |
views_pil,
|
256 |
cond_pil,
|
|
|
273 |
obj_dst = save_folder + '/mesh_vertex_colors.obj' # gradio just only can show vertex shading
|
274 |
return obj_dst, glb_dst
|
275 |
|
276 |
+
@spaces.GPU(duration=180)
|
277 |
def stage_3p_baking(save_folder, color, bake):
|
278 |
if color == "texture" and bake:
|
279 |
obj_dst = worker_baker(save_folder)
|