feat: add civitai_api_key to config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 14:31:10 +01:00
parent 44088649d8
commit a8308874d2
2 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
{
"remote_url": "http://192.168.1.3:8188",
"timeout": 30,
"path_mappings": {}
"path_mappings": {},
"civitai_api_key": ""
}
+6
View File
@@ -19,6 +19,7 @@ class RemoteConfig:
self.remote_url: str = ""
self.timeout: int = 30
self.path_mappings: dict[str, str] = {}
self.civitai_api_key: str = ""
self._load()
# ------------------------------------------------------------------
@@ -35,6 +36,7 @@ class RemoteConfig:
self.remote_url = data.get("remote_url", "")
self.timeout = int(data.get("timeout", 30))
self.path_mappings = data.get("path_mappings", {})
self.civitai_api_key = data.get("civitai_api_key", "")
except Exception as exc:
logger.warning("[LM-Remote] Failed to read config.json: %s", exc)
@@ -44,6 +46,10 @@ class RemoteConfig:
if env_timeout:
self.timeout = int(env_timeout)
env_api_key = os.environ.get("LM_CIVITAI_API_KEY", "")
if env_api_key:
self.civitai_api_key = env_api_key
# Strip trailing slash
self.remote_url = self.remote_url.rstrip("/")