Files
ComfyUI_Kaggle/notebooks/comfyui_wan22_i2v_sfw_debug.ipynb
T

9.3 KiB

Install ComfyUI and dependencies

In [ ]:
# Install ComfyUI and dependencies
!pip install -q torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
!pip install -q huggingface_hub
!mkdir -p /kaggle/tmp
!git clone https://github.com/comfyanonymous/ComfyUI.git /kaggle/tmp/ComfyUI
%cd /kaggle/tmp/ComfyUI
!pip install -q -r requirements.txt

# Install ComfyUI-Manager
!git clone https://github.com/ltdrdata/ComfyUI-Manager.git custom_nodes/ComfyUI-Manager

# Install ComfyUI-KJNodes (helper nodes used in the official LTX-2.3 GGUF workflow)
!git clone https://github.com/kijai/ComfyUI-KJNodes.git custom_nodes/ComfyUI-KJNodes
!pip install -q -r custom_nodes/ComfyUI-KJNodes/requirements.txt

# Install the missing GGUF loader custom node
!git clone https://github.com/city96/ComfyUI-GGUF.git custom_nodes/ComfyUI-GGUF
%cd /kaggle/tmp/ComfyUI/custom_nodes/ComfyUI-GGUF

# 1. Install required python libraries for GGUF parsing
!pip install -q -r requirements.txt
!pip install -q gguf sentencepiece

print("\nGGUF library dependencies successfully patched!")
!git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git custom_nodes/ComfyUI-VideoHelperSuite
# 1. Move into the video helper suite directory
%cd /kaggle/tmp/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite

# 2. Force install the required system and video manipulation libraries
!pip install -q -r requirements.txt
!pip install -q decord av simplejson imageio-ffmpeg

# Install cloudflared to expose the URL publicly
!wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -O cloudflared
!chmod +x cloudflared

%cd /kaggle/tmp/ComfyUI

Error observed: [Errno 2] No such file or directory: '/kaggle/tmp/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite' — the %cd into that directory failed right after cloning it (likely a timing/path issue), so the following pip install -r requirements.txt and extra installs may have run in the wrong directory.

Download models

In [ ]:
%cd /kaggle/tmp/ComfyUI

# 3. Create the required directory for clip_vision models
!mkdir -p models/clip_vision
# Create standard target directories
!mkdir -p models/unet
!mkdir -p models/text_encoders
!mkdir -p models/vae
!mkdir -p models/clip_vision

# Use huggingface_hub to fetch your chosen model paths
from huggingface_hub import hf_hub_download

print("Downloading clip_vision_h.safetensors from the correct repository...")
hf_hub_download(
    repo_id="Comfy-Org/Wan_2.1_ComfyUI_repackaged",
    filename="split_files/clip_vision/clip_vision_h.safetensors",
    local_dir="models/clip_vision",
    local_dir_use_symlinks=False
)

print("Downloading the Image-to-Video (I2V) GGUF file...")
hf_hub_download(
    repo_id="befox/WAN2.2-14B-Rapid-AllInOne-GGUF",
    filename="v10/wan2.2-i2v-rapid-aio-v10-Q4_K.gguf",
    local_dir="models/unet",
    local_dir_use_symlinks=False
)

print("Downloading Wan 2.1 VAE...")
hf_hub_download(
    repo_id="Comfy-Org/Wan_2.2_ComfyUI_Repackaged",
    filename="split_files/vae/wan_2.1_vae.safetensors",
    local_dir="models/vae",
    local_dir_use_symlinks=False
)

print("Downloading Text Encoder...")
hf_hub_download(
    repo_id="Comfy-Org/Wan_2.1_ComfyUI_repackaged",
    filename="split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors",
    local_dir="models/text_encoders",
    local_dir_use_symlinks=False
)

print("All set! Files successfully downloaded to /kaggle/tmp/ComfyUI/models/.")

(Output confirmed all four files downloaded successfully, with a deprecation warning about local_dir_use_symlinks — harmless, just remove that argument since it's ignored in current huggingface_hub.)

In [ ]:
!find /kaggle/tmp/ComfyUI/models/unet \
       /kaggle/tmp/ComfyUI/models/text_encoders \
       /kaggle/tmp/ComfyUI/models/vae \
       /kaggle/tmp/ComfyUI/models/clip_vision \
       -type f -printf '%p\t%k KB\n'

Output: confirms the four model files are present with expected sizes (unet ~10.6M KB, text_encoder ~6.6M KB, vae ~248K KB, clip_vision ~1.2M KB), plus leftover placeholder/cache files.

In [ ]:
!ps -fp 247

Output: empty — PID 247 doesn't exist (stale reference, harmless).

In [ ]:
!curl -I http://127.0.0.1:8182

Output: curl: (7) Failed to connect to 127.0.0.1 port 8182 after 0 ms: Connection refused — ComfyUI server not yet running at this point.

Create tunnel and get URL

In [ ]:
!ps aux | grep '[m]ain.py'

Output: root 238 33.6 0.3 133508 113412 ? S 06:12 0:02 python3 main.py --listen 0.0.0.0 --port 8182 --enable-manager — confirms ComfyUI's main.py IS running on port 8182.

In [ ]:
!curl -I http://127.0.0.1:8182

Output: still Connection refused — this is the core problem. The process is running (per ps aux) but not accepting connections on 8182 yet (could be still initializing/loading models, or bound to a different interface).

In [ ]:
!ss -ltnp | grep 8182

Output: empty — no output was captured/shown for this cell, so it's unclear if anything is actually listening on 8182.

In [ ]:
import subprocess

tunnel = subprocess.Popen(
    ["/kaggle/tmp/cloudflared", "tunnel", "--url", "http://localhost:8182"],
    stdout=subprocess.PIPE,
    stderr=subprocess.STDOUT
)

print("Waiting for URL... (may take 15-20 seconds)")
for line in iter(tunnel.stdout.readline, b""):
    line = line.decode().strip()
    print(line)
    if "https://" in line and "trycloudflare.com" in line:
        for word in line.split():
            if word.startswith("https://") and "trycloudflare.com" in word:
                print("\n\u2705 Your ComfyUI URL:", word)
                break
        break

Core issue to investigate: main.py shows as running in ps aux, but curl to 127.0.0.1:8182 keeps refusing the connection — so the tunnel step never gets a live server to connect to. Check whether ComfyUI is still loading the (large) GGUF model, whether it crashed silently after the ps snapshot, or whether it's listening on a different port/interface than expected.