Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
#!/usr/bin/env python
|
| 2 |
|
| 3 |
import os
|
| 4 |
import re
|
|
@@ -350,68 +349,115 @@ def get_emoji_for_content(text: str) -> str:
|
|
| 350 |
return 'โถ๏ธ'
|
| 351 |
|
| 352 |
##############################################################################
|
| 353 |
-
# Diagram
|
| 354 |
##############################################################################
|
| 355 |
-
|
| 356 |
-
""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 357 |
combined_text = f"{title} {content}".lower()
|
| 358 |
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
if any(word in combined_text for word in ['๋จ๊ณ', 'step', 'flow', 'ํ๋ฆ']):
|
| 372 |
-
diagram_scores["Process Flow"] += 2
|
| 373 |
-
if any(word in combined_text for word in ['์ํฌํ๋ก์ฐ', 'workflow', '์์', 'sequence']):
|
| 374 |
-
diagram_scores["Process Flow"] += 2
|
| 375 |
-
|
| 376 |
-
# WBS keywords with weights
|
| 377 |
-
if any(word in combined_text for word in ['wbs', '์์
๋ถํด', 'ํ๋ก์ ํธ', 'project']):
|
| 378 |
-
diagram_scores["WBS Diagram"] += 3
|
| 379 |
-
if any(word in combined_text for word in ['์
๋ฌด๋ถํด', 'breakdown', '๊ตฌ์กฐ๋', '์์
๊ตฌ์กฐ']):
|
| 380 |
-
diagram_scores["WBS Diagram"] += 2
|
| 381 |
-
|
| 382 |
-
# Concept Map keywords with weights
|
| 383 |
-
if any(word in combined_text for word in ['๊ฐ๋
', 'concept', '๊ด๊ณ', 'relationship']):
|
| 384 |
-
diagram_scores["Concept Map"] += 3
|
| 385 |
-
if any(word in combined_text for word in ['์ฐ๊ด', 'connection', '๋ง์ธ๋๋งต', 'mindmap']):
|
| 386 |
-
diagram_scores["Concept Map"] += 2
|
| 387 |
-
if any(word in combined_text for word in ['๊ตฌ์กฐ', 'structure', '์ฒด๊ณ', 'system']):
|
| 388 |
-
diagram_scores["Concept Map"] += 1
|
| 389 |
-
|
| 390 |
-
# Radial Diagram keywords with weights
|
| 391 |
-
if any(word in combined_text for word in ['์ค์ฌ', 'central', '๋ฐฉ์ฌํ', 'radial']):
|
| 392 |
-
diagram_scores["Radial Diagram"] += 3
|
| 393 |
-
if any(word in combined_text for word in ['ํต์ฌ', 'core', '์ฃผ์', 'main']):
|
| 394 |
-
diagram_scores["Radial Diagram"] += 2
|
| 395 |
-
|
| 396 |
-
# Synoptic Chart keywords with weights
|
| 397 |
-
if any(word in combined_text for word in ['๊ฐ์', 'overview', '์ ์ฒด', 'overall']):
|
| 398 |
-
diagram_scores["Synoptic Chart"] += 3
|
| 399 |
-
if any(word in combined_text for word in ['์์ฝ', 'summary', '์๋ํฑ', 'synoptic']):
|
| 400 |
-
diagram_scores["Synoptic Chart"] += 2
|
| 401 |
-
|
| 402 |
-
# ์ถ๊ฐ ์ ์ ๋ถ์ฌ: ๋ฆฌ์คํธ๋ ๊ตฌ์กฐํ๋ ๋ด์ฉ์ด ๋ง์ ๊ฒฝ์ฐ
|
| 403 |
-
if content.count('\n-') > 3 or content.count('\nโข') > 3:
|
| 404 |
-
diagram_scores["Concept Map"] += 1
|
| 405 |
-
if any(char in content for char in ['1.', '2.', '3.', 'โ ', 'โก', 'โข']):
|
| 406 |
-
diagram_scores["Process Flow"] += 1
|
| 407 |
-
|
| 408 |
-
# ๊ฐ์ฅ ๋์ ์ ์์ ๋ค์ด์ด๊ทธ๋จ ํ์
์ ํ
|
| 409 |
-
max_score = max(diagram_scores.values())
|
| 410 |
-
if max_score > 0:
|
| 411 |
-
best_type = max(diagram_scores.items(), key=lambda x: x[1])[0]
|
| 412 |
-
# ํ์๋ ์ ์ ๊ณ์ฐ (0-1 ๋ฒ์)
|
| 413 |
-
necessity_score = min(max_score / 5.0, 1.0) # ์ต๋ 5์ ์ 1.0์ผ๋ก ์ ๊ทํ
|
| 414 |
-
return best_type, necessity_score
|
| 415 |
|
| 416 |
return None, 0.0
|
| 417 |
|
|
@@ -2392,12 +2438,13 @@ def generate_ppt(
|
|
| 2392 |
|
| 2393 |
# AI ์ด๋ฏธ์ง ๋ฐ ๋ค์ด์ด๊ทธ๋จ ์์ฑ ์๋ฆผ
|
| 2394 |
visual_features = []
|
| 2395 |
-
if include_ai_image and
|
| 2396 |
visual_features.append("AI 3D ํ์ง ์ด๋ฏธ์ง")
|
| 2397 |
if include_diagrams and DIAGRAM_GENERATORS_AVAILABLE:
|
| 2398 |
-
visual_features.append("๋ค์ด์ด๊ทธ๋จ (์ต๋ 2๊ฐ)")
|
| 2399 |
if include_flux_images and FLUX_API_ENABLED:
|
| 2400 |
-
visual_features.append("
|
|
|
|
| 2401 |
|
| 2402 |
if visual_features:
|
| 2403 |
yield None, f"๐ ์ฌ๋ผ์ด๋ ์์ฑ ์๋ฃ!\n\n๐จ ์์ฑ ์ค: {', '.join(visual_features)}... (์๊ฐ์ด ์์๋ ์ ์์ต๋๋ค)", llm_response
|
|
@@ -2419,12 +2466,14 @@ def generate_ppt(
|
|
| 2419 |
success_msg += f"๐จ ๋์์ธ ํ
๋ง: {DESIGN_THEMES[design_theme]['name']}\n"
|
| 2420 |
success_msg += f"๐ ๋ ์ด์์ ์คํ์ผ: {layout_style}\n"
|
| 2421 |
|
| 2422 |
-
if include_ai_image and
|
| 2423 |
-
success_msg += f"๐ผ๏ธ AI ์์ฑ ํ์ง ์ด๋ฏธ์ง ํฌํจ\n"
|
|
|
|
|
|
|
| 2424 |
if include_diagrams and DIAGRAM_GENERATORS_AVAILABLE:
|
| 2425 |
-
success_msg += f"
|
| 2426 |
if include_flux_images and FLUX_API_ENABLED:
|
| 2427 |
-
success_msg += f"๐จ AI ์์ฑ ์ฌ๋ผ์ด๋ ์ด๋ฏธ์ง
|
| 2428 |
|
| 2429 |
success_msg += f"๐ ์์ฑ๋ ์ฌ๋ผ์ด๋:\n"
|
| 2430 |
|
|
@@ -2742,7 +2791,7 @@ with gr.Blocks(css=css, title="AI PPT Generator Pro") as demo:
|
|
| 2742 |
include_diagrams = gr.Checkbox(
|
| 2743 |
label="๐ AI ๋ค์ด์ด๊ทธ๋จ",
|
| 2744 |
value=False,
|
| 2745 |
-
info="
|
| 2746 |
)
|
| 2747 |
|
| 2748 |
include_flux_images = gr.Checkbox(
|
|
@@ -2797,17 +2846,26 @@ with gr.Blocks(css=css, title="AI PPT Generator Pro") as demo:
|
|
| 2797 |
5. **์ฐธ๊ณ ์๋ฃ ์
๋ก๋**: PDF, CSV, TXT ํ์ผ ์ง์
|
| 2798 |
6. **์์ฑ ๋ฒํผ ํด๋ฆญ**: AI๊ฐ ์๋์ผ๋ก PPT ์์ฑ
|
| 2799 |
|
| 2800 |
-
### ๐จ
|
| 2801 |
-
-
|
| 2802 |
-
-
|
| 2803 |
-
-
|
| 2804 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2805 |
|
| 2806 |
### ๐ก ๊ณ ๊ธ ํ
|
| 2807 |
-
-
|
| 2808 |
-
-
|
| 2809 |
-
-
|
| 2810 |
-
-
|
| 2811 |
"""
|
| 2812 |
)
|
| 2813 |
|
|
@@ -2848,12 +2906,12 @@ with gr.Blocks(css=css, title="AI PPT Generator Pro") as demo:
|
|
| 2848 |
|
| 2849 |
# Initialize APIs on startup
|
| 2850 |
if __name__ == "__main__":
|
| 2851 |
-
# ํ๊ธ ํฐํธ ํ์ธ
|
| 2852 |
if os.path.exists(KOREAN_FONT_PATH):
|
| 2853 |
logger.info(f"โ
ํ๊ธ ํฐํธ ํ์ผ์ ์ฐพ์์ต๋๋ค: {KOREAN_FONT_PATH}")
|
| 2854 |
else:
|
| 2855 |
logger.warning(f"โ ๏ธ ํ๊ธ ํฐํธ ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค: {KOREAN_FONT_PATH}")
|
| 2856 |
-
logger.warning("๋ค์ด์ด๊ทธ๋จ์์ ํ๊ธ์ด ๊นจ์ง ์ ์์ต๋๋ค. NanumGothic-Regular.ttf ํ์ผ์ app.py์ ๊ฐ์ ๊ฒฝ๋ก์ ๋ฐฐ์นํ์ธ์.")
|
| 2857 |
|
| 2858 |
# Try to initialize APIs in parallel
|
| 2859 |
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
|
|
@@ -2872,9 +2930,13 @@ if __name__ == "__main__":
|
|
| 2872 |
|
| 2873 |
# ๋ค์ด์ด๊ทธ๋จ ์์ฑ๊ธฐ ๋ชจ๋ ์ํ ํ์ธ
|
| 2874 |
if DIAGRAM_GENERATORS_AVAILABLE:
|
| 2875 |
-
logger.info("โ
๋ค์ด์ด๊ทธ๋จ ์์ฑ๊ธฐ ๋ชจ๋์ด ์ ์์ ์ผ๋ก ๋ก๋๋์์ต๋๋ค")
|
| 2876 |
-
logger.info("
|
| 2877 |
else:
|
| 2878 |
-
logger.warning("โ ๏ธ ๋ค์ด์ด๊ทธ๋จ ์์ฑ๊ธฐ ๋ชจ๋์ ์ฐพ์ ์ ์์ต๋๋ค.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2879 |
|
| 2880 |
demo.launch()
|
|
|
|
|
|
|
| 1 |
|
| 2 |
import os
|
| 3 |
import re
|
|
|
|
| 349 |
return 'โถ๏ธ'
|
| 350 |
|
| 351 |
##############################################################################
|
| 352 |
+
# FLUX Diagram Types and Prompts
|
| 353 |
##############################################################################
|
| 354 |
+
FLUX_DIAGRAM_TYPES = {
|
| 355 |
+
"Flowchart": {
|
| 356 |
+
"keywords": ['ํ๋ก์ธ์ค', 'process', '์ ์ฐจ', 'procedure', '๋จ๊ณ', 'step', 'flow', 'ํ๋ฆ', '์ํฌํ๋ก์ฐ', 'workflow'],
|
| 357 |
+
"priority": 5, # ๋์ ์ฐ์ ์์
|
| 358 |
+
"prompt_template": """A hand-drawn style flowchart, vibrant colors, minimalistic icons.
|
| 359 |
+
{title}
|
| 360 |
+
START [Green Button ~40px]
|
| 361 |
+
โโโ {step1} [Relevant Icon]
|
| 362 |
+
โโโ {step2} [Relevant Icon]
|
| 363 |
+
โโโ {step3} [Relevant Icon]
|
| 364 |
+
โโโ END [Checkered Flag ~40px]
|
| 365 |
+
Professional business style, clear hierarchy, modern design"""
|
| 366 |
+
},
|
| 367 |
+
"Mindmap": {
|
| 368 |
+
"keywords": ['๊ฐ๋
', 'concept', '๊ด๊ณ', 'relationship', '๋ง์ธ๋๋งต', 'mindmap', '์ฐ๊ด', 'connection'],
|
| 369 |
+
"priority": 4,
|
| 370 |
+
"prompt_template": """A handrawn colorful mind map diagram, educational style, vibrant colors, clear hierarchy.
|
| 371 |
+
{title}
|
| 372 |
+
โโโ {branch1} [Relevant Icon ~60px]
|
| 373 |
+
โ โโโ {sub1_1}
|
| 374 |
+
โ โโโ {sub1_2}
|
| 375 |
+
โโโ {branch2} [Relevant Icon ~50px]
|
| 376 |
+
โ โโโ {sub2_1}
|
| 377 |
+
โ โโโ {sub2_2}
|
| 378 |
+
โโโ {branch3} [Relevant Icon ~45px]
|
| 379 |
+
Modern business presentation style"""
|
| 380 |
+
},
|
| 381 |
+
"Infographic": {
|
| 382 |
+
"keywords": ['๋ฐ์ดํฐ', 'data', 'ํต๊ณ', 'statistics', '๋ถ์', 'analysis', '์ฐจํธ', 'chart', '๊ทธ๋ํ', 'graph'],
|
| 383 |
+
"priority": 4,
|
| 384 |
+
"prompt_template": """A sophisticated flat-style infographic for business presentation:
|
| 385 |
+
Title: "{title}"
|
| 386 |
+
Visual Elements:
|
| 387 |
+
- Bar charts comparing key metrics
|
| 388 |
+
- Pie chart showing distribution
|
| 389 |
+
- Trend lines indicating growth
|
| 390 |
+
- Modern minimalist icons
|
| 391 |
+
- Clean grid layout with pastel accents
|
| 392 |
+
Professional corporate design, data visualization focus"""
|
| 393 |
+
},
|
| 394 |
+
"Diagram": {
|
| 395 |
+
"keywords": ['๊ตฌ์กฐ', 'structure', '์ฒด๊ณ', 'system', '๊ด๊ณ๋', 'diagram', '๋ชจ๋ธ', 'model'],
|
| 396 |
+
"priority": 3,
|
| 397 |
+
"prompt_template": """A detailed hand-drawn business diagram:
|
| 398 |
+
Title: "{title}"
|
| 399 |
+
Components:
|
| 400 |
+
- Clear visual hierarchy
|
| 401 |
+
- Connected elements with arrows
|
| 402 |
+
- Modern iconography
|
| 403 |
+
- Color-coded sections
|
| 404 |
+
- Professional annotations
|
| 405 |
+
Clean business presentation style"""
|
| 406 |
+
},
|
| 407 |
+
"Mockup": {
|
| 408 |
+
"keywords": ['๋์์ธ', 'design', 'ui', 'ux', 'ํ๋ฉด', 'screen', '์ธํฐํ์ด์ค', 'interface', '์ฑ', 'app'],
|
| 409 |
+
"priority": 3,
|
| 410 |
+
"prompt_template": """A clean hand-drawn style wireframe:
|
| 411 |
+
{title}
|
| 412 |
+
- Main screen layout
|
| 413 |
+
- Key UI elements
|
| 414 |
+
- Navigation structure
|
| 415 |
+
- User flow indicators
|
| 416 |
+
Modern app design mockup style"""
|
| 417 |
+
},
|
| 418 |
+
"Product Design": {
|
| 419 |
+
"keywords": ['์ ํ', 'product', '๋์์ธ', 'design', '์ปจ์
', 'concept', '์์ด๋์ด', 'idea'],
|
| 420 |
+
"priority": 2,
|
| 421 |
+
"prompt_template": """A sleek design concept:
|
| 422 |
+
{title}
|
| 423 |
+
- Modern aesthetic design
|
| 424 |
+
- Key features highlighted
|
| 425 |
+
- Professional sketch style
|
| 426 |
+
- Innovation focused
|
| 427 |
+
Clean product presentation"""
|
| 428 |
+
}
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
##############################################################################
|
| 432 |
+
# Diagram Type Detection with FLUX Priority
|
| 433 |
+
##############################################################################
|
| 434 |
+
def detect_flux_diagram_type(title: str, content: str) -> Tuple[Optional[str], float]:
|
| 435 |
+
"""FLUX ๋ค์ด์ด๊ทธ๋จ ํ์
๊ฐ์ง ๋ฐ ์ฐ์ ์์ ์ ์ ๊ณ์ฐ"""
|
| 436 |
combined_text = f"{title} {content}".lower()
|
| 437 |
|
| 438 |
+
diagram_scores = {}
|
| 439 |
+
|
| 440 |
+
for diagram_type, config in FLUX_DIAGRAM_TYPES.items():
|
| 441 |
+
score = 0
|
| 442 |
+
# ํค์๋ ๋งค์นญ
|
| 443 |
+
for keyword in config['keywords']:
|
| 444 |
+
if keyword in combined_text:
|
| 445 |
+
score += config['priority']
|
| 446 |
+
|
| 447 |
+
# ์ถ๊ฐ ์ ์ ๋ถ์ฌ
|
| 448 |
+
if diagram_type == "Flowchart" and any(char in content for char in ['1.', '2.', '3.', 'โ ', 'โก', 'โข']):
|
| 449 |
+
score += 2
|
| 450 |
+
elif diagram_type == "Infographic" and any(word in combined_text for word in ['%', '์ฆ๊ฐ', 'increase', '๊ฐ์', 'decrease']):
|
| 451 |
+
score += 2
|
| 452 |
+
elif diagram_type == "Mindmap" and (content.count('\n-') > 3 or content.count('\nโข') > 3):
|
| 453 |
+
score += 2
|
| 454 |
+
|
| 455 |
+
if score > 0:
|
| 456 |
+
diagram_scores[diagram_type] = score
|
| 457 |
|
| 458 |
+
if diagram_scores:
|
| 459 |
+
best_type = max(diagram_scores.items(), key=lambda x: x[1])
|
| 460 |
+
return best_type[0], min(best_type[1] / 10.0, 1.0) # ์ ๊ทํ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 461 |
|
| 462 |
return None, 0.0
|
| 463 |
|
|
|
|
| 2438 |
|
| 2439 |
# AI ์ด๋ฏธ์ง ๋ฐ ๋ค์ด์ด๊ทธ๋จ ์์ฑ ์๋ฆผ
|
| 2440 |
visual_features = []
|
| 2441 |
+
if include_ai_image and AI_IMAGE_ENABLED:
|
| 2442 |
visual_features.append("AI 3D ํ์ง ์ด๋ฏธ์ง")
|
| 2443 |
if include_diagrams and DIAGRAM_GENERATORS_AVAILABLE:
|
| 2444 |
+
visual_features.append("๋ก์ปฌ ๋ค์ด์ด๊ทธ๋จ (์ต๋ 2๊ฐ)")
|
| 2445 |
if include_flux_images and FLUX_API_ENABLED:
|
| 2446 |
+
visual_features.append("FLUX ๋ค์ด์ด๊ทธ๋จ (์ต์ 5๊ฐ)")
|
| 2447 |
+
visual_features.append("AI ์์ฑ ์ด๋ฏธ์ง")
|
| 2448 |
|
| 2449 |
if visual_features:
|
| 2450 |
yield None, f"๐ ์ฌ๋ผ์ด๋ ์์ฑ ์๋ฃ!\n\n๐จ ์์ฑ ์ค: {', '.join(visual_features)}... (์๊ฐ์ด ์์๋ ์ ์์ต๋๋ค)", llm_response
|
|
|
|
| 2466 |
success_msg += f"๐จ ๋์์ธ ํ
๋ง: {DESIGN_THEMES[design_theme]['name']}\n"
|
| 2467 |
success_msg += f"๐ ๋ ์ด์์ ์คํ์ผ: {layout_style}\n"
|
| 2468 |
|
| 2469 |
+
if include_ai_image and AI_IMAGE_ENABLED:
|
| 2470 |
+
success_msg += f"๐ผ๏ธ AI ์์ฑ 3D ํ์ง ์ด๋ฏธ์ง ํฌํจ\n"
|
| 2471 |
+
if include_diagrams and FLUX_API_ENABLED:
|
| 2472 |
+
success_msg += f"๐ FLUX ๋ค์ด์ด๊ทธ๋จ ํฌํจ (6๊ฐ์ง ํ์
)\n"
|
| 2473 |
if include_diagrams and DIAGRAM_GENERATORS_AVAILABLE:
|
| 2474 |
+
success_msg += f"๐ ๋ก์ปฌ ๋ค์ด์ด๊ทธ๋จ ํฌํจ (1-2๊ฐ)\n"
|
| 2475 |
if include_flux_images and FLUX_API_ENABLED:
|
| 2476 |
+
success_msg += f"๐จ AI ์์ฑ ์ฌ๋ผ์ด๋ ์ด๋ฏธ์ง ํฌํจ\n"
|
| 2477 |
|
| 2478 |
success_msg += f"๐ ์์ฑ๋ ์ฌ๋ผ์ด๋:\n"
|
| 2479 |
|
|
|
|
| 2791 |
include_diagrams = gr.Checkbox(
|
| 2792 |
label="๐ AI ๋ค์ด์ด๊ทธ๋จ",
|
| 2793 |
value=False,
|
| 2794 |
+
info="FLUX ๋ค์ด์ด๊ทธ๋จ 5๊ฐ + ๋ก์ปฌ ๋ค์ด์ด๊ทธ๋จ 1-2๊ฐ ์์ฑ"
|
| 2795 |
)
|
| 2796 |
|
| 2797 |
include_flux_images = gr.Checkbox(
|
|
|
|
| 2846 |
5. **์ฐธ๊ณ ์๋ฃ ์
๋ก๋**: PDF, CSV, TXT ํ์ผ ์ง์
|
| 2847 |
6. **์์ฑ ๋ฒํผ ํด๋ฆญ**: AI๊ฐ ์๋์ผ๋ก PPT ์์ฑ
|
| 2848 |
|
| 2849 |
+
### ๐จ ์๋ก์ด ๊ธฐ๋ฅ - FLUX ๋ค์ด์ด๊ทธ๋จ 6๊ฐ์ง ํ์
|
| 2850 |
+
- **Flowchart**: ํ๋ก์ธ์ค์ ์ํฌํ๋ก์ฐ๋ฅผ ์๊ฐํ (์ฐ์ ์์ ๋์)
|
| 2851 |
+
- **Mindmap**: ๊ฐ๋
๊ณผ ๊ด๊ณ๋ฅผ ๊ตฌ์กฐํํ์ฌ ํํ
|
| 2852 |
+
- **Infographic**: ๋ฐ์ดํฐ์ ํต๊ณ๋ฅผ ์๊ฐ์ ์ผ๋ก ํํ
|
| 2853 |
+
- **Diagram**: ๊ตฌ์กฐ์ ์์คํ
์ ๋ค์ด์ด๊ทธ๋จ์ผ๋ก ํํ
|
| 2854 |
+
- **Mockup**: UI/UX ๋์์ธ ์์ด์ดํ๋ ์
|
| 2855 |
+
- **Product Design**: ์ ํ ์ปจ์
๋์์ธ
|
| 2856 |
+
|
| 2857 |
+
### ๐ ์๊ฐ ์์ ๋ถ๋ฐฐ (10ํ์ด์ง ๊ธฐ์ค)
|
| 2858 |
+
- **ํ์ง**: 3D ์ด๋ฏธ์ง 1๊ฐ
|
| 2859 |
+
- **FLUX ๋ค์ด์ด๊ทธ๋จ**: ์ต์ 5๊ฐ (6๊ฐ์ง ํ์
์ค ์๋ ์ ํ)
|
| 2860 |
+
- **๋ก์ปฌ ๋ค์ด์ด๊ทธ๋จ**: 1-2๊ฐ (WBS, ๋ณต์กํ ํ๋ก์ธ์ค ๋ฑ)
|
| 2861 |
+
- **3D/ํฌํ ์ด๋ฏธ์ง**: ๋๋จธ์ง ์ฌ๋ผ์ด๋์ ๋ถ๋ฐฐ
|
| 2862 |
+
- **๋ชจ๋ ์ฌ๋ผ์ด๋**์ ์๊ฐ์ ์์ ํฌํจ
|
| 2863 |
|
| 2864 |
### ๐ก ๊ณ ๊ธ ํ
|
| 2865 |
+
- **ํ๊ธ ์ง์**: FLUX API๋ฅผ ํตํด ๋ค์ด์ด๊ทธ๋จ ์์ฑ์ผ๋ก ํ๊ธ ๊นจ์ง ๋ฌธ์ ํด๊ฒฐ
|
| 2866 |
+
- **์ค๋งํธ ๋ค์ด์ด๊ทธ๋จ ์ ํ**: ์ฌ๋ผ์ด๋ ๋ด์ฉ์ ๋ถ์ํ์ฌ ๊ฐ์ฅ ์ ํฉํ ๋ค์ด์ด๊ทธ๋จ ํ์
์๋ ์ ํ
|
| 2867 |
+
- **ํ๋ก์ธ์ค ํ๋ก์ฐ ์ฐ์ **: ํ๋ก์ธ์ค ๊ด๋ จ ํค์๋๊ฐ ์์ผ๋ฉด Flowchart๋ฅผ ์ฐ์ ์ ์ฉ
|
| 2868 |
+
- **๊ท ํ์กํ ์๊ฐํ**: ๋ชจ๋ ์ฌ๋ผ์ด๋์ ์ ์ ํ ์๊ฐ ์์๋ฅผ ๋ฐฐ์นํ์ฌ ์ผ๊ด๋ ํ์ง ์ ์ง
|
| 2869 |
"""
|
| 2870 |
)
|
| 2871 |
|
|
|
|
| 2906 |
|
| 2907 |
# Initialize APIs on startup
|
| 2908 |
if __name__ == "__main__":
|
| 2909 |
+
# ํ๊ธ ํฐํธ ํ์ธ (๋ก์ปฌ ๋ค์ด์ด๊ทธ๋จ์ฉ)
|
| 2910 |
if os.path.exists(KOREAN_FONT_PATH):
|
| 2911 |
logger.info(f"โ
ํ๊ธ ํฐํธ ํ์ผ์ ์ฐพ์์ต๋๋ค: {KOREAN_FONT_PATH}")
|
| 2912 |
else:
|
| 2913 |
logger.warning(f"โ ๏ธ ํ๊ธ ํฐํธ ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค: {KOREAN_FONT_PATH}")
|
| 2914 |
+
logger.warning("๋ก์ปฌ ๋ค์ด์ด๊ทธ๋จ์์ ํ๊ธ์ด ๊นจ์ง ์ ์์ต๋๋ค. NanumGothic-Regular.ttf ํ์ผ์ app.py์ ๊ฐ์ ๊ฒฝ๋ก์ ๋ฐฐ์นํ์ธ์.")
|
| 2915 |
|
| 2916 |
# Try to initialize APIs in parallel
|
| 2917 |
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
|
|
|
|
| 2930 |
|
| 2931 |
# ๋ค์ด์ด๊ทธ๋จ ์์ฑ๊ธฐ ๋ชจ๋ ์ํ ํ์ธ
|
| 2932 |
if DIAGRAM_GENERATORS_AVAILABLE:
|
| 2933 |
+
logger.info("โ
๋ก์ปฌ ๋ค์ด์ด๊ทธ๋จ ์์ฑ๊ธฐ ๋ชจ๋์ด ์ ์์ ์ผ๋ก ๋ก๋๋์์ต๋๋ค")
|
| 2934 |
+
logger.info("๋ก์ปฌ ๋ค์ด์ด๊ทธ๋จ ํ์
: Process Flow, Concept Map, WBS, Radial, Synoptic Chart")
|
| 2935 |
else:
|
| 2936 |
+
logger.warning("โ ๏ธ ๋ก์ปฌ ๋ค์ด์ด๊ทธ๋จ ์์ฑ๊ธฐ ๋ชจ๋์ ์ฐพ์ ์ ์์ต๋๋ค.")
|
| 2937 |
+
|
| 2938 |
+
if FLUX_API_ENABLED:
|
| 2939 |
+
logger.info("โ
FLUX ๋ค์ด์ด๊ทธ๋จ ์์ฑ ๊ฐ๋ฅ")
|
| 2940 |
+
logger.info("FLUX ๋ค์ด์ด๊ทธ๋จ ํ์
: Flowchart, Mindmap, Infographic, Diagram, Mockup, Product Design")
|
| 2941 |
|
| 2942 |
demo.launch()
|