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
489c45ff
Commit
489c45ff
authored
Apr 22, 2024
by
dyamagishi
Browse files
fix: Update websocket protocol based on the original schema.
parent
948f2e91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
backend/apps/images/utils/comfyui.py
backend/apps/images/utils/comfyui.py
+2
-2
No files found.
backend/apps/images/utils/comfyui.py
View file @
489c45ff
...
@@ -195,7 +195,7 @@ class ImageGenerationPayload(BaseModel):
...
@@ -195,7 +195,7 @@ class ImageGenerationPayload(BaseModel):
def
comfyui_generate_image
(
def
comfyui_generate_image
(
model
:
str
,
payload
:
ImageGenerationPayload
,
client_id
,
base_url
model
:
str
,
payload
:
ImageGenerationPayload
,
client_id
,
base_url
):
):
host
=
base_url
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
ws_url
=
base_url
.
replace
(
"http://"
,
"
ws://
"
).
replace
(
"https://"
,
"
wss://
"
)
comfyui_prompt
=
json
.
loads
(
COMFYUI_DEFAULT_PROMPT
)
comfyui_prompt
=
json
.
loads
(
COMFYUI_DEFAULT_PROMPT
)
...
@@ -217,7 +217,7 @@ def comfyui_generate_image(
...
@@ -217,7 +217,7 @@ def comfyui_generate_image(
try
:
try
:
ws
=
websocket
.
WebSocket
()
ws
=
websocket
.
WebSocket
()
ws
.
connect
(
f
"ws
://
{
host
}
/ws?clientId=
{
client_id
}
"
)
ws
.
connect
(
f
"
{
ws
_url
}
/ws?clientId=
{
client_id
}
"
)
log
.
info
(
"WebSocket connection established."
)
log
.
info
(
"WebSocket connection established."
)
except
Exception
as
e
:
except
Exception
as
e
:
log
.
exception
(
f
"Failed to connect to WebSocket server:
{
e
}
"
)
log
.
exception
(
f
"Failed to connect to WebSocket server:
{
e
}
"
)
...
...
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