Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
916ce9bc
Unverified
Commit
916ce9bc
authored
Apr 13, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Apr 13, 2024
Browse files
Merge pull request #1500 from lainedfles/config-image-generation-enabled
feat: add IMAGE_GENERATION_ENABLED env var
parents
2649d29a
0981fae1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
backend/apps/images/main.py
backend/apps/images/main.py
+8
-2
backend/config.py
backend/config.py
+3
-0
No files found.
backend/apps/images/main.py
View file @
916ce9bc
...
...
@@ -29,7 +29,13 @@ import base64
import
json
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__
)
...
...
@@ -48,7 +54,7 @@ app.add_middleware(
)
app
.
state
.
ENGINE
=
""
app
.
state
.
ENABLED
=
False
app
.
state
.
ENABLED
=
IMAGE_GENERATION_ENABLED
app
.
state
.
OPENAI_API_KEY
=
""
app
.
state
.
MODEL
=
""
...
...
backend/config.py
View file @
916ce9bc
...
...
@@ -456,5 +456,8 @@ WHISPER_MODEL_DIR = os.getenv("WHISPER_MODEL_DIR", f"{CACHE_DIR}/whisper/models"
# Images
####################################
ENABLE_IMAGE_GENERATION
=
(
os
.
environ
.
get
(
"ENABLE_IMAGE_GENERATION"
,
""
).
lower
()
==
"true"
)
AUTOMATIC1111_BASE_URL
=
os
.
getenv
(
"AUTOMATIC1111_BASE_URL"
,
""
)
COMFYUI_BASE_URL
=
os
.
getenv
(
"COMFYUI_BASE_URL"
,
""
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment