Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
1littlecoder
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,11 @@ genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
|
|
11 |
API_KEY = os.getenv('PLAY_API_KEY')
|
12 |
USER_ID = os.getenv('PLAY_USER_ID')
|
13 |
|
|
|
|
|
|
|
|
|
|
|
14 |
# Theme selection
|
15 |
theme = gr.themes.Base(
|
16 |
primary_hue="emerald",
|
@@ -82,7 +87,7 @@ def create_video(image, audio):
|
|
82 |
image_clip = ImageClip(image).set_duration(audio_clip.duration)
|
83 |
|
84 |
# Load the logo image, resize it, and position it in the top-right corner
|
85 |
-
logo = ImageClip("Logo.png").resize(height=
|
86 |
logo = logo.set_position(("right", "top")).set_duration(audio_clip.duration)
|
87 |
|
88 |
# Create a composite video with the main image and the logo overlay
|
|
|
11 |
API_KEY = os.getenv('PLAY_API_KEY')
|
12 |
USER_ID = os.getenv('PLAY_USER_ID')
|
13 |
|
14 |
+
# Ensure compatibility with updated PIL library
|
15 |
+
if not hasattr(Image, 'ANTIALIAS'): # Image.ANTIALIAS is deprecated; LANCZOS is the replacement
|
16 |
+
Image.ANTIALIAS = Image.LANCZOS
|
17 |
+
|
18 |
+
|
19 |
# Theme selection
|
20 |
theme = gr.themes.Base(
|
21 |
primary_hue="emerald",
|
|
|
87 |
image_clip = ImageClip(image).set_duration(audio_clip.duration)
|
88 |
|
89 |
# Load the logo image, resize it, and position it in the top-right corner
|
90 |
+
logo = ImageClip("Logo.png").resize(height=100) # Adjust the height as needed
|
91 |
logo = logo.set_position(("right", "top")).set_duration(audio_clip.duration)
|
92 |
|
93 |
# Create a composite video with the main image and the logo overlay
|