{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Install ComfyUI and dependencies" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Install ComfyUI and dependencies\n", "!pip install -q torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118\n", "!pip install -q huggingface_hub\n", "!mkdir -p /kaggle/tmp\n", "!git clone https://github.com/comfyanonymous/ComfyUI.git /kaggle/tmp/ComfyUI\n", "%cd /kaggle/tmp/ComfyUI\n", "!pip install -q -r requirements.txt\n", "\n", "# Install ComfyUI-Manager\n", "!git clone https://github.com/ltdrdata/ComfyUI-Manager.git custom_nodes/ComfyUI-Manager\n", "\n", "# Install ComfyUI-KJNodes (helper nodes used in the official LTX-2.3 GGUF workflow)\n", "!git clone https://github.com/kijai/ComfyUI-KJNodes.git custom_nodes/ComfyUI-KJNodes\n", "!pip install -q -r custom_nodes/ComfyUI-KJNodes/requirements.txt\n", "\n", "# Install the missing GGUF loader custom node\n", "!git clone https://github.com/city96/ComfyUI-GGUF.git custom_nodes/ComfyUI-GGUF\n", "%cd /kaggle/tmp/ComfyUI/custom_nodes/ComfyUI-GGUF\n", "\n", "# 1. Install required python libraries for GGUF parsing\n", "!pip install -q -r requirements.txt\n", "!pip install -q gguf sentencepiece\n", "\n", "print(\"\\nGGUF library dependencies successfully patched!\")\n", "!git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git custom_nodes/ComfyUI-VideoHelperSuite\n", "# 1. Move into the video helper suite directory\n", "%cd /kaggle/tmp/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite\n", "\n", "# 2. Force install the required system and video manipulation libraries\n", "!pip install -q -r requirements.txt\n", "!pip install -q decord av simplejson imageio-ffmpeg\n", "\n", "# Install cloudflared to expose the URL publicly\n", "!wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -O cloudflared\n", "!chmod +x cloudflared\n", "\n", "%cd /kaggle/tmp/ComfyUI\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Error observed:** `[Errno 2] No such file or directory: '/kaggle/tmp/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite'` \u2014 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." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Download models" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%cd /kaggle/tmp/ComfyUI\n", "\n", "# 3. Create the required directory for clip_vision models\n", "!mkdir -p models/clip_vision\n", "# Create standard target directories\n", "!mkdir -p models/unet\n", "!mkdir -p models/text_encoders\n", "!mkdir -p models/vae\n", "!mkdir -p models/clip_vision\n", "\n", "# Use huggingface_hub to fetch your chosen model paths\n", "from huggingface_hub import hf_hub_download\n", "\n", "print(\"Downloading clip_vision_h.safetensors from the correct repository...\")\n", "hf_hub_download(\n", " repo_id=\"Comfy-Org/Wan_2.1_ComfyUI_repackaged\",\n", " filename=\"split_files/clip_vision/clip_vision_h.safetensors\",\n", " local_dir=\"models/clip_vision\",\n", " local_dir_use_symlinks=False\n", ")\n", "\n", "print(\"Downloading the Image-to-Video (I2V) GGUF file...\")\n", "hf_hub_download(\n", " repo_id=\"befox/WAN2.2-14B-Rapid-AllInOne-GGUF\",\n", " filename=\"v10/wan2.2-i2v-rapid-aio-v10-Q4_K.gguf\",\n", " local_dir=\"models/unet\",\n", " local_dir_use_symlinks=False\n", ")\n", "\n", "print(\"Downloading Wan 2.1 VAE...\")\n", "hf_hub_download(\n", " repo_id=\"Comfy-Org/Wan_2.2_ComfyUI_Repackaged\",\n", " filename=\"split_files/vae/wan_2.1_vae.safetensors\",\n", " local_dir=\"models/vae\",\n", " local_dir_use_symlinks=False\n", ")\n", "\n", "print(\"Downloading Text Encoder...\")\n", "hf_hub_download(\n", " repo_id=\"Comfy-Org/Wan_2.1_ComfyUI_repackaged\",\n", " filename=\"split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors\",\n", " local_dir=\"models/text_encoders\",\n", " local_dir_use_symlinks=False\n", ")\n", "\n", "print(\"All set! Files successfully downloaded to /kaggle/tmp/ComfyUI/models/.\")\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*(Output confirmed all four files downloaded successfully, with a deprecation warning about `local_dir_use_symlinks` \u2014 harmless, just remove that argument since it's ignored in current `huggingface_hub`.)*" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!find /kaggle/tmp/ComfyUI/models/unet \\\n", " /kaggle/tmp/ComfyUI/models/text_encoders \\\n", " /kaggle/tmp/ComfyUI/models/vae \\\n", " /kaggle/tmp/ComfyUI/models/clip_vision \\\n", " -type f -printf '%p\\t%k KB\\n'\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**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." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!ps -fp 247\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Output:** empty \u2014 PID 247 doesn't exist (stale reference, harmless)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!curl -I http://127.0.0.1:8182\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Output:** `curl: (7) Failed to connect to 127.0.0.1 port 8182 after 0 ms: Connection refused` \u2014 ComfyUI server not yet running at this point." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Create tunnel and get URL" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!ps aux | grep '[m]ain.py'\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**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` \u2014 confirms ComfyUI's `main.py` IS running on port 8182." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!curl -I http://127.0.0.1:8182\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Output:** still `Connection refused` \u2014 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)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!ss -ltnp | grep 8182\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Output:** empty \u2014 no output was captured/shown for this cell, so it's unclear if anything is actually listening on 8182." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import subprocess\n", "\n", "tunnel = subprocess.Popen(\n", " [\"/kaggle/tmp/cloudflared\", \"tunnel\", \"--url\", \"http://localhost:8182\"],\n", " stdout=subprocess.PIPE,\n", " stderr=subprocess.STDOUT\n", ")\n", "\n", "print(\"Waiting for URL... (may take 15-20 seconds)\")\n", "for line in iter(tunnel.stdout.readline, b\"\"):\n", " line = line.decode().strip()\n", " print(line)\n", " if \"https://\" in line and \"trycloudflare.com\" in line:\n", " for word in line.split():\n", " if word.startswith(\"https://\") and \"trycloudflare.com\" in word:\n", " print(\"\\n\\u2705 Your ComfyUI URL:\", word)\n", " break\n", " break\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Core issue to investigate:** `main.py` shows as running in `ps aux`, but `curl` to `127.0.0.1:8182` keeps refusing the connection \u2014 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." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python", "version": "3.12.13", "mimetype": "text/x-python", "codemirror_mode": { "name": "ipython", "version": 3 }, "pygments_lexer": "ipython3", "nbconvert_exporter": "python", "file_extension": ".py" } }, "nbformat": 4, "nbformat_minor": 5 }