Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -621,13 +621,34 @@ def generate_diagram_locally(json_data: str, diagram_type: str, output_format: s
|
|
| 621 |
##############################################################################
|
| 622 |
def generate_flux_prompt(title: str, content: str) -> str:
|
| 623 |
"""슬라이드 내용을 기반으로 FLUX 이미지 프롬프트 생성"""
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
system_prompt = """You are
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 631 |
|
| 632 |
messages = [
|
| 633 |
{"role": "system", "content": system_prompt},
|
|
|
|
| 621 |
##############################################################################
|
| 622 |
def generate_flux_prompt(title: str, content: str) -> str:
|
| 623 |
"""슬라이드 내용을 기반으로 FLUX 이미지 프롬프트 생성"""
|
| 624 |
+
|
| 625 |
+
# ─────────────── AFTER (강화 버전) ───────────────
|
| 626 |
+
system_prompt = """You are a senior information-visualisation designer crafting prompts for the FLUX model.
|
| 627 |
+
Your task: turn ONE PowerPoint slide (title + exactly five bullet points) into a **diagram-style graphic** that mirrors the slide’s logic, hierarchy and wording.
|
| 628 |
+
|
| 629 |
+
Strict rules
|
| 630 |
+
1. Auto-select the ideal diagram type:
|
| 631 |
+
• sequential verbs / stages → Flowchart / Timeline
|
| 632 |
+
• branching themes → Mind-map / Radial
|
| 633 |
+
• numeric comparisons → Flat Infographic with bars, pies or lines
|
| 634 |
+
• UI / feature lists → Wire-frame or Product Sketch
|
| 635 |
+
2. Map **every bullet point** to a labelled node/segment; keep their original order.
|
| 636 |
+
3. Use explicit connectors: arrows “→”, tree branches “├──”, swim-lane boxes, or chart axes as appropriate.
|
| 637 |
+
4. Embed short node labels **verbatim** from bullets (≤ 4 words each).
|
| 638 |
+
5. If a bullet contains numbers, reflect them in the graphic (e.g. “45 %” in a pie slice).
|
| 639 |
+
6. Optional icon cues in square brackets, e.g. [Gear Icon], only when they aid comprehension.
|
| 640 |
+
7. Finish with a succinct style cue: colour palette (e.g. “cool blues & greys”), line style (“hand-drawn sketch” or “sleek vector”), whitespace preference.
|
| 641 |
+
8. ≤ 120 words, English, no markdown, no commentary – **output the prompt text only**.
|
| 642 |
+
|
| 643 |
+
Mini-examples
|
| 644 |
+
• “Sleek industrial **product design** sketch: coffee-machine, curved metal body, touchscreen, matte-black, hand-drawn concept lines.”
|
| 645 |
+
• “Hand-drawn colourful **mind-map**: KNOWLEDGE centre → ACQUISITION (Reading, Practice, Observation) … pastel palette.”
|
| 646 |
+
• “Clean hand-drawn **wire-frame mock-up** for mobile banking app: title, login, dashboard (balance|transactions|quick-actions), bottom nav … monochrome sketch lines.”
|
| 647 |
+
• “Flat corporate **infographic** ‘Global Renewable Energy Trends 2025’: stacked bar Solar|Wind|Hydro across 5 regions, pie Solar 45 % … teal-orange palette.”
|
| 648 |
+
• “Detailed hand-drawn **business process diagram**: Market Analysis → Strategy → Design → Implementation → Review, directional arrows, icons (magnifying-glass, lightbulb, gear) … vibrant educational style.”
|
| 649 |
+
• “Vibrant hand-drawn **flowchart** BUSINESS WORKFLOW: START → Collect Requirements → Analyze Data → Implementation (Frontend | Backend) → Test & Integration → DEPLOY → END … minimal icons, colour-coded nodes.”"""
|
| 650 |
+
|
| 651 |
+
|
| 652 |
|
| 653 |
messages = [
|
| 654 |
{"role": "system", "content": system_prompt},
|