Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -623,32 +623,36 @@ def generate_diagram_locally(json_data: str, diagram_type: str, output_format: s
|
|
| 623 |
##############################################################################
|
| 624 |
# โโโโโโโโโโโโโโโโโโ Prompt Templates (6 Styles) โโโโโโโโโโโโโโโโโโ
|
| 625 |
EXAMPLE_PROMPTS: dict[str, str] = {
|
| 626 |
-
|
| 627 |
"Product Design": (
|
| 628 |
-
"A sleek industrial product-design sketch.\n"
|
| 629 |
-
"{
|
| 630 |
),
|
| 631 |
"Mindmap": (
|
| 632 |
-
"A hand-drawn colorful
|
| 633 |
-
"{
|
| 634 |
),
|
| 635 |
"Mockup": (
|
| 636 |
-
"A clean hand-drawn wire-frame
|
| 637 |
-
"{
|
| 638 |
),
|
| 639 |
"Infographic": (
|
| 640 |
-
"A flat
|
| 641 |
-
"{
|
| 642 |
),
|
| 643 |
"Diagram": (
|
| 644 |
-
"A hand-drawn
|
| 645 |
-
"{
|
| 646 |
),
|
| 647 |
"Flowchart": (
|
| 648 |
-
"A vibrant hand-drawn
|
| 649 |
-
"{
|
| 650 |
),
|
| 651 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 652 |
STYLE_KEYS = list(EXAMPLE_PROMPTS.keys())
|
| 653 |
|
| 654 |
def pick_flux_style(slide_idx: int) -> str:
|
|
@@ -691,9 +695,9 @@ def generate_flux_prompt(title: str, content: str, style_key: str) -> str:
|
|
| 691 |
|
| 692 |
# 3) stylistic tail (โค120 words total)
|
| 693 |
tail = (
|
| 694 |
-
"
|
| 695 |
-
"
|
| 696 |
-
)
|
| 697 |
|
| 698 |
return f"{prompt_body}\n\n{tail}".strip()
|
| 699 |
|
|
|
|
| 623 |
##############################################################################
|
| 624 |
# โโโโโโโโโโโโโโโโโโ Prompt Templates (6 Styles) โโโโโโโโโโโโโโโโโโ
|
| 625 |
EXAMPLE_PROMPTS: dict[str, str] = {
|
|
|
|
| 626 |
"Product Design": (
|
| 627 |
+
"A sleek industrial product-design sketch showing the hierarchy below.\n"
|
| 628 |
+
"{tree}"
|
| 629 |
),
|
| 630 |
"Mindmap": (
|
| 631 |
+
"A hand-drawn, colorful MIND-MAP of the following tree (central node on the left, radial branches).\n"
|
| 632 |
+
"{tree}"
|
| 633 |
),
|
| 634 |
"Mockup": (
|
| 635 |
+
"A clean hand-drawn wire-frame mock-up โ lay out the following screens/pages as boxes and arrows.\n"
|
| 636 |
+
"{tree}"
|
| 637 |
),
|
| 638 |
"Infographic": (
|
| 639 |
+
"A flat CORPORATE INFOGRAPHIC that arranges each item below as its own icon + label.\n"
|
| 640 |
+
"{tree}"
|
| 641 |
),
|
| 642 |
"Diagram": (
|
| 643 |
+
"A hand-drawn BUSINESS-PROCESS DIAGRAM. Use swim-lanes/boxes connected by arrows following the tree below.\n"
|
| 644 |
+
"{tree}"
|
| 645 |
),
|
| 646 |
"Flowchart": (
|
| 647 |
+
"A vibrant hand-drawn FLOW-CHART. Use decision diamonds / process boxes exactly in this order:\n"
|
| 648 |
+
"{tree}"
|
| 649 |
),
|
| 650 |
}
|
| 651 |
+
|
| 652 |
+
|
| 653 |
+
|
| 654 |
+
|
| 655 |
+
|
| 656 |
STYLE_KEYS = list(EXAMPLE_PROMPTS.keys())
|
| 657 |
|
| 658 |
def pick_flux_style(slide_idx: int) -> str:
|
|
|
|
| 695 |
|
| 696 |
# 3) stylistic tail (โค120 words total)
|
| 697 |
tail = (
|
| 698 |
+
"corporate colour palette, white background, hand-drawn line style; "
|
| 699 |
+
"boxes, arrows, connectors clearly visible; high-resolution vector."
|
| 700 |
+
)
|
| 701 |
|
| 702 |
return f"{prompt_body}\n\n{tail}".strip()
|
| 703 |
|