修复comfyui地址回显问题

This commit is contained in:
puke
2025-10-26 13:31:45 +08:00
committed by puke
parent a9d793749f
commit 30cb9d9c18
2 changed files with 26 additions and 47 deletions

View File

@@ -46,43 +46,16 @@ llm:
model: "" # Model name
# ==================== TTS Configuration ====================
tts:
default: edge
# 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
# TTS uses Edge TTS by default (free, no configuration needed)
# Optional: Override default voice in code using voice parameter
# ==================== Image Generation Configuration ====================
# Image generation uses ComfyUI workflows
# Workflows are auto-discovered from workflows/image_*.json files
image:
default: comfykit
# ComfyKit - Local or cloud ComfyUI
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
default: default # Default preset name (uses workflows/image_default.json)
comfyui_url: http://127.0.0.1:8188 # Local ComfyUI server
# runninghub_api_key: "" # Optional: RunningHub cloud API key
# ==================== Notes ====================
# 1. LLM Configuration:
@@ -92,12 +65,21 @@ mcp_servers: []
# - Switch LLM: just copy-paste different values from comments
# - 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
# - PRIVATE: Data never leaves your machine
# - Install: https://ollama.com/download
# - Usage: ollama pull llama3.2
#
# 3. Security:
# 5. Security:
# - Never commit config.yaml to version control
# - All sensitive data (API keys) should stay local

19
web.py
View File

@@ -262,14 +262,14 @@ def render_advanced_settings(config_manager: ConfigManager):
with st.container(border=True):
st.markdown(f"**{tr('settings.image.title')}**")
# Get current configuration
comfykit_config = config_manager.config.get("image", {}).get("comfykit", {})
# Get current configuration (flat structure)
image_config = config_manager.config.get("image", {})
# Local/Self-hosted ComfyUI configuration
st.markdown(f"**{tr('settings.image.local_title')}**")
comfyui_url = st.text_input(
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"),
key="comfyui_url_input"
)
@@ -292,7 +292,7 @@ def render_advanced_settings(config_manager: ConfigManager):
st.markdown(f"**{tr('settings.image.cloud_title')}**")
runninghub_api_key = st.text_input(
tr("settings.image.runninghub_api_key"),
value=comfykit_config.get("runninghub_api_key", ""),
value=image_config.get("runninghub_api_key", ""),
type="password",
help=tr("settings.image.runninghub_api_key_help"),
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:
config_manager.set_llm_config(llm_api_key, llm_base_url, llm_model)
# Save Image configuration (both local and cloud can be configured)
config_manager.config["image"]["default"] = "comfykit"
image_config = {}
# Save Image configuration (flat structure)
config_manager.config["image"]["default"] = "default"
if comfyui_url:
image_config["comfyui_url"] = comfyui_url
config_manager.config["image"]["comfyui_url"] = comfyui_url
if runninghub_api_key:
image_config["runninghub_api_key"] = runninghub_api_key
if image_config:
config_manager.config["image"]["comfykit"] = image_config
config_manager.config["image"]["runninghub_api_key"] = runninghub_api_key
# Save to file
config_manager.save()