renderfy commited on
Commit
1d48c3a
·
verified ·
1 Parent(s): b8567ec

Upload streamlit_app.py

Browse files
Files changed (1) hide show
  1. streamlit_app.py +9 -5
streamlit_app.py CHANGED
@@ -14,7 +14,7 @@ if "results" not in st.session_state:
14
  if "job_counter" not in st.session_state:
15
  st.session_state["job_counter"] = 0
16
  if "duration" not in st.session_state:
17
- st.session_state["duration"] = "6"
18
 
19
  # ================= Yardımcılar =================
20
  def _needs_auth(url: str) -> bool:
@@ -143,7 +143,7 @@ def make_zip(named_bytes: list[tuple[str, bytes]]) -> bytes:
143
  # ================= Sayfa =================
144
  st.set_page_config(page_title="AI LightBox · Beauty", layout="wide", page_icon="💄")
145
  st.title("💄 AI LightBox · Beauty")
146
- st.caption("Packshot → Padding (kare) → On-Face yerleştirme · Super Resolution · (opsiyonel) Video")
147
 
148
  # ================= Üst Kontrol Şeridi =================
149
  ok = backend_ok()
@@ -187,7 +187,6 @@ with colC:
187
  to_video = st.checkbox("Enable video (later)", False, key="to_video")
188
  with colD:
189
  duration = st.selectbox("Video sec", ["6","10"], index=0, key="duration")
190
- st.session_state["duration"] = duration
191
  with colE:
192
  run = st.button("Run", type="primary", use_container_width=True, key="run_btn")
193
 
@@ -348,7 +347,12 @@ if res:
348
  st.warning("Video için final görsel yok.")
349
  else:
350
  with st.spinner("Generating video…"):
351
- v = post_video(src_for_video, duration=st.session_state.get("duration", "6"), resolution="768P", prompt_optimizer=False)
 
 
 
 
 
352
  vurl = (v.get("result") or {}).get("video", {}).get("url")
353
  if vurl:
354
  st.session_state["results"]["video_url"] = vurl
@@ -414,4 +418,4 @@ with st.sidebar:
414
  st.success("Results cleared.")
415
  st.caption(f"API_BASE: {API_BASE}")
416
  if HF_TOKEN:
417
- st.caption("Auth: Bearer (active)")
 
14
  if "job_counter" not in st.session_state:
15
  st.session_state["job_counter"] = 0
16
  if "duration" not in st.session_state:
17
+ st.session_state["duration"] = "6" # widget oluşturulmadan önce default
18
 
19
  # ================= Yardımcılar =================
20
  def _needs_auth(url: str) -> bool:
 
143
  # ================= Sayfa =================
144
  st.set_page_config(page_title="AI LightBox · Beauty", layout="wide", page_icon="💄")
145
  st.title("💄 AI LightBox · Beauty")
146
+ st.caption("Packshot → Padding (square) → On-Face placement · Super Resolution · (optional) Video")
147
 
148
  # ================= Üst Kontrol Şeridi =================
149
  ok = backend_ok()
 
187
  to_video = st.checkbox("Enable video (later)", False, key="to_video")
188
  with colD:
189
  duration = st.selectbox("Video sec", ["6","10"], index=0, key="duration")
 
190
  with colE:
191
  run = st.button("Run", type="primary", use_container_width=True, key="run_btn")
192
 
 
347
  st.warning("Video için final görsel yok.")
348
  else:
349
  with st.spinner("Generating video…"):
350
+ v = post_video(
351
+ src_for_video,
352
+ duration=st.session_state.get("duration", "6"),
353
+ resolution="768P",
354
+ prompt_optimizer=False
355
+ )
356
  vurl = (v.get("result") or {}).get("video", {}).get("url")
357
  if vurl:
358
  st.session_state["results"]["video_url"] = vurl
 
418
  st.success("Results cleared.")
419
  st.caption(f"API_BASE: {API_BASE}")
420
  if HF_TOKEN:
421
+ st.caption("Auth: Bearer (active)")