MJaheen commited on
Commit
711e100
Β·
1 Parent(s): 5f8c423

add font path feature

Browse files
Files changed (3) hide show
  1. README.md +1 -0
  2. src/app.py +2 -1
  3. src/model/config.py +1 -0
README.md CHANGED
@@ -216,6 +216,7 @@ pepe_style_frog, crying with rain, emotional, dramatic lighting
216
  pepe-meme-generator/
217
  β”œβ”€β”€ src/ # Source code
218
  β”‚ β”œβ”€β”€ app.py # Main Streamlit application
 
219
  β”‚ β”œβ”€β”€ model/ # Model management
220
  β”‚ β”‚ β”œβ”€β”€ __init__.py
221
  β”‚ β”‚ β”œβ”€β”€ config.py # Model configurations
 
216
  pepe-meme-generator/
217
  β”œβ”€β”€ src/ # Source code
218
  β”‚ β”œβ”€β”€ app.py # Main Streamlit application
219
+ β”‚ β”œβ”€β”€ Fonts/ # Font files
220
  β”‚ β”œβ”€β”€ model/ # Model management
221
  β”‚ β”‚ β”œβ”€β”€ __init__.py
222
  β”‚ β”‚ β”œβ”€β”€ config.py # Model configurations
src/app.py CHANGED
@@ -256,6 +256,7 @@ def main():
256
  top_text = st.text_input("Top Text") if add_text else ""
257
  bottom_text = st.text_input("Bottom Text") if add_text else ""
258
  font_size = st.slider("Font Size", 10, 100, 40, 1)
 
259
 
260
  # Main area
261
  col1, col2 = st.columns([1, 1])
@@ -329,7 +330,7 @@ def main():
329
 
330
  # Add text if requested
331
  if add_text and (top_text or bottom_text):
332
- image = processor.add_meme_text(image, top_text, bottom_text,font_size)
333
 
334
  # Always add MJ signature
335
  image = processor.add_signature(image, signature="MJaheen", font_size=10, opacity=200)
 
256
  top_text = st.text_input("Top Text") if add_text else ""
257
  bottom_text = st.text_input("Bottom Text") if add_text else ""
258
  font_size = st.slider("Font Size", 10, 100, 40, 1)
259
+ font_path = config.FONT_PATH
260
 
261
  # Main area
262
  col1, col2 = st.columns([1, 1])
 
330
 
331
  # Add text if requested
332
  if add_text and (top_text or bottom_text):
333
+ image = processor.add_meme_text(image, top_text, bottom_text,font_size,font_path)
334
 
335
  # Always add MJ signature
336
  image = processor.add_signature(image, signature="MJaheen", font_size=10, opacity=200)
src/model/config.py CHANGED
@@ -111,6 +111,7 @@ class ModelConfig:
111
  LORA_PATH: str = "MJaheen/Pepe_The_Frog_model_v1_lora"
112
  USE_LORA: bool = True
113
  TRIGGER_WORD: str = "pepe_style_frog"
 
114
 
115
  # LCM settings
116
  USE_LCM: bool = False
 
111
  LORA_PATH: str = "MJaheen/Pepe_The_Frog_model_v1_lora"
112
  USE_LORA: bool = True
113
  TRIGGER_WORD: str = "pepe_style_frog"
114
+ FONT_PATH: str = "src/Fonts/impact.ttf"
115
 
116
  # LCM settings
117
  USE_LCM: bool = False