Husr commited on
Commit
614a465
·
1 Parent(s): bd7033b

Hide status panel when DEBUG is set

Browse files
Files changed (2) hide show
  1. README.md +2 -1
  2. app.py +8 -5
README.md CHANGED
@@ -10,7 +10,7 @@ pinned: false
10
  ---
11
 
12
 
13
- # Z-Image Hugging Face Space (No SD Fallback)
14
 
15
  Gradio Space using the official Z-Image pipeline (`Tongyi-MAI/Z-Image-Turbo`) with optional LoRA injection (Civitai link you provided). There is **no SD1.5 fallback**—if the Z-Image model is unavailable, the Space will fail to load.
16
 
@@ -41,6 +41,7 @@ Gradio Space using the official Z-Image pipeline (`Tongyi-MAI/Z-Image-Turbo`) wi
41
  - `AOTI_REPO` (default `zerogpu-aoti/Z-Image`): AoTI blocks repo.
42
  - `AOTI_VARIANT` (default `fa3`): AoTI variant.
43
  - `AOTI_ALLOW_LORA` (default `false`): Allow AoTI to load even if LoRA adapters are loaded (may crash; AoTI blocks generally don’t support LoRA).
 
44
 
45
  ## Run locally
46
  ```bash
 
10
  ---
11
 
12
 
13
+ # Z-Image Hugging Face Space
14
 
15
  Gradio Space using the official Z-Image pipeline (`Tongyi-MAI/Z-Image-Turbo`) with optional LoRA injection (Civitai link you provided). There is **no SD1.5 fallback**—if the Z-Image model is unavailable, the Space will fail to load.
16
 
 
41
  - `AOTI_REPO` (default `zerogpu-aoti/Z-Image`): AoTI blocks repo.
42
  - `AOTI_VARIANT` (default `fa3`): AoTI variant.
43
  - `AOTI_ALLOW_LORA` (default `false`): Allow AoTI to load even if LoRA adapters are loaded (may crash; AoTI blocks generally don’t support LoRA).
44
+ - `DEBUG` (default `false`): When set to a truthy value (`1`, `true`, `yes`, `on`), hide the Status/Debug floating panel.
45
 
46
  ## Run locally
47
  ```bash
app.py CHANGED
@@ -26,6 +26,7 @@ AOTI_REPO = os.environ.get("AOTI_REPO", "zerogpu-aoti/Z-Image")
26
  AOTI_VARIANT = os.environ.get("AOTI_VARIANT", "fa3")
27
  AOTI_ALLOW_LORA = os.environ.get("AOTI_ALLOW_LORA", "false").lower() == "true"
28
  DEFAULT_CFG = float(os.environ.get("DEFAULT_CFG", "0.0"))
 
29
 
30
 
31
  def resolve_model_dtype() -> torch.dtype:
@@ -736,6 +737,7 @@ with gr.Blocks(title="Z-Image + LoRA") as demo:
736
  """<div align="center">
737
 
738
  # Z-Image with LoRA
 
739
 
740
  </div>"""
741
  )
@@ -757,11 +759,12 @@ with gr.Blocks(title="Z-Image + LoRA") as demo:
757
  if compile_error:
758
  details_md_blocks.append(f"**torch.compile error**\n```\n{compile_error}\n```")
759
 
760
- with gr.Column(elem_id="floating_status_panel"):
761
- with gr.Accordion("Status / Debug", open=False):
762
- gr.Markdown(status_md)
763
- if details_md_blocks:
764
- gr.Markdown("\n\n".join(details_md_blocks))
 
765
 
766
  with gr.Row():
767
  with gr.Column(scale=1):
 
26
  AOTI_VARIANT = os.environ.get("AOTI_VARIANT", "fa3")
27
  AOTI_ALLOW_LORA = os.environ.get("AOTI_ALLOW_LORA", "false").lower() == "true"
28
  DEFAULT_CFG = float(os.environ.get("DEFAULT_CFG", "0.0"))
29
+ HIDE_STATUS_PANEL = os.environ.get("DEBUG", "false").lower() in {"1", "true", "yes", "on"}
30
 
31
 
32
  def resolve_model_dtype() -> torch.dtype:
 
737
  """<div align="center">
738
 
739
  # Z-Image with LoRA
740
+ LoRA: zit-mystic-xxx
741
 
742
  </div>"""
743
  )
 
759
  if compile_error:
760
  details_md_blocks.append(f"**torch.compile error**\n```\n{compile_error}\n```")
761
 
762
+ if not HIDE_STATUS_PANEL:
763
+ with gr.Column(elem_id="floating_status_panel"):
764
+ with gr.Accordion("Status / Debug", open=False):
765
+ gr.Markdown(status_md)
766
+ if details_md_blocks:
767
+ gr.Markdown("\n\n".join(details_md_blocks))
768
 
769
  with gr.Row():
770
  with gr.Column(scale=1):