dream2589632147 commited on
Commit
ad595d0
·
verified ·
1 Parent(s): 24bb430

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -13
app.py CHANGED
@@ -145,10 +145,8 @@ def get_duration(
145
  duration_seconds, guidance_scale, guidance_scale_2,
146
  seed, randomize_seed, progress,
147
  ):
148
- # --- CRITICAL FIX: Handle NoneType for input_image ---
149
  if input_image is None:
150
- return 120 # Return default duration if image is missing to prevent crash
151
- # -----------------------------------------------------
152
  BASE_FRAMES_HEIGHT_WIDTH = 81 * 832 * 624
153
  BASE_STEP_DURATION = 15
154
 
@@ -205,7 +203,7 @@ def generate_video(
205
  # =========================================================
206
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
207
 
208
- # --- ADVERTISEMENT BANNER FOR DREAM HUB PRO ---
209
  gr.HTML("""
210
  <div style="background: linear-gradient(90deg, #4f46e5, #9333ea); color: white; padding: 15px; border-radius: 10px; text-align: center; margin-bottom: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);">
211
  <div style="display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap;">
@@ -222,23 +220,40 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
222
  </div>
223
  """)
224
 
225
- # --- NEW: PROFESSIONAL YOUTUBE CHANNEL BANNER ---
 
226
  gr.HTML("""
227
- <div style="background: linear-gradient(90deg, #cc0000, #ff0000); color: white; padding: 12px; border-radius: 10px; text-align: center; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(255,0,0,0.2);">
228
- <div style="display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap;">
229
- <div style="display: flex; align-items: center; gap: 10px;">
230
- <span style="font-size: 28px;">▶️</span>
 
 
231
  <div style="text-align: left;">
232
- <h3 style="margin: 0; font-weight: bold; font-size: 18px;">Imagination Engineering</h3>
233
- <p style="margin: 2px 0 0 0; opacity: 0.9; font-size: 13px;">Tutorials, AI Engineering & Creative Tech</p>
234
  </div>
235
  </div>
236
  <a href="https://www.youtube.com/@ImaginationEngineering" target="_blank" style="text-decoration: none;">
237
- <button style="background-color: white; color: #cc0000; border: none; padding: 8px 25px; border-radius: 25px; font-weight: bold; cursor: pointer; transition: transform 0.2s; font-size: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.2);">
238
- Subscribe & Watch 📺
239
  </button>
240
  </a>
241
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  </div>
243
  """)
244
  # ---------------------------------------------
 
145
  duration_seconds, guidance_scale, guidance_scale_2,
146
  seed, randomize_seed, progress,
147
  ):
 
148
  if input_image is None:
149
+ return 120
 
150
  BASE_FRAMES_HEIGHT_WIDTH = 81 * 832 * 624
151
  BASE_STEP_DURATION = 15
152
 
 
203
  # =========================================================
204
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
205
 
206
+ # --- TOP ADVERTISEMENT BANNER ---
207
  gr.HTML("""
208
  <div style="background: linear-gradient(90deg, #4f46e5, #9333ea); color: white; padding: 15px; border-radius: 10px; text-align: center; margin-bottom: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);">
209
  <div style="display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap;">
 
220
  </div>
221
  """)
222
 
223
+ # --- PROFESSIONAL YOUTUBE EMBED SECTION ---
224
+ # This section now includes the embedded video as an expert display
225
  gr.HTML("""
226
+ <div style="background: linear-gradient(135deg, #b90000 0%, #ff0000 100%); color: white; padding: 25px; border-radius: 16px; text-align: center; margin-bottom: 25px; box-shadow: 0 10px 30px rgba(185, 0, 0, 0.3);">
227
+ <div style="display: flex; align-items: center; justify-content: center; gap: 25px; flex-wrap: wrap; margin-bottom: 20px;">
228
+ <div style="display: flex; align-items: center; gap: 15px;">
229
+ <div style="background: white; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 8px rgba(0,0,0,0.2);">
230
+ <span style="font-size: 24px;">▶️</span>
231
+ </div>
232
  <div style="text-align: left;">
233
+ <h3 style="margin: 0; font-weight: 800; font-size: 22px; letter-spacing: 0.5px;">Imagination Engineering</h3>
234
+ <p style="margin: 4px 0 0 0; opacity: 0.95; font-size: 14px; font-weight: 400;">Mastering AI & Creative Tech</p>
235
  </div>
236
  </div>
237
  <a href="https://www.youtube.com/@ImaginationEngineering" target="_blank" style="text-decoration: none;">
238
+ <button style="background-color: white; color: #cc0000; border: none; padding: 10px 28px; border-radius: 30px; font-weight: 700; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; font-size: 15px; box-shadow: 0 4px 12px rgba(0,0,0,0.2);">
239
+ SUBSCRIBE & WATCH 📺
240
  </button>
241
  </a>
242
  </div>
243
+
244
+ <!-- VIDEO EMBED CONTAINER -->
245
+ <div style="width: 100%; max-width: 650px; margin: 0 auto; border-radius: 12px; overflow: hidden; box-shadow: 0 15px 40px rgba(0,0,0,0.4); border: 4px solid rgba(255,255,255,0.15);">
246
+ <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
247
+ <iframe
248
+ src="https://www.youtube.com/embed/w_7wL_i3f1k?rel=0&modestbranding=1"
249
+ style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
250
+ frameborder="0"
251
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
252
+ allowfullscreen
253
+ title="Imagination Engineering Feature">
254
+ </iframe>
255
+ </div>
256
+ </div>
257
  </div>
258
  """)
259
  # ---------------------------------------------