Spaces:
Running
Running
Upload streamlit_app.py
Browse files- streamlit_app.py +10 -5
streamlit_app.py
CHANGED
|
@@ -38,9 +38,9 @@ def post_chain(data: dict, files_payload):
|
|
| 38 |
def post_video(image_url: str, duration="6", resolution="768P", prompt_optimizer=False):
|
| 39 |
payload = {
|
| 40 |
"image_url": image_url,
|
| 41 |
-
"duration": duration,
|
| 42 |
-
"resolution": resolution,
|
| 43 |
-
"prompt_optimizer": "true" if prompt_optimizer else "false",
|
| 44 |
# prompt vermiyoruz -> backend JEWELRY_VIDEO_PROMPT (zoom yok)
|
| 45 |
}
|
| 46 |
r = requests.post(f"{API_BASE}/v1/video/from-image", data=payload, headers=HEADERS, timeout=600)
|
|
@@ -189,7 +189,7 @@ with colD:
|
|
| 189 |
with colE:
|
| 190 |
run = st.button("Çalıştır", type="primary", use_container_width=True, key="run_btn")
|
| 191 |
|
| 192 |
-
# == Tuval seçenekleri
|
| 193 |
colT1, colT2 = st.columns([1.3, 1.0])
|
| 194 |
with colT1:
|
| 195 |
canvas_policy = st.selectbox("Tuval", ["fixed_1200","match_long_edge","keep_input"], index=0, key="canvas_policy")
|
|
@@ -352,7 +352,12 @@ if res:
|
|
| 352 |
st.warning("Video için final görsel bulunamadı.")
|
| 353 |
else:
|
| 354 |
with st.spinner("Video üretiliyor (SR kaynak)…"):
|
| 355 |
-
v = post_video(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 356 |
vurl = (v.get("result") or {}).get("video", {}).get("url")
|
| 357 |
if vurl:
|
| 358 |
st.session_state["results"]["video_url"] = vurl
|
|
|
|
| 38 |
def post_video(image_url: str, duration="6", resolution="768P", prompt_optimizer=False):
|
| 39 |
payload = {
|
| 40 |
"image_url": image_url,
|
| 41 |
+
"duration": duration, # backend 6/10 -> 5/8 (PixVerse) eşler
|
| 42 |
+
"resolution": resolution, # backend 512P/768P -> 540p/720p (PixVerse) eşler
|
| 43 |
+
"prompt_optimizer": "true" if prompt_optimizer else "false",
|
| 44 |
# prompt vermiyoruz -> backend JEWELRY_VIDEO_PROMPT (zoom yok)
|
| 45 |
}
|
| 46 |
r = requests.post(f"{API_BASE}/v1/video/from-image", data=payload, headers=HEADERS, timeout=600)
|
|
|
|
| 189 |
with colE:
|
| 190 |
run = st.button("Çalıştır", type="primary", use_container_width=True, key="run_btn")
|
| 191 |
|
| 192 |
+
# == Tuval seçenekleri ==
|
| 193 |
colT1, colT2 = st.columns([1.3, 1.0])
|
| 194 |
with colT1:
|
| 195 |
canvas_policy = st.selectbox("Tuval", ["fixed_1200","match_long_edge","keep_input"], index=0, key="canvas_policy")
|
|
|
|
| 352 |
st.warning("Video için final görsel bulunamadı.")
|
| 353 |
else:
|
| 354 |
with st.spinner("Video üretiliyor (SR kaynak)…"):
|
| 355 |
+
v = post_video(
|
| 356 |
+
src_for_video,
|
| 357 |
+
duration=st.session_state.get("duration", "6"),
|
| 358 |
+
resolution="768P", # backend mapping -> PixVerse 720p
|
| 359 |
+
prompt_optimizer=False
|
| 360 |
+
)
|
| 361 |
vurl = (v.get("result") or {}).get("video", {}).get("url")
|
| 362 |
if vurl:
|
| 363 |
st.session_state["results"]["video_url"] = vurl
|