haepada commited on
Commit
c9c9cb7
·
verified ·
1 Parent(s): 6ad653f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -15
app.py CHANGED
@@ -343,19 +343,13 @@ def generate_detailed_prompt(text, emotions, text_sentiment):
343
  "차분/진지": "균형잡힌 수직선과 안정적인 구조"
344
  }
345
 
346
- if emotions["intensity"] > 70:
347
- visual_style = "역동적인 붓질과 강한 대비의 추상적 구성"
348
- elif emotions["intensity"] > 40:
349
- visual_style = "균형잡힌 구도와 중간 톤의 기하학적 패턴"
350
- else:
351
- visual_style = "부드러운 그라데이션과 미니멀한 추상 형태"
352
-
353
- prompt = f"abstract ethereal art, {emotion_colors.get(emotions['primary'], '자연스러운 색상')} 기반, "
354
- prompt += f"{visual_style}, {abstract_elements.get(emotions['primary'], '유기적 형태')}. "
355
- prompt += f"감정의 시각화: {emotions['characteristics'][0] if emotions['characteristics'] else '평온한 상태'}, "
356
- prompt += "minimalistic composition, korean traditional art influence, no human figures, no faces. "
357
- prompt += "geometric patterns, flowing energy, mystical atmosphere, ethereal lighting. "
358
- prompt += "digital art, high detail, luminescent effects, --ar 2:3"
359
 
360
  return prompt
361
 
@@ -719,7 +713,15 @@ def create_interface():
719
  visible=False
720
  )
721
 
 
 
 
 
 
 
 
722
  def handle_blessing_complete(audio, state):
 
723
  if audio is None:
724
  return (
725
  state,
@@ -734,7 +736,6 @@ def create_interface():
734
  )
735
 
736
  try:
737
- # 간소화된 분석 과정
738
  features = calculate_baseline_features(audio)
739
  if features is None:
740
  return (
@@ -1057,7 +1058,6 @@ def create_interface():
1057
  outputs=[story_section, welcome_section, blessing_section, entry_guide_section]
1058
  )
1059
 
1060
- # 이벤트 연결부터 수정
1061
  set_baseline_btn.click(
1062
  fn=handle_blessing_complete,
1063
  inputs=[baseline_audio, state],
@@ -1081,6 +1081,7 @@ def create_interface():
1081
  entry_guide_section
1082
  ]
1083
  )
 
1084
  enter_btn.click(
1085
  fn=handle_enter,
1086
  outputs=[tabs]
 
343
  "차분/진지": "균형잡힌 수직선과 안정적인 구조"
344
  }
345
 
346
+ prompt = f"minimalistic abstract art, {emotion_colors.get(emotions['primary'], '자연스러운 색상')} color scheme, "
347
+ prompt += f"{abstract_elements.get(emotions['primary'], '유기적 형태')}, "
348
+ prompt += "korean traditional patterns, ethereal atmosphere, sacred geometry, "
349
+ prompt += "flowing energy, mystical aura, no human figures, no faces, "
350
+ prompt += "digital art, high detail, luminescent effects. "
351
+ prompt += "negative prompt: photorealistic, human, face, figurative, text, letters, "
352
+ prompt += "--ar 2:3 --s 750 --q 2"
 
 
 
 
 
 
353
 
354
  return prompt
355
 
 
713
  visible=False
714
  )
715
 
716
+ def next_section():
717
+ """다음 단계로 이동하는 핸들러"""
718
+ return (
719
+ gr.update(visible=False), # blessing_section
720
+ gr.update(visible=True) # entry_guide_section
721
+ )
722
+
723
  def handle_blessing_complete(audio, state):
724
+ """축원 완료 처리 핸들러"""
725
  if audio is None:
726
  return (
727
  state,
 
736
  )
737
 
738
  try:
 
739
  features = calculate_baseline_features(audio)
740
  if features is None:
741
  return (
 
1058
  outputs=[story_section, welcome_section, blessing_section, entry_guide_section]
1059
  )
1060
 
 
1061
  set_baseline_btn.click(
1062
  fn=handle_blessing_complete,
1063
  inputs=[baseline_audio, state],
 
1081
  entry_guide_section
1082
  ]
1083
  )
1084
+
1085
  enter_btn.click(
1086
  fn=handle_enter,
1087
  outputs=[tabs]