支持ComfyUI ApiKey配置
This commit is contained in:
@@ -21,6 +21,7 @@ llm:
|
||||
comfyui:
|
||||
# Global ComfyUI settings
|
||||
comfyui_url: http://127.0.0.1:8188 # ComfyUI server URL (required for selfhost workflows)
|
||||
comfyui_api_key: "" # ComfyUI API key (optional, get from https://platform.comfy.org/profile/api-keys)
|
||||
# Note for Docker users: Use host.docker.internal:8188 (Mac/Windows) or host IP address (Linux)
|
||||
runninghub_api_key: "" # RunningHub API key (required for runninghub workflows)
|
||||
|
||||
|
||||
@@ -145,12 +145,14 @@ class ConfigManager:
|
||||
def set_comfyui_config(
|
||||
self,
|
||||
comfyui_url: Optional[str] = None,
|
||||
comfyui_api_key: Optional[str] = None,
|
||||
runninghub_api_key: Optional[str] = None
|
||||
):
|
||||
"""Set ComfyUI global configuration"""
|
||||
updates = {}
|
||||
if comfyui_url is not None:
|
||||
updates["comfyui_url"] = comfyui_url
|
||||
updates["comfyui_api_key"] = comfyui_api_key
|
||||
updates["runninghub_api_key"] = runninghub_api_key
|
||||
|
||||
if updates:
|
||||
|
||||
@@ -116,6 +116,8 @@ class PixelleVideoCore:
|
||||
|
||||
if comfyui_config.get("comfyui_url"):
|
||||
kit_config["comfyui_url"] = comfyui_config["comfyui_url"]
|
||||
if comfyui_config.get("comfyui_api_key"):
|
||||
kit_config["api_key"] = comfyui_config["comfyui_api_key"]
|
||||
if comfyui_config.get("runninghub_api_key"):
|
||||
kit_config["runninghub_api_key"] = comfyui_config["runninghub_api_key"]
|
||||
|
||||
|
||||
@@ -134,12 +134,22 @@ def render_advanced_settings():
|
||||
|
||||
# Local/Self-hosted ComfyUI configuration
|
||||
st.markdown(f"**{tr('settings.comfyui.local_title')}**")
|
||||
comfyui_url = st.text_input(
|
||||
tr("settings.comfyui.comfyui_url"),
|
||||
value=comfyui_config.get("comfyui_url", "http://127.0.0.1:8188"),
|
||||
help=tr("settings.comfyui.comfyui_url_help"),
|
||||
key="comfyui_url_input"
|
||||
)
|
||||
url_col, key_col = st.columns(2)
|
||||
with url_col:
|
||||
comfyui_url = st.text_input(
|
||||
tr("settings.comfyui.comfyui_url"),
|
||||
value=comfyui_config.get("comfyui_url", "http://127.0.0.1:8188"),
|
||||
help=tr("settings.comfyui.comfyui_url_help"),
|
||||
key="comfyui_url_input"
|
||||
)
|
||||
with key_col:
|
||||
comfyui_api_key = st.text_input(
|
||||
tr("settings.comfyui.comfyui_api_key"),
|
||||
value=comfyui_config.get("comfyui_api_key", ""),
|
||||
type="password",
|
||||
help=tr("settings.comfyui.comfyui_api_key_help"),
|
||||
key="comfyui_api_key_input"
|
||||
)
|
||||
|
||||
# Test connection button
|
||||
if st.button(tr("btn.test_connection"), key="test_comfyui", use_container_width=True):
|
||||
@@ -186,6 +196,7 @@ def render_advanced_settings():
|
||||
# Save ComfyUI configuration
|
||||
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
|
||||
)
|
||||
|
||||
|
||||
@@ -187,6 +187,8 @@
|
||||
"settings.comfyui.cloud_title": "RunningHub Cloud",
|
||||
"settings.comfyui.comfyui_url": "ComfyUI Server URL",
|
||||
"settings.comfyui.comfyui_url_help": "Local or remote ComfyUI server address",
|
||||
"settings.comfyui.comfyui_api_key": "ComfyUI API Key",
|
||||
"settings.comfyui.comfyui_api_key_help": "Optional, get from https://platform.comfy.org/profile/api-keys",
|
||||
"settings.comfyui.runninghub_api_key": "RunningHub API Key",
|
||||
"settings.comfyui.runninghub_api_key_help": "Visit https://runninghub.ai to register and get API Key",
|
||||
"settings.comfyui.runninghub_hint": "No local ComfyUI? Use RunningHub Cloud:",
|
||||
|
||||
@@ -187,6 +187,8 @@
|
||||
"settings.comfyui.cloud_title": "RunningHub 云端",
|
||||
"settings.comfyui.comfyui_url": "ComfyUI 服务器地址",
|
||||
"settings.comfyui.comfyui_url_help": "本地或远程 ComfyUI 服务器地址",
|
||||
"settings.comfyui.comfyui_api_key": "ComfyUI API 密钥",
|
||||
"settings.comfyui.comfyui_api_key_help": "可选,访问 https://platform.comfy.org/profile/api-keys 获取",
|
||||
"settings.comfyui.runninghub_api_key": "RunningHub API 密钥",
|
||||
"settings.comfyui.runninghub_api_key_help": "访问 https://runninghub.ai 注册并获取 API Key",
|
||||
"settings.comfyui.runninghub_hint": "没有本地 ComfyUI?可用 RunningHub 云端:",
|
||||
|
||||
Reference in New Issue
Block a user