forked from open-webui/open-webui
Merge pull request #1500 from lainedfles/config-image-generation-enabled
feat: add IMAGE_GENERATION_ENABLED env var
This commit is contained in:
commit
916ce9bc4f
2 changed files with 11 additions and 2 deletions
|
@ -29,7 +29,13 @@ import base64
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from config import SRC_LOG_LEVELS, CACHE_DIR, AUTOMATIC1111_BASE_URL, COMFYUI_BASE_URL
|
from config import (
|
||||||
|
SRC_LOG_LEVELS,
|
||||||
|
CACHE_DIR,
|
||||||
|
IMAGE_GENERATION_ENABLED,
|
||||||
|
AUTOMATIC1111_BASE_URL,
|
||||||
|
COMFYUI_BASE_URL,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -48,7 +54,7 @@ app.add_middleware(
|
||||||
)
|
)
|
||||||
|
|
||||||
app.state.ENGINE = ""
|
app.state.ENGINE = ""
|
||||||
app.state.ENABLED = False
|
app.state.ENABLED = IMAGE_GENERATION_ENABLED
|
||||||
|
|
||||||
app.state.OPENAI_API_KEY = ""
|
app.state.OPENAI_API_KEY = ""
|
||||||
app.state.MODEL = ""
|
app.state.MODEL = ""
|
||||||
|
|
|
@ -456,5 +456,8 @@ WHISPER_MODEL_DIR = os.getenv("WHISPER_MODEL_DIR", f"{CACHE_DIR}/whisper/models"
|
||||||
# Images
|
# Images
|
||||||
####################################
|
####################################
|
||||||
|
|
||||||
|
ENABLE_IMAGE_GENERATION = (
|
||||||
|
os.environ.get("ENABLE_IMAGE_GENERATION", "").lower() == "true"
|
||||||
|
)
|
||||||
AUTOMATIC1111_BASE_URL = os.getenv("AUTOMATIC1111_BASE_URL", "")
|
AUTOMATIC1111_BASE_URL = os.getenv("AUTOMATIC1111_BASE_URL", "")
|
||||||
COMFYUI_BASE_URL = os.getenv("COMFYUI_BASE_URL", "")
|
COMFYUI_BASE_URL = os.getenv("COMFYUI_BASE_URL", "")
|
||||||
|
|
Loading…
Reference in a new issue