Spaces:
Running
on
Zero
Running
on
Zero
add image_res and connect to image_size_coef
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from src.font import Font
|
|
10 |
logs_dir = "logs"
|
11 |
fonts_dir = "fonts"
|
12 |
|
13 |
-
def create_presentation(description: str, slides_num: int, language: str, num_inference_steps: int,
|
14 |
# Select the appropriate prompt configuration based on the selected language
|
15 |
if language == "English":
|
16 |
prompt_config = en_gigachat_config
|
@@ -25,6 +25,15 @@ def create_presentation(description: str, slides_num: int, language: str, num_in
|
|
25 |
|
26 |
output_dir = f'{logs_dir}/{int(time.time())}'
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
generate_presentation(
|
29 |
llm_generate=giga_generate,
|
30 |
# generate_image=api_k31_generate,
|
|
|
10 |
logs_dir = "logs"
|
11 |
fonts_dir = "fonts"
|
12 |
|
13 |
+
def create_presentation(description: str, slides_num: int, language: str, num_inference_steps: int, image_res: str):
|
14 |
# Select the appropriate prompt configuration based on the selected language
|
15 |
if language == "English":
|
16 |
prompt_config = en_gigachat_config
|
|
|
25 |
|
26 |
output_dir = f'{logs_dir}/{int(time.time())}'
|
27 |
|
28 |
+
if image_res == "192x336 & 256x256":
|
29 |
+
image_size_coef = 0.25
|
30 |
+
elif image_res == "384x672 & 512x512":
|
31 |
+
image_size_coef = 0.5
|
32 |
+
elif image_res == "576x1008 & 768x768":
|
33 |
+
image_size_coef = 0.75
|
34 |
+
else image_res == "768x1344 & 1024x1024":
|
35 |
+
image_size_coef = 1.0
|
36 |
+
|
37 |
generate_presentation(
|
38 |
llm_generate=giga_generate,
|
39 |
# generate_image=api_k31_generate,
|