mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 21:42:58 +00:00
Merge pull request #1647 from dyamagishi/comfyui_ws_schema
fix: Websocket Connection failed with ComfyUI server over HTTPS
This commit is contained in:
commit
f202a95661
@ -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(
|
|||||||
|
|
||||||
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}")
|
||||||
|
Loading…
Reference in New Issue
Block a user