#!/bin/bash
API="http://127.0.0.1:8188"

echo "=== GGUF nodes ==="
curl -s "$API/object_info" | python3.11 -c "
import sys, json
d = json.load(sys.stdin)
for k in sorted(d.keys()):
    if 'gguf' in k.lower():
        print(k)
        info = d[k]
        if 'input' in info and 'required' in info['input']:
            for param, cfg in info['input']['required'].items():
                print(f'  {param}: {cfg}')
"

echo ""
echo "=== CLIPLoader info ==="
curl -s "$API/object_info/CLIPLoader" | python3.11 -c "
import sys, json
d = json.load(sys.stdin)
if 'CLIPLoader' in d:
    info = d['CLIPLoader']
    if 'input' in info and 'required' in info['input']:
        for param, cfg in info['input']['required'].items():
            print(f'  {param}: {cfg}')
"

echo ""
echo "=== Model folders ==="
echo "unet:"; ls /home/fabian/ComfyUI/models/unet/ 2>/dev/null
echo "diffusion_models:"; ls /home/fabian/ComfyUI/models/diffusion_models/ 2>/dev/null
echo "text_encoders:"; ls /home/fabian/ComfyUI/models/text_encoders/ 2>/dev/null
echo "clip:"; ls /home/fabian/ComfyUI/models/clip/ 2>/dev/null
echo "vae:"; ls /home/fabian/ComfyUI/models/vae/ 2>/dev/null
