400 Bad Request while recieving the image in Krita from Modal?
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Expected Behavior
the output should be like this
CONNECT /ws -> 101 Switching Protocols (duration: 169.9 s, execution: 0.0 ms)
GET /api/queue -> 200 OK (duration: 78.8 ms, execution: 12.8 ms)
GET /api/history -> 200 OK (duration: 210.9 ms, execution: 36.5 ms)
POST /api/etn/workflow/subscribe -> 200 OK (duration: 318.7 ms, execution: 239.1 ms)
⠧ Loading images (1 containers initializing)... View app at
### Actual Behavior
so I am using Modal to run comfyUi and then got a link and Krita is successfully connected to the Modal but when the image processing is about to be done it got this while receiving the image:
CONNECT /ws -> 101 Switching Protocols (duration: 169.9 s, execution: 0.0 ms)
GET /api/queue -> 200 OK (duration: 78.8 ms, execution: 12.8 ms)
GET /api/history -> 200 OK (duration: 210.9 ms, execution: 36.5 ms)
POST /api/etn/workflow/subscribe -> 400 Bad Request (duration: 318.7 ms, execution: 239.1 ms)
⠧ Loading images (1 containers initializing)... View app at
### Steps to Reproduce
using this attached script, I am running comfyUI and after it.
I use krita which is a free tool downloaded from here: https://krita.org/en/download/
then I installed this plugin to connect krita and ComfyUI using the link that is provided by the modal.
plugin link: https://github.com/Acly/krita-ai-diffusion/releases/tag/v1.30.0
then when using the comfyUI share link provided by the modal I paste that it in the krita and everything is working fine but as soon as the output needs to be get back to krita I got the error.
the script:
import json
import subprocess
import uuid
from pathlib import Path
from typing import Dict
import modal
flux = ( # Download image layers to run FLUX_Q8.gguf model
modal.Image.debian_slim( #this starts with a basic and supported python version
python_version="3.11"
)
.apt_install("git") # install git
.apt_install("nano") # install to have a minimal text editor if we wanted to change something minimal
.pip_install("comfy-cli") # install comfy-cli
.run_commands( # use comfy-cli to install the ComfyUI repo and its dependencies
"comfy --skip-prompt install --nvidia",
)
.run_commands( # gguf node required for q8 model
"comfy node install https://github.com/ltdrdata/ComfyUI-Manager",
"comfy node install https://github.com/Fannovel16/comfyui_controlnet_aux",
"comfy node install https://github.com/BlenderNeko/ComfyUI_ADV_CLIP_emb",
"comfy node install https://github.com/cubiq/ComfyUI_IPAdapter_plus",
"comfy node install https://github.com/shiimizu/ComfyUI_smZNodes",
"comfy node install https://github.com/Acly/comfyui-tooling-nodes",
"comfy node install https://github.com/Acly/comfyui-inpaint-nodes",
"comfy node install https://github.com/TheMistoAI/ComfyUI-Anyline.git",
)
.run_commands( # download the krita stuff
"comfy --skip-prompt model download --url https://huggingface.co/h94/IP-Adapter/resolve/main/models/image_encoder/model.safetensors --relative-path models/clip_vision --filename clip-vision_vit-h.safetensors",
"comfy --skip-prompt model download --url https://huggingface.co/gemasai/4x_NMKD-Superscale-SP_178000_G/resolve/main/4x_NMKD-Superscale-SP_178000_G.pth --relative-path models/upscale_models --filename 4x_NMKD-Superscale-SP_178000_G.pth",
"comfy --skip-prompt model download --url https://huggingface.co/Acly/Omni-SR/resolve/main/OmniSR_X2_DIV2K.safetensors --relative-path models/upscale_models --filename OmniSR_X2_DIV2K.safetensors",
"comfy --skip-prompt model download --url https://huggingface.co/Acly/Omni-SR/resolve/main/OmniSR_X3_DIV2K.safetensors --relative-path models/upscale_models --filename OmniSR_X3_DIV2K.safetensors",
"comfy --skip-prompt model download --url https://huggingface.co/Acly/Omni-SR/resolve/main/OmniSR_X4_DIV2K.safetensors --relative-path models/upscale_models --filename OmniSR_X4_DIV2K.safetensors",
"comfy --skip-prompt model download --url https://huggingface.co/Acly/MAT/resolve/main/MAT_Places512_G_fp16.safetensors --relative-path models/inpaint --filename MAT_Places512_G_fp16.safetensors",
"comfy --skip-prompt model download --url https://huggingface.co/h94/IP-Adapter/resolve/main/sdxl_models/ip-adapter_sdxl_vit-h.safetensors --relative-path models/ipadapter --filename ip-adapter_sdxl_vit-h.safetensors",
"comfy --skip-prompt model download --url https://huggingface.co/ByteDance/Hyper-SD/resolve/main/Hyper-SDXL-8steps-CFG-lora.safetensors --relative-path models/loras --filename Hyper-SDXL-8steps-CFG-lora.safetensors",
"comfy --skip-prompt model download --url https://huggingface.co/lllyasviel/fooocus_inpaint/resolve/main/fooocus_inpaint_head.pth --relative-path models/inpaint --filename fooocus_inpaint_head.pth",
"comfy --skip-prompt model download --url https://huggingface.co/lllyasviel/fooocus_inpaint/resolve/main/inpaint_v26.fooocus.patch --relative-path models/inpaint --filename inpaint_v26.fooocus.patch",
)
.run_commands( # download the cliper model required to use with GGUF model
"comfy --skip-prompt model download --url https://civitai.com/models/404154?modelVersionId=1295881 --relative-path models/checkpoints --filename WAI-ANI-PONYXL_13.safetensors",
)
)
app = modal.App(name="Comfyui_Mine", image=flux)
@app.function(
allow_concurrent_inputs=10,
concurrency_limit=1,
container_idle_timeout=30,
timeout=3200,
gpu="l4", # here you can change the gpu, i recommend either a10g or T4
)
@modal.web_server(8000, startup_timeout=60)
def ui():
subprocess.Popen("comfy launch -- --listen 0.0.0.0 --port 8000", shell=True)
### Debug Logs
```powershell
No logs
```
### Other
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.