Spaces:
Running
on
Zero
Running
on
Zero
Update ui/components.py
Browse files- ui/components.py +16 -1
ui/components.py
CHANGED
@@ -297,6 +297,21 @@ def calculate_quality_score(audio_path: str) -> float:
|
|
297 |
except:
|
298 |
return 50.0 # 기본값
|
299 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
def create_enhanced_process_func(original_func):
|
301 |
"""기존 함수를 향상된 기능으로 래핑"""
|
302 |
|
@@ -1360,7 +1375,7 @@ def create_text2music_ui(
|
|
1360 |
)
|
1361 |
|
1362 |
quality_preset.change(
|
1363 |
-
fn=update_quality_preset,
|
1364 |
inputs=[quality_preset],
|
1365 |
outputs=[infer_step, guidance_scale, scheduler_type, omega_scale, use_erg_diffusion, use_erg_tag]
|
1366 |
)
|
|
|
297 |
except:
|
298 |
return 50.0 # 기본값
|
299 |
|
300 |
+
def update_quality_preset(preset_name):
|
301 |
+
"""품질 프리셋 적용"""
|
302 |
+
if preset_name not in QUALITY_PRESETS:
|
303 |
+
return (100, 15.0, "euler", 10.0, True, True)
|
304 |
+
|
305 |
+
preset = QUALITY_PRESETS[preset_name]
|
306 |
+
return (
|
307 |
+
preset.get("infer_step", 100),
|
308 |
+
preset.get("guidance_scale", 15.0),
|
309 |
+
preset.get("scheduler_type", "euler"),
|
310 |
+
preset.get("omega_scale", 10.0),
|
311 |
+
preset.get("use_erg_diffusion", True),
|
312 |
+
preset.get("use_erg_tag", True)
|
313 |
+
)
|
314 |
+
|
315 |
def create_enhanced_process_func(original_func):
|
316 |
"""기존 함수를 향상된 기능으로 래핑"""
|
317 |
|
|
|
1375 |
)
|
1376 |
|
1377 |
quality_preset.change(
|
1378 |
+
fn=update_quality_preset, # 전역 함수 직접 사용
|
1379 |
inputs=[quality_preset],
|
1380 |
outputs=[infer_step, guidance_scale, scheduler_type, omega_scale, use_erg_diffusion, use_erg_tag]
|
1381 |
)
|