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
989a4d31
Commit
989a4d31
authored
May 02, 2024
by
Timothy J. Baek
Browse files
fix
parent
482f010d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
backend/apps/images/main.py
backend/apps/images/main.py
+2
-2
No files found.
backend/apps/images/main.py
View file @
989a4d31
...
@@ -402,7 +402,7 @@ def generate_image(
...
@@ -402,7 +402,7 @@ def generate_image(
for
image
in
res
[
"data"
]:
for
image
in
res
[
"data"
]:
image_filename
=
save_b64_image
(
image
[
"b64_json"
])
image_filename
=
save_b64_image
(
image
[
"b64_json"
])
images
.
append
({
"url"
:
f
"/cache/image/generations/
{
image_filename
}
"
})
images
.
append
({
"url"
:
f
"/cache/image/generations/
{
image_filename
}
"
})
file_body_path
=
IMAGE_CACHE_DIR
.
joinpath
(
f
"
{
image_
id
}
.json"
)
file_body_path
=
IMAGE_CACHE_DIR
.
joinpath
(
f
"
{
image_
filename
}
.json"
)
with
open
(
file_body_path
,
"w"
)
as
f
:
with
open
(
file_body_path
,
"w"
)
as
f
:
json
.
dump
(
data
,
f
)
json
.
dump
(
data
,
f
)
...
@@ -477,7 +477,7 @@ def generate_image(
...
@@ -477,7 +477,7 @@ def generate_image(
for
image
in
res
[
"images"
]:
for
image
in
res
[
"images"
]:
image_filename
=
save_b64_image
(
image
)
image_filename
=
save_b64_image
(
image
)
images
.
append
({
"url"
:
f
"/cache/image/generations/
{
image_filename
}
"
})
images
.
append
({
"url"
:
f
"/cache/image/generations/
{
image_filename
}
"
})
file_body_path
=
IMAGE_CACHE_DIR
.
joinpath
(
f
"
{
image_
id
}
.json"
)
file_body_path
=
IMAGE_CACHE_DIR
.
joinpath
(
f
"
{
image_
filename
}
.json"
)
with
open
(
file_body_path
,
"w"
)
as
f
:
with
open
(
file_body_path
,
"w"
)
as
f
:
json
.
dump
({
**
data
,
"info"
:
res
[
"info"
]},
f
)
json
.
dump
({
**
data
,
"info"
:
res
[
"info"
]},
f
)
...
...
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