فهرست منبع

feat: image env var

Timothy J. Baek 1 سال پیش
والد
کامیت
e3d253b040
2فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 4 4
      backend/apps/images/main.py
  2. 4 0
      backend/config.py

+ 4 - 4
backend/apps/images/main.py

@@ -35,8 +35,8 @@ from config import (
     ENABLE_IMAGE_GENERATION,
     ENABLE_IMAGE_GENERATION,
     AUTOMATIC1111_BASE_URL,
     AUTOMATIC1111_BASE_URL,
     COMFYUI_BASE_URL,
     COMFYUI_BASE_URL,
-    OPENAI_API_BASE_URL,
-    OPENAI_API_KEY,
+    IMAGE_OPENAI_API_BASE_URL,
+    IMAGE_OPENAI_API_KEY,
 )
 )
 
 
 
 
@@ -58,8 +58,8 @@ app.add_middleware(
 app.state.ENGINE = ""
 app.state.ENGINE = ""
 app.state.ENABLED = ENABLE_IMAGE_GENERATION
 app.state.ENABLED = ENABLE_IMAGE_GENERATION
 
 
-app.state.OPENAI_API_BASE_URL = OPENAI_API_BASE_URL
-app.state.OPENAI_API_KEY = OPENAI_API_KEY
+app.state.OPENAI_API_BASE_URL = IMAGE_OPENAI_API_BASE_URL
+app.state.OPENAI_API_KEY = IMAGE_OPENAI_API_KEY
 
 
 app.state.MODEL = ""
 app.state.MODEL = ""
 
 

+ 4 - 0
backend/config.py

@@ -487,6 +487,10 @@ AUTOMATIC1111_BASE_URL = os.getenv("AUTOMATIC1111_BASE_URL", "")
 COMFYUI_BASE_URL = os.getenv("COMFYUI_BASE_URL", "")
 COMFYUI_BASE_URL = os.getenv("COMFYUI_BASE_URL", "")
 
 
 
 
+IMAGE_OPENAI_API_BASE_URL = os.getenv("IMAGE_OPENAI_API_BASE_URL", OPENAI_API_BASE_URL)
+IMAGE_OPENAI_API_KEY = os.getenv("IMAGE_OPENAI_API_KEY", OPENAI_API_KEY)
+
+
 ####################################
 ####################################
 # Audio
 # Audio
 ####################################
 ####################################