Spaces:
Running on Zero
Running on Zero
v4
Browse files- README.md +1 -1
- app.py +8 -7
- requirements.txt +4 -3
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🔲
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: gray
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: "4.
|
| 8 |
python_version: "3.10"
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
|
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: gray
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: "4.42.0"
|
| 8 |
python_version: "3.10"
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
app.py
CHANGED
|
@@ -387,13 +387,8 @@ def build_app() -> gr.Blocks:
|
|
| 387 |
gr.Markdown("---")
|
| 388 |
|
| 389 |
sketch = gr.Sketchpad(
|
| 390 |
-
label="Pose Sketchpad (Draw Skeleton)",
|
| 391 |
canvas_size=(512, 512),
|
| 392 |
-
brush=gr.Brush(
|
| 393 |
-
colors=["#ffffff", "#ff3b30", "#34c759", "#007aff", "#ffcc00"],
|
| 394 |
-
color_mode="fixed",
|
| 395 |
-
default_color="#ffffff",
|
| 396 |
-
),
|
| 397 |
type="numpy",
|
| 398 |
height=300,
|
| 399 |
)
|
|
@@ -619,10 +614,16 @@ def build_app() -> gr.Blocks:
|
|
| 619 |
if __name__ == "__main__":
|
| 620 |
logger.info("Starting SILHOUETTE Studio ...")
|
| 621 |
app = build_app()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 622 |
app.launch(
|
| 623 |
server_name="0.0.0.0",
|
| 624 |
server_port=7860,
|
| 625 |
share=False,
|
| 626 |
-
inbrowser=
|
| 627 |
show_error=True,
|
| 628 |
)
|
|
|
|
| 387 |
gr.Markdown("---")
|
| 388 |
|
| 389 |
sketch = gr.Sketchpad(
|
| 390 |
+
label="Pose Sketchpad (Draw Skeleton — white strokes on black)",
|
| 391 |
canvas_size=(512, 512),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 392 |
type="numpy",
|
| 393 |
height=300,
|
| 394 |
)
|
|
|
|
| 614 |
if __name__ == "__main__":
|
| 615 |
logger.info("Starting SILHOUETTE Studio ...")
|
| 616 |
app = build_app()
|
| 617 |
+
|
| 618 |
+
# HF Spaces: server_name must be 0.0.0.0, share must be False,
|
| 619 |
+
# inbrowser must be False (no browser in container environments).
|
| 620 |
+
import os
|
| 621 |
+
_is_hf_space = os.environ.get("SPACE_ID") is not None
|
| 622 |
+
|
| 623 |
app.launch(
|
| 624 |
server_name="0.0.0.0",
|
| 625 |
server_port=7860,
|
| 626 |
share=False,
|
| 627 |
+
inbrowser=not _is_hf_space,
|
| 628 |
show_error=True,
|
| 629 |
)
|
requirements.txt
CHANGED
|
@@ -14,10 +14,11 @@ safetensors>=0.4.0
|
|
| 14 |
# Pose detection
|
| 15 |
controlnet_aux==0.0.7
|
| 16 |
|
| 17 |
-
# UI
|
| 18 |
-
gradio==4.
|
|
|
|
| 19 |
|
| 20 |
-
# HuggingFace Hub — must
|
| 21 |
huggingface_hub==0.23.4
|
| 22 |
|
| 23 |
# Image processing
|
|
|
|
| 14 |
# Pose detection
|
| 15 |
controlnet_aux==0.0.7
|
| 16 |
|
| 17 |
+
# UI — pinned together: gradio and gradio_client must match exactly
|
| 18 |
+
gradio==4.42.0
|
| 19 |
+
gradio_client==0.9.0
|
| 20 |
|
| 21 |
+
# HuggingFace Hub — must stay <0.24.0 to keep HfFolder used by gradio 4.x oauth
|
| 22 |
huggingface_hub==0.23.4
|
| 23 |
|
| 24 |
# Image processing
|