Spaces:
Runtime error
Runtime error
Lazy cache and debug prints
Browse files- gradio_demo.py +4 -0
- marble.py +3 -1
gradio_demo.py
CHANGED
|
@@ -131,6 +131,8 @@ with gr.Blocks(
|
|
| 131 |
inputs=[target_image, texture1, texture2, edit_strength],
|
| 132 |
outputs=blend_output,
|
| 133 |
fn=blend_images,
|
|
|
|
|
|
|
| 134 |
)
|
| 135 |
|
| 136 |
blend_btn.click(
|
|
@@ -253,6 +255,8 @@ with gr.Blocks(
|
|
| 253 |
],
|
| 254 |
outputs=control_output,
|
| 255 |
fn=parametric_control,
|
|
|
|
|
|
|
| 256 |
)
|
| 257 |
|
| 258 |
control_btn.click(
|
|
|
|
| 131 |
inputs=[target_image, texture1, texture2, edit_strength],
|
| 132 |
outputs=blend_output,
|
| 133 |
fn=blend_images,
|
| 134 |
+
cache_examples=True,
|
| 135 |
+
cache_mode="lazy",
|
| 136 |
)
|
| 137 |
|
| 138 |
blend_btn.click(
|
|
|
|
| 255 |
],
|
| 256 |
outputs=control_output,
|
| 257 |
fn=parametric_control,
|
| 258 |
+
cache_examples=True,
|
| 259 |
+
cache_mode="lazy",
|
| 260 |
)
|
| 261 |
|
| 262 |
control_btn.click(
|
marble.py
CHANGED
|
@@ -43,6 +43,7 @@ def setup_control_mlps(
|
|
| 43 |
ret = {}
|
| 44 |
if device is None:
|
| 45 |
device = get_device()
|
|
|
|
| 46 |
for mlp in CONTROL_MLPS:
|
| 47 |
ret[mlp] = setup_control_mlp(mlp, features, device, dtype)
|
| 48 |
return ret
|
|
@@ -114,7 +115,8 @@ def setup_pipeline(
|
|
| 114 |
):
|
| 115 |
if device is None:
|
| 116 |
device = get_device()
|
| 117 |
-
|
|
|
|
| 118 |
download_ip_adapter()
|
| 119 |
|
| 120 |
cur_block = ("up", 0, 1)
|
|
|
|
| 43 |
ret = {}
|
| 44 |
if device is None:
|
| 45 |
device = get_device()
|
| 46 |
+
print(f"Setting up control MLPs on {device}")
|
| 47 |
for mlp in CONTROL_MLPS:
|
| 48 |
ret[mlp] = setup_control_mlp(mlp, features, device, dtype)
|
| 49 |
return ret
|
|
|
|
| 115 |
):
|
| 116 |
if device is None:
|
| 117 |
device = get_device()
|
| 118 |
+
|
| 119 |
+
print(f"Setting up pipeline on {device}")
|
| 120 |
download_ip_adapter()
|
| 121 |
|
| 122 |
cur_block = ("up", 0, 1)
|