ovi054 commited on
Commit
83f3310
·
verified ·
1 Parent(s): c093ae7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -209,25 +209,25 @@ class ManimAnimationGenerator:
209
  return None, f"❌ Validation Error: {message}", ""
210
 
211
  # Dynamically inject portrait (9:16) config
212
- portrait_config = """
213
- from manim import config
214
- # Maintain chosen quality while forcing 9:16 aspect ratio
215
- if config["pixel_height"] == 480:
216
- config.pixel_height = 854 # low
217
- config.pixel_width = 480
218
- elif config["pixel_height"] == 720:
219
- config.pixel_height = 1280 # medium
220
- config.pixel_width = 720
221
- elif config["pixel_height"] == 1080:
222
- config.pixel_height = 1920 # high
223
- config.pixel_width = 1080
224
- else:
225
- config.pixel_height = 854
226
- config.pixel_width = 480
227
-
228
- config.frame_height = 16
229
- config.frame_width = 9
230
- """
231
 
232
  code = portrait_config + "\n" + code
233
 
 
209
  return None, f"❌ Validation Error: {message}", ""
210
 
211
  # Dynamically inject portrait (9:16) config
212
+ portrait_config = (
213
+ "from manim import config\n"
214
+ "# Maintain chosen quality while forcing 9:16 aspect ratio\n"
215
+ "if config.pixel_height == 480:\n"
216
+ " config.pixel_height = 854 # low\n"
217
+ " config.pixel_width = 480\n"
218
+ "elif config.pixel_height == 720:\n"
219
+ " config.pixel_height = 1280 # medium\n"
220
+ " config.pixel_width = 720\n"
221
+ "elif config.pixel_height == 1080:\n"
222
+ " config.pixel_height = 1920 # high\n"
223
+ " config.pixel_width = 1080\n"
224
+ "else:\n"
225
+ " config.pixel_height = 854\n"
226
+ " config.pixel_width = 480\n"
227
+ "config.frame_height = 16\n"
228
+ "config.frame_width = 9\n"
229
+ )
230
+
231
 
232
  code = portrait_config + "\n" + code
233