NimaNzrii / comfyui-photoshop

ComfyUi inside of your Photoshop! you can install the plugin and enjoy free ai genration
Other
690 stars 37 forks source link

Port shouldn't be hardcoded, and also it will be great to add https/wss support. #204

Closed morgan55555 closed 3 months ago

morgan55555 commented 3 months ago

Currently port 8188 hardcoded into this PS addon, and for changing it (my Comfy build is on another port), I need to edit addon files directly or change port of my server. Also, I have a https proxy for my Comfy interface, but http/ws also hardcoded in this addon, blocking me for using https/wss protocols.

NimaNzrii commented 3 months ago

added port support

you can update the plugin to use it

TianyueHu commented 2 months ago

I still see the following code in connection.js: socket = new WebSocket("ws://" + window.location.hostname + ":8188/ps/ws?platform=cm&clientId=" + generateClientId());

Please help confirm that the modification has indeed taken effect. I found that the local is still trying to connect to the remote 8188 request, but the comfyui deployed on the remote cannot open the 8188 port due to platform settings.

There are many such logs in my remote comfyui service: [2024-09-27 08:07] 2024-09-27 08:07:35.841142 # PS: User client-yt4on97vx disconnected from Photoshop (ps)[2024-09-27 08:07] 2024-09-27 08:07:35.960975 # PS: client-yt4on97vx Photoshop Connected [2024-09-27 08:07] 2024-09-27 08:07:35.961149 # PS: PS not connected[2024-09-27 08:07] 2024-09-27 08:07:37.898893 # PS: PS not connected [2024-09-27 08:08] 2024-09-27 08:08:09.955886 # PS: PS not connected [2024-09-27 08:11] 2024-09-27 08:11:23.327605 # PS: User client-yt4on97vx disconnected from Photoshop (ps) [2024-09-27 08:11] 2024-09-27 08:11:23.446642 # PS: client-yt4on97vx Photoshop Connected [2024-09-27 08:11] 2024-09-27 08:11:23.446803 # PS: PS not connected [2024-09-27 08:11] 2024-09-27 08:11:51.275498 # PS: User client-yt4on97vx disconnected from Photoshop (ps) [2024-09-27 08:11] 2024-09-27 08:11:51.393667 # PS: client-yt4on97vx Photoshop Connected [2024-09-27 08:11] 2024-09-27 08:11:51.393855 # PS: PS not connected [2024-09-27 08:12] 2024-09-27 08:12:06.990958 # PS: PS not connected

Alamin-Alex commented 4 weeks ago

With port not working

D:\ComfyUI_windows_portable2>.\python_embeded\python.exe -s ComfyUI\main.py  --windows-standalone-build --listen 0.0.0.0 --port 8192 --disable-cuda-malloc
[START] Security scan
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2024-11-05 13:11:34.609260
** Platform: Windows
** Python version: 3.12.7 (tags/v3.12.7:0b05ead, Oct  1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]
** Python executable: D:\ComfyUI_windows_portable2\python_embeded\python.exe
** ComfyUI Path: D:\ComfyUI_windows_portable2\ComfyUI
** Log path: D:\ComfyUI_windows_portable2\comfyui.log

Prestartup times for custom nodes:
   0.0 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\rgthree-comfy
   1.6 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 4096 MB, total RAM 524165 MB
pytorch version: 2.5.0+cu124
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce GTX 1650 : native
Using pytorch cross attention
[Prompt Server] web root: D:\ComfyUI_windows_portable2\ComfyUI\web
D:\ComfyUI_windows_portable2\python_embeded\Lib\site-packages\kornia\feature\lightglue.py:44: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)
D:\ComfyUI_windows_portable2\python_embeded\Lib\site-packages\onnxruntime\capi\onnxruntime_validation.py:26: UserWarning: Unsupported Windows version (2022server). ONNX Runtime supports Windows 10 and above, only.
  warnings.warn(
### Loading: ComfyUI-Manager (V2.51.9)
### ComfyUI Revision: 2810 [69694f40] | Released on '2024-11-04'
[comfyui_controlnet_aux] | INFO -> Using ckpts path: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts
[comfyui_controlnet_aux] | INFO -> Using symlinks: False
[comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider']
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\comfyui_controlnet_aux\node_wrappers\dwpose.py:26: UserWarning: DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly
  warnings.warn("DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly")
[comfy_mtb] | INFO -> loaded 83 nodes successfuly
[comfy_mtb] | INFO -> Some nodes (5) could not be loaded. This can be ignored, but go to http://None:8192/mtb if you want more information.

[rgthree-comfy] Loaded 42 exciting nodes. 🎉

Import times for custom nodes:
   0.0 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\websocket_image_save.py
   0.0 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\cg-use-everywhere
   0.0 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\comfyui-photoshop
   0.0 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\ComfyUI-Advanced-ControlNet
   0.0 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\rgthree-comfy
   0.0 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\ComfyUI_essentials
   0.4 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\ComfyUI-Manager
   0.6 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\comfyui_controlnet_aux
   3.1 seconds: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\comfy_mtb

Starting server

To see the GUI go to: http://0.0.0.0:8192
FETCH DATA from: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE]
# PS: client-nhmg2s098 Photoshop Connected
# PS: PS not connected
# PS: User client-nhmg2s098 disconnected from Photoshop (ps)
# PS: client-nhmg2s098 Photoshop Connected
# PS: PS not connected
FETCH DATA from: D:\ComfyUI_windows_portable2\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json [DONE]