Spaces:
Running
on
Zero
Running
on
Zero
Update ui_manager.py
Browse files- ui_manager.py +4 -8
ui_manager.py
CHANGED
|
@@ -223,10 +223,8 @@ class UIManager:
|
|
| 223 |
return None, None, None, "Please describe the background scene you'd like!", gr.update(visible=False)
|
| 224 |
|
| 225 |
try:
|
| 226 |
-
def progress_callback(msg: str, pct: int):
|
| 227 |
-
progress(pct / 100, desc=msg)
|
| 228 |
-
|
| 229 |
# Delegate to GPUHandlers
|
|
|
|
| 230 |
result = self.gpu_handlers.background_generate(
|
| 231 |
image=uploaded_image,
|
| 232 |
prompt=prompt,
|
|
@@ -235,7 +233,7 @@ class UIManager:
|
|
| 235 |
focus_mode=focus_mode,
|
| 236 |
num_steps=int(steps),
|
| 237 |
guidance_scale=float(guidance),
|
| 238 |
-
progress_callback=
|
| 239 |
)
|
| 240 |
|
| 241 |
if result["success"]:
|
|
@@ -784,9 +782,6 @@ class UIManager:
|
|
| 784 |
if coverage > 0.95:
|
| 785 |
return None, None, "⚠️ Mask too large - consider using background generation instead", -1
|
| 786 |
|
| 787 |
-
def progress_callback(msg: str, pct: int):
|
| 788 |
-
progress(pct / 100, desc=msg)
|
| 789 |
-
|
| 790 |
try:
|
| 791 |
# Get template key if selected
|
| 792 |
template_key = None
|
|
@@ -796,6 +791,7 @@ class UIManager:
|
|
| 796 |
)
|
| 797 |
|
| 798 |
# Delegate to GPUHandlers
|
|
|
|
| 799 |
result_image, control_image, status, used_seed = self.gpu_handlers.inpainting_generate(
|
| 800 |
image=image,
|
| 801 |
mask=mask,
|
|
@@ -808,7 +804,7 @@ class UIManager:
|
|
| 808 |
guidance_scale=guidance_scale,
|
| 809 |
num_steps=num_steps,
|
| 810 |
seed=int(seed) if seed is not None else -1,
|
| 811 |
-
progress_callback=
|
| 812 |
)
|
| 813 |
|
| 814 |
# Store in history if successful
|
|
|
|
| 223 |
return None, None, None, "Please describe the background scene you'd like!", gr.update(visible=False)
|
| 224 |
|
| 225 |
try:
|
|
|
|
|
|
|
|
|
|
| 226 |
# Delegate to GPUHandlers
|
| 227 |
+
# Note: progress_callback removed for ZeroGPU compatibility (can't pickle local functions)
|
| 228 |
result = self.gpu_handlers.background_generate(
|
| 229 |
image=uploaded_image,
|
| 230 |
prompt=prompt,
|
|
|
|
| 233 |
focus_mode=focus_mode,
|
| 234 |
num_steps=int(steps),
|
| 235 |
guidance_scale=float(guidance),
|
| 236 |
+
progress_callback=None # ZeroGPU doesn't support local function callbacks
|
| 237 |
)
|
| 238 |
|
| 239 |
if result["success"]:
|
|
|
|
| 782 |
if coverage > 0.95:
|
| 783 |
return None, None, "⚠️ Mask too large - consider using background generation instead", -1
|
| 784 |
|
|
|
|
|
|
|
|
|
|
| 785 |
try:
|
| 786 |
# Get template key if selected
|
| 787 |
template_key = None
|
|
|
|
| 791 |
)
|
| 792 |
|
| 793 |
# Delegate to GPUHandlers
|
| 794 |
+
# Note: progress_callback removed for ZeroGPU compatibility (can't pickle local functions)
|
| 795 |
result_image, control_image, status, used_seed = self.gpu_handlers.inpainting_generate(
|
| 796 |
image=image,
|
| 797 |
mask=mask,
|
|
|
|
| 804 |
guidance_scale=guidance_scale,
|
| 805 |
num_steps=num_steps,
|
| 806 |
seed=int(seed) if seed is not None else -1,
|
| 807 |
+
progress_callback=None # ZeroGPU doesn't support local function callbacks
|
| 808 |
)
|
| 809 |
|
| 810 |
# Store in history if successful
|