Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -909,7 +909,7 @@ def show_sidebar():
|
|
| 909 |
# Video "How It Works" - only on video tab
|
| 910 |
st.markdown("---")
|
| 911 |
st.markdown("#### βΉοΈ How Video Credits Work")
|
| 912 |
-
st.markdown("- π¬
|
| 913 |
st.markdown("- π³ Buy credits for custom videos & more generations")
|
| 914 |
st.markdown("- ποΈ **Each credit is tied to the FPS tier you purchased**")
|
| 915 |
st.markdown("- π To use 24fps, buy credits with 24fps addon")
|
|
@@ -928,7 +928,7 @@ def show_sidebar():
|
|
| 928 |
col1, col2 = st.columns(2)
|
| 929 |
|
| 930 |
st.markdown("#### π Audio Credit Packages")
|
| 931 |
-
st.info("π **Start FREE!** Get
|
| 932 |
|
| 933 |
st.markdown("**Available Packages:**")
|
| 934 |
st.markdown("- π΅ **Music with Lyrics**: $7.50 (up to 3 min)")
|
|
@@ -944,7 +944,7 @@ def show_sidebar():
|
|
| 944 |
# Audio "How It Works" - only on audio tabs
|
| 945 |
st.markdown("---")
|
| 946 |
st.markdown("#### βΉοΈ How Audio Credits Work")
|
| 947 |
-
st.markdown("- π **
|
| 948 |
st.markdown("- π³ **Credits charged per generation**")
|
| 949 |
st.markdown("- β±οΈ **1 credit = any duration** up to 3 minutes")
|
| 950 |
st.markdown("- π΅ **With or without lyrics** - same credit cost")
|
|
@@ -1778,15 +1778,23 @@ def display_audio_with_controls(audio_bytes, subscription_status, location="main
|
|
| 1778 |
):
|
| 1779 |
st.success("β
Download started!", icon="β
")
|
| 1780 |
else:
|
| 1781 |
-
# Downloads available
|
| 1782 |
-
|
| 1783 |
-
|
| 1784 |
-
|
| 1785 |
-
|
| 1786 |
-
|
| 1787 |
-
|
| 1788 |
-
|
| 1789 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1790 |
|
| 1791 |
with col2:
|
| 1792 |
# User dashboard saving removed - only admin auto-save is active
|
|
@@ -4069,12 +4077,10 @@ with generation_tab3:
|
|
| 4069 |
# Check 3: Preset mode warning for free users
|
| 4070 |
if not is_custom_mode and video_credits:
|
| 4071 |
free_remaining = video_credits.get('free_generations_remaining', 0)
|
| 4072 |
-
if free_remaining ==
|
| 4073 |
-
st.info(f"π Using free preset generation
|
| 4074 |
-
elif free_remaining == 1:
|
| 4075 |
-
st.warning(f"β οΈ Using your LAST free preset generation (2/2) - Purchase credits to continue after this!")
|
| 4076 |
elif free_remaining == 0:
|
| 4077 |
-
st.error(f"π You've used
|
| 4078 |
|
| 4079 |
# Generation Button - Label changes based on mode and eligibility
|
| 4080 |
if generation_mode == "π΅ Jingle + Video":
|
|
|
|
| 909 |
# Video "How It Works" - only on video tab
|
| 910 |
st.markdown("---")
|
| 911 |
st.markdown("#### βΉοΈ How Video Credits Work")
|
| 912 |
+
st.markdown("- π¬ 1 free preset video generation")
|
| 913 |
st.markdown("- π³ Buy credits for custom videos & more generations")
|
| 914 |
st.markdown("- ποΈ **Each credit is tied to the FPS tier you purchased**")
|
| 915 |
st.markdown("- π To use 24fps, buy credits with 24fps addon")
|
|
|
|
| 928 |
col1, col2 = st.columns(2)
|
| 929 |
|
| 930 |
st.markdown("#### π Audio Credit Packages")
|
| 931 |
+
st.info("π **Start FREE!** Get 1 free sample on [Generate for Free](https://songlabai.com/generate-music-free/) page")
|
| 932 |
|
| 933 |
st.markdown("**Available Packages:**")
|
| 934 |
st.markdown("- π΅ **Music with Lyrics**: $7.50 (up to 3 min)")
|
|
|
|
| 944 |
# Audio "How It Works" - only on audio tabs
|
| 945 |
st.markdown("---")
|
| 946 |
st.markdown("#### βΉοΈ How Audio Credits Work")
|
| 947 |
+
st.markdown("- π **1 free sample** (available on [Generate for Free](https://songlabai.com/generate-music-free/) page)")
|
| 948 |
st.markdown("- π³ **Credits charged per generation**")
|
| 949 |
st.markdown("- β±οΈ **1 credit = any duration** up to 3 minutes")
|
| 950 |
st.markdown("- π΅ **With or without lyrics** - same credit cost")
|
|
|
|
| 1778 |
):
|
| 1779 |
st.success("β
Download started!", icon="β
")
|
| 1780 |
else:
|
| 1781 |
+
# Downloads available for credit purchasers only (Streamlit is paid-only)
|
| 1782 |
+
remaining_credits = subscription_status.get('remaining_credits', 0)
|
| 1783 |
+
|
| 1784 |
+
if remaining_credits > 0 or subscription_status.get('total_credits', 0) > 0:
|
| 1785 |
+
# User has purchased credits - allow download
|
| 1786 |
+
if st.download_button(
|
| 1787 |
+
label="β¬οΈ Download Audio",
|
| 1788 |
+
data=audio_bytes,
|
| 1789 |
+
file_name=f"songlab_track_{location}.wav",
|
| 1790 |
+
mime="audio/wav",
|
| 1791 |
+
key=f"download_btn_{location}"
|
| 1792 |
+
):
|
| 1793 |
+
st.success("β
Download started!", icon="β
")
|
| 1794 |
+
else:
|
| 1795 |
+
# No credits purchased - block download
|
| 1796 |
+
st.button("π Download (Purchase Credits Required)", disabled=True, key=f"download_btn_{location}")
|
| 1797 |
+
st.info("π‘ Download is included with credit purchases. Visit [Pricing Page](https://songlabai.com/credit-pricing/) to buy credits.")
|
| 1798 |
|
| 1799 |
with col2:
|
| 1800 |
# User dashboard saving removed - only admin auto-save is active
|
|
|
|
| 4077 |
# Check 3: Preset mode warning for free users
|
| 4078 |
if not is_custom_mode and video_credits:
|
| 4079 |
free_remaining = video_credits.get('free_generations_remaining', 0)
|
| 4080 |
+
if free_remaining == 1:
|
| 4081 |
+
st.info(f"π Using your 1 free preset generation - Purchase credits to continue after this!")
|
|
|
|
|
|
|
| 4082 |
elif free_remaining == 0:
|
| 4083 |
+
st.error(f"π You've used your 1 free generation - Purchase credits to continue")
|
| 4084 |
|
| 4085 |
# Generation Button - Label changes based on mode and eligibility
|
| 4086 |
if generation_mode == "π΅ Jingle + Video":
|