Spaces:
PlayHT
/
Running on CPU Upgrade

1littlecoder commited on
Commit
346474a
·
verified ·
1 Parent(s): d4daed1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
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=50) # Adjust the height as needed
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