修复comfyui地址回显问题
This commit is contained in:
@@ -46,43 +46,16 @@ llm:
|
|||||||
model: "" # Model name
|
model: "" # Model name
|
||||||
|
|
||||||
# ==================== TTS Configuration ====================
|
# ==================== TTS Configuration ====================
|
||||||
tts:
|
# TTS uses Edge TTS by default (free, no configuration needed)
|
||||||
default: edge
|
# Optional: Override default voice in code using voice parameter
|
||||||
|
|
||||||
# Edge TTS - Free, good quality
|
|
||||||
edge:
|
|
||||||
# No configuration needed
|
|
||||||
|
|
||||||
# Azure TTS - Premium quality (optional)
|
|
||||||
# azure:
|
|
||||||
# api_key: your_azure_key
|
|
||||||
# region: eastus
|
|
||||||
# voice: zh-CN-XiaoxiaoNeural
|
|
||||||
|
|
||||||
# ==================== Image Generation Configuration ====================
|
# ==================== Image Generation Configuration ====================
|
||||||
|
# Image generation uses ComfyUI workflows
|
||||||
|
# Workflows are auto-discovered from workflows/image_*.json files
|
||||||
image:
|
image:
|
||||||
default: comfykit
|
default: default # Default preset name (uses workflows/image_default.json)
|
||||||
|
comfyui_url: http://127.0.0.1:8188 # Local ComfyUI server
|
||||||
# ComfyKit - Local or cloud ComfyUI
|
# runninghub_api_key: "" # Optional: RunningHub cloud API key
|
||||||
comfykit:
|
|
||||||
comfyui_url: http://127.0.0.1:8188 # Local ComfyUI server
|
|
||||||
# runninghub_api_key: "" # Optional: RunningHub cloud API key
|
|
||||||
|
|
||||||
# ==================== External MCP Servers (Optional) ====================
|
|
||||||
mcp_servers: []
|
|
||||||
# Example: Add custom MCP server
|
|
||||||
# - name: custom_llm_server
|
|
||||||
# url: http://localhost:8080/mcp
|
|
||||||
# protocol: sse
|
|
||||||
# enabled: true
|
|
||||||
# description: My custom LLM server
|
|
||||||
|
|
||||||
# Example: Add Pixelle MCP server
|
|
||||||
# - name: pixelle
|
|
||||||
# url: http://localhost:8888/mcp
|
|
||||||
# protocol: sse
|
|
||||||
# enabled: false
|
|
||||||
# description: Pixelle image generation
|
|
||||||
|
|
||||||
# ==================== Notes ====================
|
# ==================== Notes ====================
|
||||||
# 1. LLM Configuration:
|
# 1. LLM Configuration:
|
||||||
@@ -92,12 +65,21 @@ mcp_servers: []
|
|||||||
# - Switch LLM: just copy-paste different values from comments
|
# - Switch LLM: just copy-paste different values from comments
|
||||||
# - WebUI provides quick preset selection
|
# - WebUI provides quick preset selection
|
||||||
#
|
#
|
||||||
# 2. Ollama (Recommended for Privacy):
|
# 2. TTS Configuration:
|
||||||
|
# - No configuration needed, uses Edge TTS by default (free)
|
||||||
|
# - Override voice in code: await reelforge.tts(text="...", voice="zh-CN-XiaoxiaoNeural")
|
||||||
|
#
|
||||||
|
# 3. Image Generation:
|
||||||
|
# - Add workflow files: workflows/image_*.json
|
||||||
|
# - Auto-discovered presets: workflows/image_flux.json -> preset="flux"
|
||||||
|
# - Default preset: workflows/image_default.json
|
||||||
|
#
|
||||||
|
# 4. Ollama (Recommended for Privacy):
|
||||||
# - FREE: No API costs
|
# - FREE: No API costs
|
||||||
# - PRIVATE: Data never leaves your machine
|
# - PRIVATE: Data never leaves your machine
|
||||||
# - Install: https://ollama.com/download
|
# - Install: https://ollama.com/download
|
||||||
# - Usage: ollama pull llama3.2
|
# - Usage: ollama pull llama3.2
|
||||||
#
|
#
|
||||||
# 3. Security:
|
# 5. Security:
|
||||||
# - Never commit config.yaml to version control
|
# - Never commit config.yaml to version control
|
||||||
# - All sensitive data (API keys) should stay local
|
# - All sensitive data (API keys) should stay local
|
||||||
|
|||||||
19
web.py
19
web.py
@@ -262,14 +262,14 @@ def render_advanced_settings(config_manager: ConfigManager):
|
|||||||
with st.container(border=True):
|
with st.container(border=True):
|
||||||
st.markdown(f"**{tr('settings.image.title')}**")
|
st.markdown(f"**{tr('settings.image.title')}**")
|
||||||
|
|
||||||
# Get current configuration
|
# Get current configuration (flat structure)
|
||||||
comfykit_config = config_manager.config.get("image", {}).get("comfykit", {})
|
image_config = config_manager.config.get("image", {})
|
||||||
|
|
||||||
# Local/Self-hosted ComfyUI configuration
|
# Local/Self-hosted ComfyUI configuration
|
||||||
st.markdown(f"**{tr('settings.image.local_title')}**")
|
st.markdown(f"**{tr('settings.image.local_title')}**")
|
||||||
comfyui_url = st.text_input(
|
comfyui_url = st.text_input(
|
||||||
tr("settings.image.comfyui_url"),
|
tr("settings.image.comfyui_url"),
|
||||||
value=comfykit_config.get("comfyui_url", "http://127.0.0.1:8188"),
|
value=image_config.get("comfyui_url", "http://127.0.0.1:8188"),
|
||||||
help=tr("settings.image.comfyui_url_help"),
|
help=tr("settings.image.comfyui_url_help"),
|
||||||
key="comfyui_url_input"
|
key="comfyui_url_input"
|
||||||
)
|
)
|
||||||
@@ -292,7 +292,7 @@ def render_advanced_settings(config_manager: ConfigManager):
|
|||||||
st.markdown(f"**{tr('settings.image.cloud_title')}**")
|
st.markdown(f"**{tr('settings.image.cloud_title')}**")
|
||||||
runninghub_api_key = st.text_input(
|
runninghub_api_key = st.text_input(
|
||||||
tr("settings.image.runninghub_api_key"),
|
tr("settings.image.runninghub_api_key"),
|
||||||
value=comfykit_config.get("runninghub_api_key", ""),
|
value=image_config.get("runninghub_api_key", ""),
|
||||||
type="password",
|
type="password",
|
||||||
help=tr("settings.image.runninghub_api_key_help"),
|
help=tr("settings.image.runninghub_api_key_help"),
|
||||||
key="runninghub_api_key_input"
|
key="runninghub_api_key_input"
|
||||||
@@ -311,15 +311,12 @@ def render_advanced_settings(config_manager: ConfigManager):
|
|||||||
if llm_api_key and llm_base_url and llm_model:
|
if llm_api_key and llm_base_url and llm_model:
|
||||||
config_manager.set_llm_config(llm_api_key, llm_base_url, llm_model)
|
config_manager.set_llm_config(llm_api_key, llm_base_url, llm_model)
|
||||||
|
|
||||||
# Save Image configuration (both local and cloud can be configured)
|
# Save Image configuration (flat structure)
|
||||||
config_manager.config["image"]["default"] = "comfykit"
|
config_manager.config["image"]["default"] = "default"
|
||||||
image_config = {}
|
|
||||||
if comfyui_url:
|
if comfyui_url:
|
||||||
image_config["comfyui_url"] = comfyui_url
|
config_manager.config["image"]["comfyui_url"] = comfyui_url
|
||||||
if runninghub_api_key:
|
if runninghub_api_key:
|
||||||
image_config["runninghub_api_key"] = runninghub_api_key
|
config_manager.config["image"]["runninghub_api_key"] = runninghub_api_key
|
||||||
if image_config:
|
|
||||||
config_manager.config["image"]["comfykit"] = image_config
|
|
||||||
|
|
||||||
# Save to file
|
# Save to file
|
||||||
config_manager.save()
|
config_manager.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user