新增runninghub的48G显存机器调用支持

This commit is contained in:
puke
2026-01-06 11:11:11 +08:00
parent 7d78dcd078
commit d6b2f02cce
9 changed files with 69 additions and 16 deletions

View File

@@ -180,15 +180,35 @@ def render_advanced_settings():
f"(https://www.runninghub{'.cn' if get_language() == 'zh_CN' else '.ai'}/?inviteCode=bozpdlbj)"
)
# RunningHub concurrent limit
runninghub_concurrent_limit = st.number_input(
tr("settings.comfyui.runninghub_concurrent_limit"),
min_value=1,
max_value=10,
value=comfyui_config.get("runninghub_concurrent_limit", 1),
help=tr("settings.comfyui.runninghub_concurrent_limit_help"),
key="runninghub_concurrent_limit_input"
)
# RunningHub concurrent limit and instance type (in one row)
limit_col, instance_col = st.columns(2)
with limit_col:
runninghub_concurrent_limit = st.number_input(
tr("settings.comfyui.runninghub_concurrent_limit"),
min_value=1,
max_value=10,
value=comfyui_config.get("runninghub_concurrent_limit", 1),
help=tr("settings.comfyui.runninghub_concurrent_limit_help"),
key="runninghub_concurrent_limit_input"
)
with instance_col:
# Check if instance type is "plus" (48G VRAM enabled)
current_instance_type = comfyui_config.get("runninghub_instance_type") or ""
is_plus_enabled = current_instance_type == "plus"
# Instance type options with i18n
instance_options = [
tr("settings.comfyui.runninghub_instance_24g"),
tr("settings.comfyui.runninghub_instance_48g"),
]
runninghub_instance_type_display = st.selectbox(
tr("settings.comfyui.runninghub_instance_type"),
options=instance_options,
index=1 if is_plus_enabled else 0,
help=tr("settings.comfyui.runninghub_instance_type_help"),
key="runninghub_instance_type_input"
)
# Convert display value back to actual value
runninghub_48g_enabled = runninghub_instance_type_display == tr("settings.comfyui.runninghub_instance_48g")
# ====================================================================
# Action Buttons (full width at bottom)
@@ -206,11 +226,14 @@ def render_advanced_settings():
config_manager.set_llm_config(llm_api_key, llm_base_url, llm_model)
# Save ComfyUI configuration (optional fields, always save what's provided)
# Convert checkbox to instance type: True -> "plus", False -> ""
instance_type = "plus" if runninghub_48g_enabled else ""
config_manager.set_comfyui_config(
comfyui_url=comfyui_url if comfyui_url else None,
comfyui_api_key=comfyui_api_key if comfyui_api_key else None,
runninghub_api_key=runninghub_api_key if runninghub_api_key else None,
runninghub_concurrent_limit=int(runninghub_concurrent_limit)
runninghub_concurrent_limit=int(runninghub_concurrent_limit),
runninghub_instance_type=instance_type
)
# Only save to file if LLM config is valid

View File

@@ -197,6 +197,10 @@
"settings.comfyui.runninghub_get_api_key": "Get RunningHub API Key",
"settings.comfyui.runninghub_concurrent_limit": "Concurrent Limit",
"settings.comfyui.runninghub_concurrent_limit_help": "RunningHub concurrent execution limit (1-10), default is 1 for regular members, adjust based on your membership level",
"settings.comfyui.runninghub_instance_type": "Machine Spec",
"settings.comfyui.runninghub_instance_type_help": "Select RunningHub machine spec, 48G VRAM is suitable for large models or high-resolution generation (requires membership support)",
"settings.comfyui.runninghub_instance_24g": "24G VRAM",
"settings.comfyui.runninghub_instance_48g": "48G VRAM",
"tts.inference_mode": "Synthesis Mode",
"tts.mode.local": "Local Synthesis",
"tts.mode.comfyui": "ComfyUI Synthesis",

View File

@@ -197,6 +197,10 @@
"settings.comfyui.runninghub_get_api_key": "点此获取 RunningHub API Key",
"settings.comfyui.runninghub_concurrent_limit": "并发限制",
"settings.comfyui.runninghub_concurrent_limit_help": "RunningHub 并发执行数量1-10普通会员默认为1请根据您的会员等级调整",
"settings.comfyui.runninghub_instance_type": "机器规格",
"settings.comfyui.runninghub_instance_type_help": "选择 RunningHub 机器规格48G 显存适用于大模型或高分辨率生成(需要会员支持)",
"settings.comfyui.runninghub_instance_24g": "24G 显存",
"settings.comfyui.runninghub_instance_48g": "48G 显存",
"tts.inference_mode": "合成方式",
"tts.mode.local": "本地合成",
"tts.mode.comfyui": "ComfyUI 合成",