Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,25 +23,26 @@ from pydantic import BaseModel, Field
|
|
| 23 |
# ========================================
|
| 24 |
|
| 25 |
# Reddit Template Text Settings
|
|
|
|
| 26 |
REDDIT_CONFIG = {
|
| 27 |
-
'template_file': 'reddit_template.png',
|
| 28 |
-
'font_file': 'RFDewi-Bold.ttf',
|
| 29 |
-
'font_size_max': 180,
|
| 30 |
-
'font_size_min': 16,
|
| 31 |
-
'text_wrap_width': 35,
|
| 32 |
-
'text_color': 'black',
|
| 33 |
-
'line_spacing': 10,
|
| 34 |
-
'text_box_width_percent': 0.85,
|
| 35 |
-
'text_box_height_percent': 0.65,
|
| 36 |
-
'y_offset': 20,
|
| 37 |
}
|
| 38 |
|
| 39 |
# Word-by-Word Subtitle Settings
|
| 40 |
SUBTITLE_CONFIG = {
|
| 41 |
-
'font_file': 'TitanOne-Regular.ttf',
|
| 42 |
-
'font_name': 'Titan One',
|
| 43 |
-
'font_size_default': 12,
|
| 44 |
-
'position_alignment': 5,
|
| 45 |
'margin_left': 50,
|
| 46 |
'margin_right': 70,
|
| 47 |
'margin_vertical': 0,
|
|
@@ -49,12 +50,12 @@ SUBTITLE_CONFIG = {
|
|
| 49 |
|
| 50 |
# Video Processing Settings
|
| 51 |
VIDEO_CONFIG = {
|
| 52 |
-
'reddit_scale_percent': 0.75,
|
| 53 |
-
'fade_start_percent': 0.
|
| 54 |
-
'fade_end_percent': 0.
|
| 55 |
-
'promo_percent': 0.
|
| 56 |
-
'fade_color_rgb': (218, 207, 195),
|
| 57 |
-
'book_fade_in_duration': 2,
|
| 58 |
}
|
| 59 |
|
| 60 |
# ========================================
|
|
|
|
| 23 |
# ========================================
|
| 24 |
|
| 25 |
# Reddit Template Text Settings
|
| 26 |
+
Reddit Template Text Settings
|
| 27 |
REDDIT_CONFIG = {
|
| 28 |
+
'template_file': 'reddit_template.png', # Template filename in script directory
|
| 29 |
+
'font_file': 'RFDewi-Bold.ttf', # Font file for Reddit text
|
| 30 |
+
'font_size_max': 180, # Maximum font size to try
|
| 31 |
+
'font_size_min': 16, # Minimum font size (if text too long)
|
| 32 |
+
'text_wrap_width': 35, # Characters per line for wrapping
|
| 33 |
+
'text_color': 'black', # Text color
|
| 34 |
+
'line_spacing': 10, # Spacing between lines
|
| 35 |
+
'text_box_width_percent': 0.85, # 80% of template width
|
| 36 |
+
'text_box_height_percent': 0.65, # 50% of template height
|
| 37 |
+
'y_offset': 20, # Vertical offset from center
|
| 38 |
}
|
| 39 |
|
| 40 |
# Word-by-Word Subtitle Settings
|
| 41 |
SUBTITLE_CONFIG = {
|
| 42 |
+
'font_file': 'TitanOne-Regular.ttf', # Font file for subtitles (TTF or OTF)
|
| 43 |
+
'font_name': 'Titan One', # Font name as it appears in system
|
| 44 |
+
'font_size_default': 12, # Default subtitle font size
|
| 45 |
+
'position_alignment': 5, # 5 = center (1-9 numpad layout)
|
| 46 |
'margin_left': 50,
|
| 47 |
'margin_right': 70,
|
| 48 |
'margin_vertical': 0,
|
|
|
|
| 50 |
|
| 51 |
# Video Processing Settings
|
| 52 |
VIDEO_CONFIG = {
|
| 53 |
+
'reddit_scale_percent': 0.75, # Reddit template size (0.75 = 75% of video width)
|
| 54 |
+
'fade_start_percent': 0.74, # When fade to color starts (60%)
|
| 55 |
+
'fade_end_percent': 0.88, # When fully faded to color (75%)
|
| 56 |
+
'promo_percent': 0.096, # Last 10% for book cover
|
| 57 |
+
'fade_color_rgb': (218, 207, 195), # Fade color RGB
|
| 58 |
+
'book_fade_in_duration': 2, # Book cover fade-in duration (seconds)
|
| 59 |
}
|
| 60 |
|
| 61 |
# ========================================
|