#!/bin/bash
# Read GGUF code to understand GGMLTensor.to() and GGUFModelPatcher.load()
echo "=== GGUF nodes.py (GGUFModelPatcher) ==="
cat /home/fabian/ComfyUI/custom_nodes/ComfyUI-GGUF/nodes.py 2>/dev/null | head -200
echo ""
echo "=== GGUF ops.py (GGMLTensor) ==="
cat /home/fabian/ComfyUI/custom_nodes/ComfyUI-GGUF/ops.py 2>/dev/null | head -300
echo ""
echo "=== model_patcher.py load() and partially_load() ==="
grep -n "def load\|def partially_load\|def model_use_more_vram\|\.to(" /home/fabian/ComfyUI/comfy/model_patcher.py | head -60
echo ""
echo "=== model_management.py load flow ==="
grep -n "def model_load\|def model_use_more_vram\|def load_models_gpu\|partially_load\|\.to(" /home/fabian/ComfyUI/comfy/model_management.py | head -40
echo ""
echo "=== Current process status ==="
ps aux | grep "main.py\|python" | grep -v grep | head -5
echo ""
echo "=== Memory ==="
free -m
