Spaces:
Running on Zero
Running on Zero
Right-size ZeroGPU duration requests (dynamic where workload-dependent)
Browse files148 unmodified lines14915015115215315415587 unmodified lines243244245246247248249148 unmodified linesnew_img = img_numpy[..., :3] * alpha[:, :, None] + chkb * (1 - alpha[:, :, None])return Image.fromarray(new_img.astype(np.uint8), mode="RGB")@spaces.GPUdef run_button(run_btn,input_image,87 unmodified lines)@spaces.GPU(duration=90)def image_to_glb(input_image, foreground_ratio, remesh_option, vertex_count, texture_size):# One-call API pipeline for headless callers (Upsampler free tool): background# removal + foreground resize + mesh generation, all in a single GPU allocation.148 unmodified lines14915015115215315415515615787 unmodified lines245246247248249250251252253148 unmodified linesnew_img = img_numpy[..., :3] * alpha[:, :, None] + chkb * (1 - alpha[:, :, None])return Image.fromarray(new_img.astype(np.uint8), mode="RGB")# Mesh generation alone runs in ~5-10s; the 60s default request was rejecting# anonymous visitors whose remaining ZeroGPU quota was below the request.@spaces.GPU(duration=20)def run_button(run_btn,input_image,87 unmodified lines)# Full pipeline (bg removal + mesh + texture bake) measured ~12s end to end;# 30s keeps 2.5x headroom without tripping visitors' quota check.@spaces.GPU(duration=30)def image_to_glb(input_image, foreground_ratio, remesh_option, vertex_count, texture_size):# One-call API pipeline for headless callers (Upsampler free tool): background# removal + foreground resize + mesh generation, all in a single GPU allocation.
gradio_app.py+6-2