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
a725801e
Commit
a725801e
authored
Aug 08, 2024
by
Michael Poluektov
Browse files
fix: formatting test errors, remove print, merge dev
parent
8cdf9814
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
backend/apps/images/main.py
backend/apps/images/main.py
+1
-1
backend/apps/images/utils/comfyui.py
backend/apps/images/utils/comfyui.py
+6
-5
backend/apps/openai/main.py
backend/apps/openai/main.py
+2
-2
backend/utils/misc.py
backend/utils/misc.py
+0
-1
No files found.
backend/apps/images/main.py
View file @
a725801e
...
...
@@ -514,7 +514,7 @@ async def image_generations(
data
=
ImageGenerationPayload
(
**
data
)
res
=
comfyui_generate_image
(
res
=
await
comfyui_generate_image
(
app
.
state
.
config
.
MODEL
,
data
,
user
.
id
,
...
...
backend/apps/images/utils/comfyui.py
View file @
a725801e
import
asyncio
import
websocket
# NOTE: websocket-client (https://github.com/websocket-client/websocket-client)
import
uuid
import
json
...
...
@@ -328,7 +329,7 @@ class ImageGenerationPayload(BaseModel):
flux_fp8_clip
:
Optional
[
bool
]
=
None
def
comfyui_generate_image
(
async
def
comfyui_generate_image
(
model
:
str
,
payload
:
ImageGenerationPayload
,
client_id
,
base_url
):
ws_url
=
base_url
.
replace
(
"http://"
,
"ws://"
).
replace
(
"https://"
,
"wss://"
)
...
...
@@ -377,9 +378,9 @@ def comfyui_generate_image(
comfyui_prompt
[
"12"
][
"inputs"
][
"weight_dtype"
]
=
payload
.
flux_weight_dtype
if
payload
.
flux_fp8_clip
:
comfyui_prompt
[
"11"
][
"inputs"
][
"
clip_name2
"
]
=
"t5xxl_fp8_e4m3fn.safetensors"
comfyui_prompt
[
"11"
][
"inputs"
][
"clip_name2"
]
=
(
"
t5xxl_fp8_e4m3fn.safetensors
"
)
comfyui_prompt
[
"5"
][
"inputs"
][
"batch_size"
]
=
payload
.
n
comfyui_prompt
[
"5"
][
"inputs"
][
"width"
]
=
payload
.
width
...
...
@@ -397,7 +398,7 @@ def comfyui_generate_image(
return
None
try
:
images
=
get_images
(
ws
,
comfyui_prompt
,
client_id
,
base_url
)
images
=
await
asyncio
.
to_thread
(
get_images
,
ws
,
comfyui_prompt
,
client_id
,
base_url
)
except
Exception
as
e
:
log
.
exception
(
f
"Error while receiving images:
{
e
}
"
)
images
=
None
...
...
backend/apps/openai/main.py
View file @
a725801e
backend/utils/misc.py
View file @
a725801e
...
...
@@ -192,7 +192,6 @@ def apply_model_params_to_body_ollama(params: dict, form_data: dict) -> dict:
if
(
param
:
=
params
.
get
(
key
,
None
))
is
not
None
:
form_data
[
value
]
=
param
print
(
form_data
)
return
form_data
...
...
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